From: tip-bot for Nikhil Rao <ncrao@google.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, vatsa@linux.vnet.ibm.com,
hpa@zytor.com, mingo@redhat.com, ncrao@google.com, efault@gmx.de,
peterz@infradead.org, nikunj@linux.vnet.ibm.com,
stephan.baerwolf@tu-ilmenau.de, tglx@linutronix.de,
mingo@elte.hu
Subject: [tip:sched/core] sched: Cleanup set_load_weight()
Date: Fri, 20 May 2011 13:43:00 GMT [thread overview]
Message-ID: <tip-f05998d4b80632f2cc00f108da503066ef5d38d5@git.kernel.org> (raw)
In-Reply-To: <1305738580-9924-2-git-send-email-ncrao@google.com>
Commit-ID: f05998d4b80632f2cc00f108da503066ef5d38d5
Gitweb: http://git.kernel.org/tip/f05998d4b80632f2cc00f108da503066ef5d38d5
Author: Nikhil Rao <ncrao@google.com>
AuthorDate: Wed, 18 May 2011 10:09:38 -0700
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 20 May 2011 14:16:49 +0200
sched: Cleanup set_load_weight()
Avoid using long repetitious names; make this simpler and nicer
to read. No functional change introduced in this patch.
Signed-off-by: Nikhil Rao <ncrao@google.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Nikunj A. Dadhania <nikunj@linux.vnet.ibm.com>
Cc: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
Cc: Stephan Barwolf <stephan.baerwolf@tu-ilmenau.de>
Cc: Mike Galbraith <efault@gmx.de>
Link: http://lkml.kernel.org/r/1305738580-9924-2-git-send-email-ncrao@google.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
kernel/sched.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
index c62acf4..d036048 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1778,17 +1778,20 @@ static void dec_nr_running(struct rq *rq)
static void set_load_weight(struct task_struct *p)
{
+ int prio = p->static_prio - MAX_RT_PRIO;
+ struct load_weight *load = &p->se.load;
+
/*
* SCHED_IDLE tasks get minimal weight:
*/
if (p->policy == SCHED_IDLE) {
- p->se.load.weight = WEIGHT_IDLEPRIO;
- p->se.load.inv_weight = WMULT_IDLEPRIO;
+ load->weight = WEIGHT_IDLEPRIO;
+ load->inv_weight = WMULT_IDLEPRIO;
return;
}
- p->se.load.weight = prio_to_weight[p->static_prio - MAX_RT_PRIO];
- p->se.load.inv_weight = prio_to_wmult[p->static_prio - MAX_RT_PRIO];
+ load->weight = prio_to_weight[prio];
+ load->inv_weight = prio_to_wmult[prio];
}
static void enqueue_task(struct rq *rq, struct task_struct *p, int flags)
next prev parent reply other threads:[~2011-05-20 13:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-18 17:09 [PATCH v2 0/3] Increase resolution of load weights Nikhil Rao
2011-05-18 17:09 ` [PATCH v2 1/3] sched: cleanup set_load_weight() Nikhil Rao
2011-05-20 13:43 ` tip-bot for Nikhil Rao [this message]
2011-05-18 17:09 ` [PATCH v2 2/3] sched: introduce SCHED_POWER_SCALE to scale cpu_power calculations Nikhil Rao
2011-05-20 13:43 ` [tip:sched/core] sched: Introduce " tip-bot for Nikhil Rao
2011-05-18 17:09 ` [PATCH v2 3/3] sched: increase SCHED_LOAD_SCALE resolution Nikhil Rao
2011-05-18 18:25 ` Ingo Molnar
2011-05-18 19:39 ` Nikhil Rao
2011-05-18 19:41 ` Nikhil Rao
2011-05-18 20:26 ` Ingo Molnar
2011-05-18 21:18 ` Nikhil Rao
2011-05-18 21:22 ` Ingo Molnar
2011-05-18 21:37 ` [PATCH v3 " Nikhil Rao
2011-05-20 13:43 ` [tip:sched/core] sched: Increase " tip-bot for Nikhil Rao
2011-05-18 18:26 ` [PATCH v2 3/3] sched: increase " Ingo Molnar
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=tip-f05998d4b80632f2cc00f108da503066ef5d38d5@git.kernel.org \
--to=ncrao@google.com \
--cc=efault@gmx.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=nikunj@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=stephan.baerwolf@tu-ilmenau.de \
--cc=tglx@linutronix.de \
--cc=vatsa@linux.vnet.ibm.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
Powered by JetHome