<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/mm/backing-dev.c, branch linux-4.16.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.16.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.16.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2018-06-25T23:54:01+00:00</updated>
<entry>
<title>bdi: Move cgroup bdi_writeback to a dedicated low concurrency workqueue</title>
<updated>2018-06-25T23:54:01+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2018-05-23T17:56:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d7b76de131b4598e0bb12d9da83a5e99b8deda30'/>
<id>urn:sha1:d7b76de131b4598e0bb12d9da83a5e99b8deda30</id>
<content type='text'>
commit f183464684190bacbfb14623bd3e4e51b7575b4c upstream.

From 0aa2e9b921d6db71150633ff290199554f0842a8 Mon Sep 17 00:00:00 2001
From: Tejun Heo &lt;tj@kernel.org&gt;
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.

  [&lt;ffffffff810ee40c&gt;] _synchronize_rcu_expedited.constprop.72+0x2fc/0x330
  [&lt;ffffffff810ee634&gt;] synchronize_rcu_expedited+0x24/0x30
  [&lt;ffffffff811ccf23&gt;] bdi_unregister+0x53/0x290
  [&lt;ffffffff811cd1e9&gt;] release_bdi+0x89/0xc0
  [&lt;ffffffff811cd645&gt;] wb_exit+0x85/0xa0
  [&lt;ffffffff811cdc84&gt;] cgwb_release_workfn+0x54/0xb0
  [&lt;ffffffff810a68d0&gt;] process_one_work+0x150/0x410
  [&lt;ffffffff810a71fd&gt;] worker_thread+0x6d/0x520
  [&lt;ffffffff810ad3dc&gt;] kthread+0x12c/0x160
  [&lt;ffffffff81969019&gt;] ret_from_fork+0x29/0x40
  [&lt;ffffffffffffffff&gt;] 0xffffffffffffffff

The events leading to the lockup are...

1. A lot of cgwb_release_workfn() is queued at the same time and all
   system_wq kworkers are assigned to execute them.

2. They all end up calling synchronize_rcu_expedited().  One of them
   wins and tries to perform the expedited synchronization.

3. However, that invovles queueing rcu_exp_work to system_wq and
   waiting for it.  Because #1 is holding all available kworkers on
   system_wq, rcu_exp_work can't be executed.  cgwb_release_workfn()
   is waiting for synchronize_rcu_expedited() which in turn is waiting
   for cgwb_release_workfn() to free up some of the kworkers.

We shouldn't be scheduling hundreds of cgwb_release_workfn() at the
same time.  There's nothing to be gained from that.  This patch
updates cgwb release path to use a dedicated percpu workqueue with
@max_active of 1.

While this resolves the problem at hand, it might be a good idea to
isolate rcu_exp_work to its own workqueue too as it can be used from
various paths and is prone to this sort of indirect A-A deadlocks.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: "Paul E. McKenney" &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>bdi: Fix use after free bug in debugfs_remove()</title>
<updated>2018-05-16T08:12:28+00:00</updated>
<author>
<name>Tetsuo Handa</name>
<email>penguin-kernel@I-love.SAKURA.ne.jp</email>
</author>
<published>2018-04-23T02:21:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c25ed3941e2d8ba90509be9e666059e4484b727e'/>
<id>urn:sha1:c25ed3941e2d8ba90509be9e666059e4484b727e</id>
<content type='text'>
commit f53823c18131e755905b4f654196fd2cc3953f6e upstream.

syzbot is reporting use after free bug in debugfs_remove() [1].

This is because fault injection made memory allocation for
debugfs_create_file() from bdi_debug_register() from bdi_register_va()
fail and continued with setting WB_registered. But when debugfs_remove()
is called from debugfs_remove(bdi-&gt;debug_dir) from bdi_debug_unregister()
 from bdi_unregister() from release_bdi() because WB_registered was set
by bdi_register_va(), IS_ERR_OR_NULL(bdi-&gt;debug_dir) == false despite
debugfs_remove(bdi-&gt;debug_dir) was already called from bdi_register_va().

Fix this by making IS_ERR_OR_NULL(bdi-&gt;debug_dir) == true.

[1] https://syzkaller.appspot.com/bug?id=5ab4efd91a96dcea9b68104f159adf4af2a6dfc1

Signed-off-by: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Reported-by: syzbot &lt;syzbot+049cb4ae097049dac137@syzkaller.appspotmail.com&gt;
Fixes: 97f07697932e6faf ("bdi: convert bdi_debug_register to int")
Cc: weiping zhang &lt;zhangweiping@didichuxing.com&gt;
Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>bdi: wake up concurrent wb_shutdown() callers.</title>
<updated>2018-05-16T08:12:28+00:00</updated>
<author>
<name>Tetsuo Handa</name>
<email>penguin-kernel@I-love.SAKURA.ne.jp</email>
</author>
<published>2018-05-01T22:07:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7c35c8733243fa478a457fd3a1d3dbb93e046c29'/>
<id>urn:sha1:7c35c8733243fa478a457fd3a1d3dbb93e046c29</id>
<content type='text'>
commit 8236b0ae31c837d2b3a2565c5f8d77f637e824cc upstream.

syzbot is reporting hung tasks at wait_on_bit(WB_shutting_down) in
wb_shutdown() [1]. This seems to be because commit 5318ce7d46866e1d ("bdi:
Shutdown writeback on all cgwbs in cgwb_bdi_destroy()") forgot to call
wake_up_bit(WB_shutting_down) after clear_bit(WB_shutting_down).

Introduce a helper function clear_and_wake_up_bit() and use it, in order
to avoid similar errors in future.

[1] https://syzkaller.appspot.com/bug?id=b297474817af98d5796bc544e1bb806fc3da0e5e

Signed-off-by: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Reported-by: syzbot &lt;syzbot+c0cf869505e03bdf1a24@syzkaller.appspotmail.com&gt;
Fixes: 5318ce7d46866e1d ("bdi: Shutdown writeback on all cgwbs in cgwb_bdi_destroy()")
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Suggested-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Revert "bdi: add error handle for bdi_debug_register"</title>
<updated>2017-12-21T17:01:30+00:00</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@kernel.dk</email>
</author>
<published>2017-12-21T17:01:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6d0e4827b72afc71349784336d5eb6df4df106e6'/>
<id>urn:sha1:6d0e4827b72afc71349784336d5eb6df4df106e6</id>
<content type='text'>
This reverts commit a0747a859ef6d3cc5b6cd50eb694499b78dd0025.

It breaks some booting for some users, and more than a week
into this, there's still no good fix. Revert this commit
for now until a solution has been found.

Reported-by: Laura Abbott &lt;labbott@redhat.com&gt;
Reported-by: Bruno Wolff III &lt;bruno@wolff.to&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>bdi: add error handle for bdi_debug_register</title>
<updated>2017-11-19T18:02:13+00:00</updated>
<author>
<name>weiping zhang</name>
<email>zhangweiping@didichuxing.com</email>
</author>
<published>2017-11-17T15:06:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a0747a859ef6d3cc5b6cd50eb694499b78dd0025'/>
<id>urn:sha1:a0747a859ef6d3cc5b6cd50eb694499b78dd0025</id>
<content type='text'>
In order to make error handle more cleaner we call bdi_debug_register
before set state to WB_registered, that we can avoid call bdi_unregister
in release_bdi().

Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: weiping zhang &lt;zhangweiping@didichuxing.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>bdi: convert bdi_debug_register to int</title>
<updated>2017-11-19T18:02:13+00:00</updated>
<author>
<name>weiping zhang</name>
<email>zhangweiping@didichuxing.com</email>
</author>
<published>2017-10-31T10:37:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=97f07697932e6faf2a708f7aef7cba8e6b0cab96'/>
<id>urn:sha1:97f07697932e6faf2a708f7aef7cba8e6b0cab96</id>
<content type='text'>
Convert bdi_debug_register to int and then do error handle for it.

Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: weiping zhang &lt;zhangweiping@didichuxing.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>backing-dev: kill unused pdflush_proc_obsolete()</title>
<updated>2017-10-06T14:15:15+00:00</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@kernel.dk</email>
</author>
<published>2017-10-06T14:15:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=775d3a35dc3e13de55ec0e061c59e36faa7dd7f0'/>
<id>urn:sha1:775d3a35dc3e13de55ec0e061c59e36faa7dd7f0</id>
<content type='text'>
After commit b35bd0d9f8a8, pdflush_proc_obsolete() is no longer
used. Kill the function and declaration.

Reported-by: Rakesh Pandit &lt;rakesh@tuxera.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>mm/backing-dev.c: fix an error handling path in 'cgwb_create()'</title>
<updated>2017-09-11T20:16:44+00:00</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2017-09-11T19:43:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0b045bd1c1c2819b33f4522e3efa4666d1ecf1a4'/>
<id>urn:sha1:0b045bd1c1c2819b33f4522e3efa4666d1ecf1a4</id>
<content type='text'>
If the 'kmalloc' fails, we must go through the existing error handling
path.

Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Fixes: 52ebea749aae ("writeback: make backing_dev_info host cgroup-specific bdi_writebacks")
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>bdi: Drop 'parent' argument from bdi_register[_va]()</title>
<updated>2017-04-20T18:09:55+00:00</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2017-04-12T10:24:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7c4cc30024946dae9530cd6dc0d8d4eb40fca173'/>
<id>urn:sha1:7c4cc30024946dae9530cd6dc0d8d4eb40fca173</id>
<content type='text'>
Drop 'parent' argument of bdi_register() and bdi_register_va().  It is
always NULL.

Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>block: Remove unused functions</title>
<updated>2017-04-20T18:09:55+00:00</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2017-04-12T10:24:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2e82b84c01d9438d86079980e22e036eee71e754'/>
<id>urn:sha1:2e82b84c01d9438d86079980e22e036eee71e754</id>
<content type='text'>
Now that all backing_dev_info structure are allocated separately, we can
drop some unused functions.

Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
</feed>
