block/mq-deadline: Stop using per-CPU counters
authorBart Van Assche <bvanassche@acm.org>
Mon, 27 Sep 2021 22:03:27 +0000 (15:03 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 18 Oct 2021 12:17:02 +0000 (06:17 -0600)
commitbce0363ed84af8e8e27df464b2082f4b5f58b57e
treee402c278902eab9834a9d123d00c8a3ff6e23669
parent32f64cad97187f4aed50aca3ed1b5a51a00f848b
block/mq-deadline: Stop using per-CPU counters

Calculating the sum over all CPUs of per-CPU counters frequently is
inefficient. Hence switch from per-CPU to individual counters. Three
counters are protected by the mq-deadline spinlock since these are
only accessed from contexts that already hold that spinlock. The fourth
counter is atomic because protecting it with the mq-deadline spinlock
would trigger lock contention.

Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Niklas Cassel <Niklas.Cassel@wdc.com>
Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20210927220328.1410161-4-bvanassche@acm.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/mq-deadline.c