]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dm bufio: when done scanning return from __scan immediately
authorMikulas Patocka <mpatocka@redhat.com>
Wed, 1 Oct 2014 17:29:48 +0000 (13:29 -0400)
committerJiri Slaby <jslaby@suse.cz>
Thu, 13 Nov 2014 18:02:20 +0000 (19:02 +0100)
commitde91001eafdb327475a4034b97b1871170d1f0ce
tree9d52269709ae03f59285e48175e6ba8261b23eee
parent15188b0745439aa1f686e6eb55cacabbe2ea0244
dm bufio: when done scanning return from __scan immediately

commit 0e825862f3c04cee40e25f55680333728a4ffa9b upstream.

When __scan frees the required number of buffer entries that the
shrinker requested (nr_to_scan becomes zero) it must return.  Before
this fix the __scan code exited only the inner loop and continued in the
outer loop -- which could result in reduced performance due to extra
buffers being freed (e.g. unnecessarily evicted thinp metadata needing
to be synchronously re-read into bufio's cache).

Also, move dm_bufio_cond_resched to __scan's inner loop, so that
iterating the bufio client's lru lists doesn't result in scheduling
latency.

Reported-by: Joe Thornber <thornber@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/md/dm-bufio.c