]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dm cache: optimize dirty bit checking with find_next_bit when resizing
authorMing-Hung Tsai <mtsai@redhat.com>
Tue, 22 Oct 2024 07:13:39 +0000 (15:13 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Nov 2024 12:13:39 +0000 (13:13 +0100)
commit01c4e15a45bb7d57192a2fc26133177d40bce33b
tree46a47c8fe4541fda5941876a1f7cb61389631f51
parentff1dd8a04c30e8d4e2fd5c83198ca672eb6a9e7f
dm cache: optimize dirty bit checking with find_next_bit when resizing

commit f484697e619a83ecc370443a34746379ad99d204 upstream.

When shrinking the fast device, dm-cache iteratively searches for a
dirty bit among the cache blocks to be dropped, which is less efficient.
Use find_next_bit instead, as it is twice as fast as the iterative
approach with test_bit.

Signed-off-by: Ming-Hung Tsai <mtsai@redhat.com>
Fixes: f494a9c6b1b6 ("dm cache: cache shrinking support")
Cc: stable@vger.kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Acked-by: Joe Thornber <thornber@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-cache-target.c