]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
bcache: remove discard code from alloc.c
authorColy Li <colyli@fnnas.com>
Thu, 13 Nov 2025 05:36:23 +0000 (13:36 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 13 Nov 2025 16:18:06 +0000 (09:18 -0700)
commitb4056afbd4b90f5bdbdc53cca2768f9b8872a2dd
tree9e5e448817c32ab407fc5dce2bd4375b9c27932f
parent0c72e9fcc156caaf123a6291321bc9bd74cd1b61
bcache: remove discard code from alloc.c

Bcache allocator initially has no free space to allocate. Firstly it
does a garbage collection which is triggered by a cache device write
and fills free space into ca->free[] lists. The discard happens after
the free bucket is handled by garbage collection added into one of the
ca->free[] lists. But normally this bucket will be allocated out very
soon to requester and filled data onto it. The discard hint on this
bucket LBA range doesn't help SSD control to improve internal erasure
performance, and waste extra CPU cycles to issue discard bios.

This patch removes the almost-useless discard code from alloc.c.

Signed-off-by: Coly Li <colyli@fnnas.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/alloc.c