[PATCH 2/7] sched/fair: Better document newidle_balance()
From: Peter Zijlstra
Date: Fri Nov 08 2019 - 08:21:43 EST
Whilst chasing the pick_next_task() race, there was some confusion
about the newidle_balance() return values. Document them.
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
---
kernel/sched/fair.c | 5 +++++
1 file changed, 5 insertions(+)
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -9920,6 +9920,11 @@ static inline void nohz_newidle_balance(
/*
* idle_balance is called by schedule() if this_cpu is about to become
* idle. Attempts to pull tasks from other CPUs.
+ *
+ * Returns:
+ * <0 - we released the lock and there are !fair tasks present
+ * 0 - failed, no new tasks
+ * >0 - success, new (fair) tasks present
*/
int newidle_balance(struct rq *this_rq, struct rq_flags *rf)
{