]> www.infradead.org Git - users/hch/misc.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)
committerMikulas Patocka <mpatocka@redhat.com>
Mon, 4 Nov 2024 16:39:31 +0000 (17:39 +0100)
commitf484697e619a83ecc370443a34746379ad99d204
tree63bdf5b8de9075c414540643ef739b61a51e09fd
parent792227719725497ce10a8039803bec13f89f8910
dm cache: optimize dirty bit checking with find_next_bit when resizing

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>
drivers/md/dm-cache-target.c