Skip to content

Commit

Permalink
NVMe: Use round_jiffies_relative() for the periodic, once-per-second …
Browse files Browse the repository at this point in the history
…timer

The nvme driver has a "once per second" event where the management kthread
wakes up the system and then reschedules itself for 1 second later.
For power efficiency reasons, I'd like this timer to happen together
with other wakeups in the system.

This patch makes the schedule_timeout() call in the kthread use
round_jiffies_relative(), causing the wakeup to at least align with other
"once per X seconds" events in the kernel.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Tested-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
  • Loading branch information
Arjan van de Ven authored and Matthew Wilcox committed Apr 16, 2013
1 parent 5d0f613 commit acb7aa0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/block/nvme-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,7 @@ static int nvme_kthread(void *data)
}
spin_unlock(&dev_list_lock);
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(HZ);
schedule_timeout(round_jiffies_relative(HZ));
}
return 0;
}
Expand Down

0 comments on commit acb7aa0

Please sign in to comment.