summaryrefslogtreecommitdiff
path: root/drivers/nvme/target/tcp.c
diff options
context:
space:
mode:
authorColy Li <colyli@suse.de>2022-09-19 19:16:47 +0300
committerJens Axboe <axboe@kernel.dk>2022-09-19 20:12:35 +0300
commitd2d05b88035d2d51a5bb6c5afec88a0880c73df4 (patch)
tree944e9c8c732856a1782ee14d183f2b4813efb440 /drivers/nvme/target/tcp.c
parent6dd3be6923eec2c49860e7292e4e2783c74a9dff (diff)
downloadlinux-d2d05b88035d2d51a5bb6c5afec88a0880c73df4.tar.xz
bcache: fix set_at_max_writeback_rate() for multiple attached devices
Inside set_at_max_writeback_rate() the calculation in following if() check is wrong, if (atomic_inc_return(&c->idle_counter) < atomic_read(&c->attached_dev_nr) * 6) Because each attached backing device has its own writeback thread running and increasing c->idle_counter, the counter increates much faster than expected. The correct calculation should be, (counter / dev_nr) < dev_nr * 6 which equals to, counter < dev_nr * dev_nr * 6 This patch fixes the above mistake with correct calculation, and helper routine idle_counter_exceeded() is added to make code be more clear. Reported-by: Mingzhe Zou <mingzhe.zou@easystack.cn> Signed-off-by: Coly Li <colyli@suse.de> Acked-by: Mingzhe Zou <mingzhe.zou@easystack.cn> Link: https://lore.kernel.org/r/20220919161647.81238-6-colyli@suse.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/nvme/target/tcp.c')
0 files changed, 0 insertions, 0 deletions