Skip to content

Commit cb2ac29

Browse files
committed
block: reduce kblockd_mod_delayed_work_on() CPU consumption
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 <[email protected]> Link: https://lore.kernel.org/linux-block/BYAPR21MB1270C598ED214C0490F47400BF719@BYAPR21MB1270.namprd21.prod.outlook.com/ Reviewed-by: Ming Lei <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent edaa263 commit cb2ac29

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

block/blk-core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,6 +1484,8 @@ EXPORT_SYMBOL(kblockd_schedule_work);
14841484
int kblockd_mod_delayed_work_on(int cpu, struct delayed_work *dwork,
14851485
unsigned long delay)
14861486
{
1487+
if (!delay)
1488+
return queue_work_on(cpu, kblockd_workqueue, &dwork->work);
14871489
return mod_delayed_work_on(cpu, kblockd_workqueue, dwork, delay);
14881490
}
14891491
EXPORT_SYMBOL(kblockd_mod_delayed_work_on);

0 commit comments

Comments
 (0)