Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit acb7aa0d authored by Arjan van de Ven's avatar Arjan van de Ven Committed by Matthew Wilcox
Browse files

NVMe: Use round_jiffies_relative() for the periodic, once-per-second 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: default avatarArjan van de Ven <arjan@linux.intel.com>
Tested-by: default avatarKeith Busch <keith.busch@intel.com>
Signed-off-by: default avatarMatthew Wilcox <matthew.r.wilcox@intel.com>
parent 5d0f6131
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1309,7 +1309,7 @@ static int nvme_kthread(void *data)
		}
		}
		spin_unlock(&dev_list_lock);
		spin_unlock(&dev_list_lock);
		set_current_state(TASK_INTERRUPTIBLE);
		set_current_state(TASK_INTERRUPTIBLE);
		schedule_timeout(HZ);
		schedule_timeout(round_jiffies_relative(HZ));
	}
	}
	return 0;
	return 0;
}
}