lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-f05998d4b80632f2cc00f108da503066ef5d38d5@git.kernel.org>
Date:	Fri, 20 May 2011 13:43:00 GMT
From:	tip-bot for Nikhil Rao <ncrao@...gle.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, vatsa@...ux.vnet.ibm.com,
	hpa@...or.com, mingo@...hat.com, ncrao@...gle.com, efault@....de,
	peterz@...radead.org, nikunj@...ux.vnet.ibm.com,
	stephan.baerwolf@...ilmenau.de, tglx@...utronix.de, mingo@...e.hu
Subject: [tip:sched/core] sched: Cleanup set_load_weight()

Commit-ID:  f05998d4b80632f2cc00f108da503066ef5d38d5
Gitweb:     http://git.kernel.org/tip/f05998d4b80632f2cc00f108da503066ef5d38d5
Author:     Nikhil Rao <ncrao@...gle.com>
AuthorDate: Wed, 18 May 2011 10:09:38 -0700
Committer:  Ingo Molnar <mingo@...e.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@...gle.com>
Acked-by: Peter Zijlstra <peterz@...radead.org>
Cc: Nikunj A. Dadhania <nikunj@...ux.vnet.ibm.com>
Cc: Srivatsa Vaddagiri <vatsa@...ux.vnet.ibm.com>
Cc: Stephan Barwolf <stephan.baerwolf@...ilmenau.de>
Cc: Mike Galbraith <efault@....de>
Link: http://lkml.kernel.org/r/1305738580-9924-2-git-send-email-ncrao@google.com
Signed-off-by: Ingo Molnar <mingo@...e.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)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ