• Tejun Heo's avatar
    bdi: Move cgroup bdi_writeback to a dedicated low concurrency workqueue · f1834646
    Tejun Heo authored
    From 0aa2e9b921d6db71150633ff290199554f0842a8 Mon Sep 17 00:00:00 2001
    From: Tejun Heo <tj@kernel.org>
    Date: Wed, 23 May 2018 10:29:00 -0700
    
    cgwb_release() punts the actual release to cgwb_release_workfn() on
    system_wq.  Depending on the number of cgroups or block devices, there
    can be a lot of cgwb_release_workfn() in flight at the same time.
    
    We're periodically seeing close to 256 kworkers getting stuck with the
    following stack trace and overtime the entire system gets stuck.
    
      [<ffffffff810ee40c>] _synchronize_rcu_expedited.constprop.72+0x2fc/0x330
      [<ffffffff810ee634>] synchronize_rcu_expedited+0x24/0x30
      [<ffffffff811ccf23>] bdi_unregister+0x53/0x290
      [<ffffffff811cd1e9>] release_bdi+0x89/0xc0
      [<ffffffff811cd645>] wb_exit+0x85/0xa0
      [<ffffffff811cdc84>] cgwb_release_workfn+0x54/0xb0
      [<ffffffff810a68d0>] process_one_work+0x150/0x410
      [<ffffffff810a71fd>] worker_thread+0x6d/0x520
      [<ffffffff810ad3dc>] kthread+0x12c/0x16...
    f1834646
backing-dev.c 27 KB