Skip to contentSkip to conversation

sched: Fix use of count for nr_running tracepoint

PATCH Applied Phil Auld 2 participants 2 messages Aug 5, 2020 – Aug 6, 2020 Scheduler

lore
Share & tools
lore

Phil Auld

author
#0 lore raw

PATCH 1/1 sched: Fix use of count for nr_running tracepoint

The count field is meant to tell if an update to nr_running is an add or a subtract. Make it do so by adding the missing minus sign.

Fixes 9d246053a691 ("sched: Add a tracepoint to track rq->nr_running")
---
 kernel/sched/sched.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/sched.h +1 -1
index 3fd283892761..28709f6b0975 100644
@@ -1999,7 +1999,7 @@ static inline void sub_nr_running(struct rq *rq, unsigned count)
 {
 	rq->nr_running -= count;
 	if (trace_sched_update_nr_running_tp_enabled()) {
-		call_trace_sched_update_nr_running(rq, count);
+		call_trace_sched_update_nr_running(rq, -count);
 	}
 
 	/* Check if we still need preemption */
Signature · 1 line
2.26.2
merge bot Applied
#1 lore raw
The following commit has been merged into the sched/urgent branch of tip:

The following commit has been merged into the sched/urgent branch of tip:

Commit-ID:     a1bd06853ee478d37fae9435c5521e301de94c67
Gitweb:        https://git.kernel.org/tip/a1bd06853ee478d37fae9435c5521e301de94c67
Author:        Phil Auld <[email protected]>
AuthorDate:    Wed, 05 Aug 2020 16:31:38 -04:00
Committer:     Ingo Molnar <[email protected]>
CommitterDate: Thu, 06 Aug 2020 09:36:59 +02:00

sched: Fix use of count for nr_running tracepoint

The count field is meant to tell if an update to nr_running is an add or a subtract. Make it do so by adding the missing minus sign.

Fixes 9d246053a691 ("sched: Add a tracepoint to track rq->nr_running")
---
 kernel/sched/sched.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/sched.h +1 -1
index 3fd2838..28709f6 100644
@@ -1999,7 +1999,7 @@ static inline void sub_nr_running(struct rq *rq, unsigned count)
 {
 	rq->nr_running -= count;
 	if (trace_sched_update_nr_running_tp_enabled()) {
-		call_trace_sched_update_nr_running(rq, count);
+		call_trace_sched_update_nr_running(rq, -count);
 	}
 
 	/* Check if we still need preemption */