linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lei Wen <leiwen@marvell.com>
To: Paul Turner <pjt@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@elte.hu>, <mingo@redhat.com>,
	<leiwen@marvell.com>, <linux-kernel@vger.kernel.org>
Subject: [PATCH 2/8] sched: change cpu_avg_load_per_task using h_nr_running
Date: Sun, 18 Aug 2013 16:25:16 +0800	[thread overview]
Message-ID: <1376814322-7320-3-git-send-email-leiwen@marvell.com> (raw)
In-Reply-To: <1376814322-7320-1-git-send-email-leiwen@marvell.com>

Since cpu_avg_load_per_task is used only by cfs scheduler, its meaning
should present the average cfs type task load in the current run queue.
Thus we change it to h_nr_running for well presenting its meaning.

Signed-off-by: Lei Wen <leiwen@marvell.com>
---
 kernel/sched/fair.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index d6153c8..e6b99b4 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3008,7 +3008,7 @@ static unsigned long power_of(int cpu)
 static unsigned long cpu_avg_load_per_task(int cpu)
 {
 	struct rq *rq = cpu_rq(cpu);
-	unsigned long nr_running = ACCESS_ONCE(rq->nr_running);
+	unsigned long nr_running = ACCESS_ONCE(rq->cfs.h_nr_running);
 	unsigned long load_avg = rq->cfs.runnable_load_avg;
 
 	if (nr_running)
-- 
1.7.5.4


  parent reply	other threads:[~2013-08-18  8:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-18  8:25 [PATCH 0/8] sched: fixes for the nr_running usage Lei Wen
2013-08-18  8:25 ` [PATCH 1/8] sched: change load balance number to h_nr_running of run queue Lei Wen
2013-08-18  8:25 ` Lei Wen [this message]
2013-08-18  8:25 ` [PATCH 3/8] sched: change update_rq_runnable_avg using h_nr_running Lei Wen
2013-08-18  8:25 ` [PATCH 4/8] sched: change pick_next_task_fair to h_nr_running Lei Wen
2013-08-18  8:25 ` [PATCH 5/8] sched: change update_sg_lb_stats " Lei Wen
2013-08-18  8:25 ` [PATCH 6/8] sched: change find_busiest_queue " Lei Wen
2013-08-18  8:25 ` [PATCH 7/8] sched: change active_load_balance_cpu_stop to use h_nr_running Lei Wen
2013-08-18  8:25 ` [PATCH 8/8] sched: document the difference between nr_running and h_nr_running Lei Wen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1376814322-7320-3-git-send-email-leiwen@marvell.com \
    --to=leiwen@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).