linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.19 09/11] block: reduce kblockd_mod_delayed_work_on() CPU consumption
       [not found] <20211221020030.117225-1-sashal@kernel.org>
@ 2021-12-21  2:00 ` Sasha Levin
  2021-12-21  2:00 ` [PATCH AUTOSEL 4.19 11/11] Revert "block: reduce kblockd_mod_delayed_work_on() CPU consumption" Sasha Levin
  1 sibling, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2021-12-21  2:00 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Jens Axboe, Dexuan Cui, Ming Lei, Sasha Levin, linux-block

From: Jens Axboe <axboe@kernel.dk>

[ Upstream commit cb2ac2912a9ca7d3d26291c511939a41361d2d83 ]

Dexuan reports that he's seeing spikes of very heavy CPU utilization when
running 24 disks and using the 'none' scheduler. This happens off the
sched restart path, because SCSI requires the queue to be restarted async,
and hence we're hammering on mod_delayed_work_on() to ensure that the work
item gets run appropriately.

Avoid hammering on the timer and just use queue_work_on() if no delay
has been specified.

Reported-and-tested-by: Dexuan Cui <decui@microsoft.com>
Link: https://lore.kernel.org/linux-block/BYAPR21MB1270C598ED214C0490F47400BF719@BYAPR21MB1270.namprd21.prod.outlook.com/
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 block/blk-core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/block/blk-core.c b/block/blk-core.c
index 80f3e729fdd4d..8529cc3f213b9 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -3581,6 +3581,8 @@ EXPORT_SYMBOL(kblockd_schedule_work_on);
 int kblockd_mod_delayed_work_on(int cpu, struct delayed_work *dwork,
 				unsigned long delay)
 {
+	if (!delay)
+		return queue_work_on(cpu, kblockd_workqueue, &dwork->work);
 	return mod_delayed_work_on(cpu, kblockd_workqueue, dwork, delay);
 }
 EXPORT_SYMBOL(kblockd_mod_delayed_work_on);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH AUTOSEL 4.19 11/11] Revert "block: reduce kblockd_mod_delayed_work_on() CPU consumption"
       [not found] <20211221020030.117225-1-sashal@kernel.org>
  2021-12-21  2:00 ` [PATCH AUTOSEL 4.19 09/11] block: reduce kblockd_mod_delayed_work_on() CPU consumption Sasha Levin
@ 2021-12-21  2:00 ` Sasha Levin
  1 sibling, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2021-12-21  2:00 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Jens Axboe, Alex Xu, kernel test robot, Sasha Levin, linux-block

From: Jens Axboe <axboe@kernel.dk>

[ Upstream commit 87959fa16cfbcf76245c11559db1940069621274 ]

This reverts commit cb2ac2912a9ca7d3d26291c511939a41361d2d83.

Alex and the kernel test robot report that this causes a significant
performance regression with BFQ. I can reproduce that result, so let's
revert this one as we're close to -rc6 and we there's no point in trying
to rush a fix.

Link: https://lore.kernel.org/linux-block/1639853092.524jxfaem2.none@localhost/
Link: https://lore.kernel.org/lkml/20211219141852.GH14057@xsang-OptiPlex-9020/
Reported-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
Reported-by: kernel test robot <oliver.sang@intel.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 block/blk-core.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index 8529cc3f213b9..80f3e729fdd4d 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -3581,8 +3581,6 @@ EXPORT_SYMBOL(kblockd_schedule_work_on);
 int kblockd_mod_delayed_work_on(int cpu, struct delayed_work *dwork,
 				unsigned long delay)
 {
-	if (!delay)
-		return queue_work_on(cpu, kblockd_workqueue, &dwork->work);
 	return mod_delayed_work_on(cpu, kblockd_workqueue, dwork, delay);
 }
 EXPORT_SYMBOL(kblockd_mod_delayed_work_on);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-21  2:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20211221020030.117225-1-sashal@kernel.org>
2021-12-21  2:00 ` [PATCH AUTOSEL 4.19 09/11] block: reduce kblockd_mod_delayed_work_on() CPU consumption Sasha Levin
2021-12-21  2:00 ` [PATCH AUTOSEL 4.19 11/11] Revert "block: reduce kblockd_mod_delayed_work_on() CPU consumption" Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).