]> git.hungrycats.org Git - linux/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>
Sun, 17 Nov 2024 13:59:37 +0000 (14:59 +0100)
commitf136d8d3f26fd5113e80ba7c70f7e9a5932295b3
tree8a2c4009bc6f1f2d98b924d999711ed3141bad69
parentee1f74925717ab36f6a091104c170639501ce818
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