Add MAX_NICE, MIN_NICE and NICE_WIDTH macros in prio.h.
cover Add MAX_NICE, MIN_NICE and NICE_WIDTH macros in prio.h.
Hi Peter,
There are lots of hardcoding of -20 and 19 in kernel to represent
minimum and maximum of nice value currently. This patch set define three macros in prio.h and replace some of the hardcoding with them.
Please help to take a look at it, thanx :)
Dongsheng Yang (9):
sched: Prio: Use DEFAULT_PRIO to define NICE_TO_PRIO and PRIO_TO_NICE.
sched: prio: Add 3 macros of MAX_NICE, MIN_NICE and NICE_WIDTH in
prio.h.
sched: prio: Use NICE_WIDTH macro to avoid using of hard coding of 40
and 20 in prio.h.
sched: prio: Add spaces before and after operator of '-'.
rcu: Use MAX_NICE to replace hard coding of 19.
sched: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE.
sys: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE.
workqueue: Replace hardcoding of -20 and 19 with MIN_NICE and
MAX_NICE.
trace: Replace hardcoding of 19 with MAX_NICE.
include/linux/sched/prio.h | 14 +++++++++----- kernel/rcu/torture.c | 8 ++++---- kernel/sched/auto_group.c | 2 +- kernel/sched/core.c | 12 ++++++------ kernel/sys.c | 8 ++++---- kernel/trace/ring_buffer_benchmark.c | 6 +++--- kernel/workqueue.c | 2 +- 7 files changed, 28 insertions(+), 24 deletions(-)
Signature · 1 line
1.8.2.1
PATCH 1/9 sched: Prio: Use DEFAULT_PRIO to define NICE_TO_PRIO and PRIO_TO_NICE.
There is already a macro named DEFAULT_PRIO in prio.h, we can use it to define NICE_TO_PRIO and PRIO_TO_NICE rather than use hard coding of (MAX_RT_PRIO + 20).
--- include/linux/sched/prio.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/sched/prio.h +2 -2
@@ -25,8 +25,8 @@* to static priority [ MAX_RT_PRIO..MAX_PRIO-1 ], * and back. */ -#define NICE_TO_PRIO (nice) (MAX_RT_PRIO + (nice) + 20) -#define PRIO_TO_NICE (prio) ((prio) - MAX_RT_PRIO - 20) +#define NICE_TO_PRIO (nice) ((nice) + DEFAULT_PRIO) +#define PRIO_TO_NICE (prio) ((prio) - DEFAULT_PRIO)/* * 'User priority' is the nice value converted to something we
Signature · 1 line
1.8.2.1
tip-bot for Dongsheng Yang
merge bot[tip:sched/core] sched: Prio: Use DEFAULT_PRIO to define NICE_TO_PRIO and PRIO_TO_NICE.
sched: Prio: Use DEFAULT_PRIO to define NICE_TO_PRIO and PRIO_TO_NICE.
Commit-ID: 103fc73128e3c55773d7f60998f9296c256df3a5 Gitweb: http://git.kernel.org/tip/103fc73128e3c55773d7f60998f9296c256df3a5 Author: Dongsheng Yang <[email protected]> AuthorDate: Tue, 11 Feb 2014 15:34:45 +0800 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 21 Feb 2014 21:43:20 +0100
sched: Prio: Use DEFAULT_PRIO to define NICE_TO_PRIO and PRIO_TO_NICE.
There is already a macro named DEFAULT_PRIO in prio.h, we can use it to define NICE_TO_PRIO and PRIO_TO_NICE rather than use hard coding of (MAX_RT_PRIO + 20).
--- include/linux/sched/prio.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/sched/prio.h +2 -2
@@ -25,8 +25,8 @@* to static priority [ MAX_RT_PRIO..MAX_PRIO-1 ], * and back. */ -#define NICE_TO_PRIO (nice) (MAX_RT_PRIO + (nice) + 20) -#define PRIO_TO_NICE (prio) ((prio) - MAX_RT_PRIO - 20) +#define NICE_TO_PRIO (nice) ((nice) + DEFAULT_PRIO) +#define PRIO_TO_NICE (prio) ((prio) - DEFAULT_PRIO)/* * 'User priority' is the nice value converted to something we
tip-bot for Dongsheng Yang
merge bot[tip:sched/core] sched/prio: Use DEFAULT_PRIO to define NICE_TO_PRIO() and PRIO_TO_NICE()
In reply to Dongsheng Yangsched/prio: Use DEFAULT_PRIO to define NICE_TO_PRIO() and PRIO_TO_NICE()
Commit-ID: 7e298d60f717257dc8365c975f45ff9c37165362 Gitweb: http://git.kernel.org/tip/7e298d60f717257dc8365c975f45ff9c37165362 Author: Dongsheng Yang <[email protected]> AuthorDate: Tue, 11 Feb 2014 15:34:45 +0800 Committer: Ingo Molnar <[email protected]> CommitDate: Sat, 22 Feb 2014 18:11:29 +0100
sched/prio: Use DEFAULT_PRIO to define NICE_TO_PRIO() and PRIO_TO_NICE()
There is already a macro named DEFAULT_PRIO in prio.h, we can use it to define NICE_TO_PRIO and PRIO_TO_NICE rather than use hard coding of (MAX_RT_PRIO + 20).
--- include/linux/sched/prio.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/sched/prio.h +2 -2
@@ -25,8 +25,8 @@* to static priority [ MAX_RT_PRIO..MAX_PRIO-1 ], * and back. */ -#define NICE_TO_PRIO (nice) (MAX_RT_PRIO + (nice) + 20) -#define PRIO_TO_NICE (prio) ((prio) - MAX_RT_PRIO - 20) +#define NICE_TO_PRIO (nice) ((nice) + DEFAULT_PRIO) +#define PRIO_TO_NICE (prio) ((prio) - DEFAULT_PRIO)/* * 'User priority' is the nice value converted to something we
PATCH 2/9 sched: prio: Add 3 macros of MAX_NICE, MIN_NICE and NICE_WIDTH in prio.h.
In reply to Dongsheng YangCurrently, there are lots of hard coding of 19 and -20 to represent maximum and minimum of nice value.
This patch add three macros in prio.h for maximum, minimum and width of nice value.
--- include/linux/sched/prio.h | 4 ++++ 1 file changed, 4 insertions(+)
include/linux/sched/prio.h +4 -0
@@ -1,6 +1,10 @@#ifndef _SCHED_PRIO_H#define _SCHED_PRIO_H +#define MAX_NICE 19 +#define MIN_NICE -20 +#define NICE_WIDTH (MAX_NICE - MIN_NICE + 1) +/* * Priority of a process goes from 0..MAX_PRIO-1, valid RT * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH
Signature · 1 line
1.8.2.1
tip-bot for Dongsheng Yang
merge bot[tip:sched/core] sched: prio: Add 3 macros of MAX_NICE, MIN_NICE and NICE_WIDTH in prio.h.
sched: prio: Add 3 macros of MAX_NICE, MIN_NICE and NICE_WIDTH in prio.h.
Commit-ID: 798fa741dd4e5a2d15e862367000a0ac63253978 Gitweb: http://git.kernel.org/tip/798fa741dd4e5a2d15e862367000a0ac63253978 Author: Dongsheng Yang <[email protected]> AuthorDate: Tue, 11 Feb 2014 15:34:46 +0800 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 21 Feb 2014 21:43:20 +0100
sched: prio: Add 3 macros of MAX_NICE, MIN_NICE and NICE_WIDTH in prio.h.
Currently, there are lots of hard coding of 19 and -20 to represent maximum and minimum of nice value.
This patch add three macros in prio.h for maximum, minimum and width of nice value.
--- include/linux/sched/prio.h | 4 ++++ 1 file changed, 4 insertions(+)
include/linux/sched/prio.h +4 -0
@@ -1,6 +1,10 @@#ifndef _SCHED_PRIO_H#define _SCHED_PRIO_H +#define MAX_NICE 19 +#define MIN_NICE -20 +#define NICE_WIDTH (MAX_NICE - MIN_NICE + 1) +/* * Priority of a process goes from 0..MAX_PRIO-1, valid RT * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH
tip-bot for Dongsheng Yang
merge bot[tip:sched/core] sched/prio: Add 3 macros of MAX_NICE, MIN_NICE and NICE_WIDTH in prio.h
In reply to Dongsheng Yangsched/prio: Add 3 macros of MAX_NICE, MIN_NICE and NICE_WIDTH in prio.h
Commit-ID: 3ee237dddcd885d4e525791299d62de33b2ca117 Gitweb: http://git.kernel.org/tip/3ee237dddcd885d4e525791299d62de33b2ca117 Author: Dongsheng Yang <[email protected]> AuthorDate: Tue, 11 Feb 2014 15:34:46 +0800 Committer: Ingo Molnar <[email protected]> CommitDate: Sat, 22 Feb 2014 18:14:13 +0100
sched/prio: Add 3 macros of MAX_NICE, MIN_NICE and NICE_WIDTH in prio.h
Currently there is lots of hard coding to 19 and -20, to represent maximum and minimum of nice values.
This patch add three macros in prio.h for maximum, minimum and width of nice value, and uses it to remove hardcoded values in prio.h.
--- include/linux/sched/prio.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
include/linux/sched/prio.h +6 -2
@@ -1,6 +1,10 @@#ifndef _SCHED_PRIO_H#define _SCHED_PRIO_H +#define MAX_NICE 19 +#define MIN_NICE -20 +#define NICE_WIDTH (MAX_NICE - MIN_NICE + 1) +/* * Priority of a process goes from 0..MAX_PRIO-1, valid RT * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH
@@ -17,8 +21,8 @@#define MAX_USER_RT_PRIO 100#define MAX_RT_PRIO MAX_USER_RT_PRIO -#define MAX_PRIO (MAX_RT_PRIO + 40) -#define DEFAULT_PRIO (MAX_RT_PRIO + 20) +#define MAX_PRIO (MAX_RT_PRIO + NICE_WIDTH) +#define DEFAULT_PRIO (MAX_RT_PRIO + NICE_WIDTH / 2)/* * Convert user-nice values [ -20 ... 0 ... 19 ]
PATCH 3/9 sched: prio: Use NICE_WIDTH macro to avoid using of hard coding of 40 and 20 in prio.h.
In reply to Dongsheng Yang--- include/linux/sched/prio.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/sched/prio.h +2 -2
@@ -21,8 +21,8 @@#define MAX_USER_RT_PRIO 100#define MAX_RT_PRIO MAX_USER_RT_PRIO -#define MAX_PRIO (MAX_RT_PRIO + 40) -#define DEFAULT_PRIO (MAX_RT_PRIO + 20) +#define MAX_PRIO (MAX_RT_PRIO + NICE_WIDTH) +#define DEFAULT_PRIO (MAX_RT_PRIO + NICE_WIDTH / 2)/* * Convert user-nice values [ -20 ... 0 ... 19 ]
Signature · 1 line
1.8.2.1
tip-bot for Dongsheng Yang
merge bot[tip:sched/core] sched: prio: Use NICE_WIDTH macro to avoid using of hard coding of 40 and 20 in prio.h.
sched: prio: Use NICE_WIDTH macro to avoid using of hard coding of 40 and 20 in prio.h.
Commit-ID: eb2ae7dad9dad350b4444962465d7e09bcfc128a Gitweb: http://git.kernel.org/tip/eb2ae7dad9dad350b4444962465d7e09bcfc128a Author: Dongsheng Yang <[email protected]> AuthorDate: Tue, 11 Feb 2014 15:34:47 +0800 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 21 Feb 2014 21:43:20 +0100
sched: prio: Use NICE_WIDTH macro to avoid using of hard coding of 40 and 20 in prio.h.
--- include/linux/sched/prio.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/sched/prio.h +2 -2
@@ -21,8 +21,8 @@#define MAX_USER_RT_PRIO 100#define MAX_RT_PRIO MAX_USER_RT_PRIO -#define MAX_PRIO (MAX_RT_PRIO + 40) -#define DEFAULT_PRIO (MAX_RT_PRIO + 20) +#define MAX_PRIO (MAX_RT_PRIO + NICE_WIDTH) +#define DEFAULT_PRIO (MAX_RT_PRIO + NICE_WIDTH / 2)/* * Convert user-nice values [ -20 ... 0 ... 19 ]
PATCH 4/9 sched: prio: Add spaces before and after operator of '-'.
In reply to Dongsheng Yang--- include/linux/sched/prio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/sched/prio.h +1 -1
@@ -37,7 +37,7 @@* can work with better when scaling various scheduler parameters, * it's a [ 0 ... 39 ] range. */ -#define USER_PRIO (p) ((p)-MAX_RT_PRIO) +#define USER_PRIO (p) ((p) - MAX_RT_PRIO)#define TASK_USER_PRIO (p) USER_PRIO((p)->static_prio)#define MAX_USER_PRIO (USER_PRIO(MAX_PRIO))
Signature · 1 line
1.8.2.1
tip-bot for Dongsheng Yang
merge bot[tip:sched/core] sched: prio: Add spaces before and after operator of '-'.
sched: prio: Add spaces before and after operator of '-'.
Commit-ID: 02228c930672ec5476cf8ef84e4f3f45ab01b597 Gitweb: http://git.kernel.org/tip/02228c930672ec5476cf8ef84e4f3f45ab01b597 Author: Dongsheng Yang <[email protected]> AuthorDate: Tue, 11 Feb 2014 15:34:48 +0800 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 21 Feb 2014 21:43:20 +0100
sched: prio: Add spaces before and after operator of '-'.
--- include/linux/sched/prio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/sched/prio.h +1 -1
@@ -37,7 +37,7 @@* can work with better when scaling various scheduler parameters, * it's a [ 0 ... 39 ] range. */ -#define USER_PRIO (p) ((p)-MAX_RT_PRIO) +#define USER_PRIO (p) ((p) - MAX_RT_PRIO)#define TASK_USER_PRIO (p) USER_PRIO((p)->static_prio)#define MAX_USER_PRIO (USER_PRIO(MAX_PRIO))
PATCH 5/9 rcu: Use MAX_NICE to replace hard coding of 19.
In reply to Dongsheng Yang--- kernel/rcu/torture.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/rcu/torture.c +4 -4
@@ -805,7 +805,7 @@ rcu_torture_writer(void *arg)static DEFINE_RCU_RANDOM (rand);VERBOSE_PRINTK_STRING ("rcu_torture_writer task started" ); -set_user_nice (current,19 ); +set_user_nice (current,MAX_NICE ); do { schedule_timeout_uninterruptible(1);
@@ -871,7 +871,7 @@ rcu_torture_fakewriter(void *arg)DEFINE_RCU_RANDOM (rand);VERBOSE_PRINTK_STRING ("rcu_torture_fakewriter task started" ); -set_user_nice (current,19 ); +set_user_nice (current,MAX_NICE ); do { schedule_timeout_uninterruptible(1 + rcu_random(&rand)%10);
@@ -987,7 +987,7 @@ rcu_torture_reader(void *arg)unsigned long long ts;VERBOSE_PRINTK_STRING ("rcu_torture_reader task started" ); -set_user_nice (current,19 ); +set_user_nice (current,MAX_NICE );if (irqreader && cur_ops->irq_capable)setup_timer_on_stack (&t, rcu_torture_timer,0 );
@@ -1584,7 +1584,7 @@ static int rcu_torture_barrier_cbs(void *arg)init_rcu_head_on_stack (&rcu);VERBOSE_PRINTK_STRING ("rcu_torture_barrier_cbs task started" ); -set_user_nice (current,19 ); +set_user_nice (current,MAX_NICE ); do { wait_event(barrier_cbs_wq[myid], (newphase =
Signature · 1 line
1.8.2.1
Re: [PATCH 5/9] rcu: Use MAX_NICE to replace hard coding of 19.
Quoted 5 lines · Dongsheng Yang
Signed-off-by Dongsheng Yang <[email protected]>cc Josh Triplett <[email protected]>cc "Paul E. McKenney" <[email protected]>cc Peter Zijlstra <[email protected]>cc Ingo Molnar <[email protected]>
Quoted 46 lines
kernel/rcu/torture.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)kernel/rcu/torture.c +4
-4@@ -805,7 +805,7 @@ rcu_torture_writer(void *arg)static DEFINE_RCU_RANDOM (rand);VERBOSE_PRINTK_STRING ("rcu_torture_writer task started" ); -set_user_nice (current,19 ); +set_user_nice (current,MAX_NICE ); do { schedule_timeout_uninterruptible(1);@@ -871,7 +871,7 @@ rcu_torture_fakewriter(void *arg)DEFINE_RCU_RANDOM (rand);VERBOSE_PRINTK_STRING ("rcu_torture_fakewriter task started" ); -set_user_nice (current,19 ); +set_user_nice (current,MAX_NICE ); do { schedule_timeout_uninterruptible(1 + rcu_random(&rand)%10);@@ -987,7 +987,7 @@ rcu_torture_reader(void *arg)unsigned long long ts;VERBOSE_PRINTK_STRING ("rcu_torture_reader task started" ); -set_user_nice (current,19 ); +set_user_nice (current,MAX_NICE );if (irqreader && cur_ops->irq_capable)setup_timer_on_stack (&t, rcu_torture_timer,0 );@@ -1584,7 +1584,7 @@ static int rcu_torture_barrier_cbs(void *arg)init_rcu_head_on_stack (&rcu);VERBOSE_PRINTK_STRING ("rcu_torture_barrier_cbs task started" ); -set_user_nice (current,19 ); +set_user_nice (current,MAX_NICE ); do { wait_event(barrier_cbs_wq[myid], (newphase =Signature · 1 line
1.8.2.1
Re: [PATCH 5/9] rcu: Use MAX_NICE to replace hard coding of 19.
Quoted 8 lines · Josh Triplett
Quoted 5 lines · Dongsheng Yang
Signed-off-by Dongsheng Yang <[email protected]>cc Josh Triplett <[email protected]>cc "Paul E. McKenney" <[email protected]>cc Peter Zijlstra <[email protected]>cc Ingo Molnar <[email protected]>Reviewed-by Josh Triplett <[email protected]>
I get complaints about MAX_NICE being undefined, and I don't see any definition of MAX_NICE in sched.h as of 3.14-rc2. Am I looking in the wrong place, or is this symbol not yet quite in mainline?
Thanx, Paul
Quoted 47 lines
Quoted 46 lines
kernel/rcu/torture.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)kernel/rcu/torture.c +4
-4@@ -805,7 +805,7 @@ rcu_torture_writer(void *arg)static DEFINE_RCU_RANDOM (rand);VERBOSE_PRINTK_STRING ("rcu_torture_writer task started" ); -set_user_nice (current,19 ); +set_user_nice (current,MAX_NICE ); do { schedule_timeout_uninterruptible(1);@@ -871,7 +871,7 @@ rcu_torture_fakewriter(void *arg)DEFINE_RCU_RANDOM (rand);VERBOSE_PRINTK_STRING ("rcu_torture_fakewriter task started" ); -set_user_nice (current,19 ); +set_user_nice (current,MAX_NICE ); do { schedule_timeout_uninterruptible(1 + rcu_random(&rand)%10);@@ -987,7 +987,7 @@ rcu_torture_reader(void *arg)unsigned long long ts;VERBOSE_PRINTK_STRING ("rcu_torture_reader task started" ); -set_user_nice (current,19 ); +set_user_nice (current,MAX_NICE );if (irqreader && cur_ops->irq_capable)setup_timer_on_stack (&t, rcu_torture_timer,0 );@@ -1584,7 +1584,7 @@ static int rcu_torture_barrier_cbs(void *arg)init_rcu_head_on_stack (&rcu);VERBOSE_PRINTK_STRING ("rcu_torture_barrier_cbs task started" ); -set_user_nice (current,19 ); +set_user_nice (current,MAX_NICE ); do { wait_event(barrier_cbs_wq[myid], (newphase =Signature · 1 line
1.8.2.1
Peter Zijlstra
maintainerRe: [PATCH 5/9] rcu: Use MAX_NICE to replace hard coding of 19.
Quoted 8 lines · Paul E. McKenney
Quoted 7 lines · Josh Triplett
Quoted 5 lines · Dongsheng Yang
Signed-off-by Dongsheng Yang <[email protected]>cc Josh Triplett <[email protected]>cc "Paul E. McKenney" <[email protected]>cc Peter Zijlstra <[email protected]>cc Ingo Molnar <[email protected]>
Quoted 5 lines
Quoted 1 line
Reviewed-by Josh Triplett <[email protected]>I get complaints about
MAX_NICEbeing undefined, and I don't see any definition ofMAX_NICEinsched.has of 3.14-rc2. Am I looking in the wrong place, or is this symbol not yet quite in mainline?
It is not.. its a proposed thingy. I'm still trying to make up my mind on it.
Re: [PATCH 5/9] rcu: Use MAX_NICE to replace hard coding of 19.
Quoted 9 lines · Peter Zijlstra
Quoted 8 lines · Paul E. McKenney
Quoted 7 lines · Josh Triplett
Quoted 5 lines · Dongsheng Yang
Signed-off-by Dongsheng Yang <[email protected]>cc Josh Triplett <[email protected]>cc "Paul E. McKenney" <[email protected]>cc Peter Zijlstra <[email protected]>cc Ingo Molnar <[email protected]>
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Reviewed-by Josh Triplett <[email protected]>I get complaints about
MAX_NICEbeing undefined, and I don't see any definition ofMAX_NICEinsched.has of 3.14-rc2. Am I looking in the wrong place, or is this symbol not yet quite in mainline?It is not.. its a proposed thingy. I'm still trying to make up my mind on it.
OK, will hold off then.
Thanx, Paul
tip-bot for Dongsheng Yang
merge bot[tip:sched/core] rcu: Use MAX_NICE to replace hard coding of 19.
In reply to Dongsheng Yangrcu: Use MAX_NICE to replace hard coding of 19.
Commit-ID: c30f4ba1cb3f89cefba728f5289caf3c0fc7149d Gitweb: http://git.kernel.org/tip/c30f4ba1cb3f89cefba728f5289caf3c0fc7149d Author: Dongsheng Yang <[email protected]> AuthorDate: Tue, 11 Feb 2014 15:34:49 +0800 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 21 Feb 2014 21:43:20 +0100
rcu: Use MAX_NICE to replace hard coding of 19.
--- kernel/rcu/torture.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/rcu/torture.c +4 -4
@@ -805,7 +805,7 @@ rcu_torture_writer(void *arg)static DEFINE_RCU_RANDOM (rand);VERBOSE_PRINTK_STRING ("rcu_torture_writer task started" ); -set_user_nice (current,19 ); +set_user_nice (current,MAX_NICE ); do { schedule_timeout_uninterruptible(1);
@@ -871,7 +871,7 @@ rcu_torture_fakewriter(void *arg)DEFINE_RCU_RANDOM (rand);VERBOSE_PRINTK_STRING ("rcu_torture_fakewriter task started" ); -set_user_nice (current,19 ); +set_user_nice (current,MAX_NICE ); do { schedule_timeout_uninterruptible(1 + rcu_random(&rand)%10);
@@ -987,7 +987,7 @@ rcu_torture_reader(void *arg)unsigned long long ts;VERBOSE_PRINTK_STRING ("rcu_torture_reader task started" ); -set_user_nice (current,19 ); +set_user_nice (current,MAX_NICE );if (irqreader && cur_ops->irq_capable)setup_timer_on_stack (&t, rcu_torture_timer,0 );
@@ -1584,7 +1584,7 @@ static int rcu_torture_barrier_cbs(void *arg)init_rcu_head_on_stack (&rcu);VERBOSE_PRINTK_STRING ("rcu_torture_barrier_cbs task started" ); -set_user_nice (current,19 ); +set_user_nice (current,MAX_NICE ); do { wait_event(barrier_cbs_wq[myid], (newphase =
tip-bot for Dongsheng Yang
merge bot[tip:sched/core] rcu: Use MAX_NICE to replace hardcoding of 19
In reply to Dongsheng Yangrcu: Use MAX_NICE to replace hardcoding of 19
Commit-ID: d277d868dab6537a85f4757e39648b1d6afc60d5 Gitweb: http://git.kernel.org/tip/d277d868dab6537a85f4757e39648b1d6afc60d5 Author: Dongsheng Yang <[email protected]> AuthorDate: Tue, 11 Feb 2014 15:34:49 +0800 Committer: Ingo Molnar <[email protected]> CommitDate: Sat, 22 Feb 2014 18:15:24 +0100
rcu: Use MAX_NICE to replace hardcoding of 19
--- kernel/rcu/torture.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/rcu/torture.c +4 -4
@@ -805,7 +805,7 @@ rcu_torture_writer(void *arg)static DEFINE_RCU_RANDOM (rand);VERBOSE_PRINTK_STRING ("rcu_torture_writer task started" ); -set_user_nice (current,19 ); +set_user_nice (current,MAX_NICE ); do { schedule_timeout_uninterruptible(1);
@@ -871,7 +871,7 @@ rcu_torture_fakewriter(void *arg)DEFINE_RCU_RANDOM (rand);VERBOSE_PRINTK_STRING ("rcu_torture_fakewriter task started" ); -set_user_nice (current,19 ); +set_user_nice (current,MAX_NICE ); do { schedule_timeout_uninterruptible(1 + rcu_random(&rand)%10);
@@ -987,7 +987,7 @@ rcu_torture_reader(void *arg)unsigned long long ts;VERBOSE_PRINTK_STRING ("rcu_torture_reader task started" ); -set_user_nice (current,19 ); +set_user_nice (current,MAX_NICE );if (irqreader && cur_ops->irq_capable)setup_timer_on_stack (&t, rcu_torture_timer,0 );
@@ -1584,7 +1584,7 @@ static int rcu_torture_barrier_cbs(void *arg)init_rcu_head_on_stack (&rcu);VERBOSE_PRINTK_STRING ("rcu_torture_barrier_cbs task started" ); -set_user_nice (current,19 ); +set_user_nice (current,MAX_NICE ); do { wait_event(barrier_cbs_wq[myid], (newphase =
PATCH 6/9 sched: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE.
In reply to Dongsheng Yang--- kernel/sched/auto_group.c | 2 +- kernel/sched/core.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-)
kernel/sched/auto_group.c +1 -1
@@ -203,7 +203,7 @@ int proc_sched_autogroup_set_nice(struct task_struct *p, int nice)struct autogroup *ag;int err; -if (nice <-20 || nice >19 ) +if (nice <MIN_NICE || nice >MAX_NICE )return -EINVAL ; err =security_task_setnice (current, nice);
kernel/sched/core.c +6 -6
@@ -3000,7 +3000,7 @@ void set_user_nice(struct task_struct *p, long nice)unsigned long flags;struct rq *rq; -if (task_nice (p) == nice || nice <-20 || nice >19 ) +if (task_nice (p) == nice || nice <MIN_NICE || nice >MAX_NICE )return ;/* * We have to be careful, if called from sys_setpriority(),
@@ -3079,10 +3079,10 @@ SYSCALL_DEFINE1(nice, int, increment) increment =40 ; nice =task_nice (current) + increment; -if (nice <-20 ) - nice =-20 ; -if (nice >19 ) - nice =19 ; +if (nice <MIN_NICE ) + nice =MIN_NICE ; +if (nice >MAX_NICE ) + nice =MAX_NICE ;if (increment <0 && !can_nice (current, nice))return -EPERM ;
@@ -3605,7 +3605,7 @@ static int sched_copy_attr(struct sched_attr __user *uattr,* XXX: do we want to be lenient like existing syscalls; or do we want * to be strict and return an error on out-of-bounds values? */ - attr->sched_nice =clamp (attr->sched_nice,-20 ,19 ); + attr->sched_nice =clamp (attr->sched_nice,MIN_NICE ,MAX_NICE ); out:return ret;
Signature · 1 line
1.8.2.1
tip-bot for Dongsheng Yang
merge bot[tip:sched/core] sched: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE.
sched: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE.
Commit-ID: 82abc86e6bcd0ab6b2efad1d8201abb463422034 Gitweb: http://git.kernel.org/tip/82abc86e6bcd0ab6b2efad1d8201abb463422034 Author: Dongsheng Yang <[email protected]> AuthorDate: Tue, 11 Feb 2014 15:34:50 +0800 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 21 Feb 2014 21:43:20 +0100
sched: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE.
--- kernel/sched/auto_group.c | 2 +- kernel/sched/core.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-)
kernel/sched/auto_group.c +1 -1
@@ -203,7 +203,7 @@ int proc_sched_autogroup_set_nice(struct task_struct *p, int nice)struct autogroup *ag;int err; -if (nice <-20 || nice >19 ) +if (nice <MIN_NICE || nice >MAX_NICE )return -EINVAL ; err =security_task_setnice (current, nice);
kernel/sched/core.c +6 -6
@@ -3001,7 +3001,7 @@ void set_user_nice(struct task_struct *p, long nice)unsigned long flags;struct rq *rq; -if (task_nice (p) == nice || nice <-20 || nice >19 ) +if (task_nice (p) == nice || nice <MIN_NICE || nice >MAX_NICE )return ;/* * We have to be careful, if called from sys_setpriority(),
@@ -3080,10 +3080,10 @@ SYSCALL_DEFINE1(nice, int, increment) increment =40 ; nice =task_nice (current) + increment; -if (nice <-20 ) - nice =-20 ; -if (nice >19 ) - nice =19 ; +if (nice <MIN_NICE ) + nice =MIN_NICE ; +if (nice >MAX_NICE ) + nice =MAX_NICE ;if (increment <0 && !can_nice (current, nice))return -EPERM ;
@@ -3631,7 +3631,7 @@ static int sched_copy_attr(struct sched_attr __user *uattr,* XXX: do we want to be lenient like existing syscalls; or do we want * to be strict and return an error on out-of-bounds values? */ - attr->sched_nice =clamp (attr->sched_nice,-20 ,19 ); + attr->sched_nice =clamp (attr->sched_nice,MIN_NICE ,MAX_NICE ); out:return ret;
tip-bot for Dongsheng Yang
merge bot[tip:sched/core] sched: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE
In reply to Dongsheng Yangsched: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE
Commit-ID: 75e45d512f257beedae0d8a67d053cde5537bd4c Gitweb: http://git.kernel.org/tip/75e45d512f257beedae0d8a67d053cde5537bd4c Author: Dongsheng Yang <[email protected]> AuthorDate: Tue, 11 Feb 2014 15:34:50 +0800 Committer: Ingo Molnar <[email protected]> CommitDate: Sat, 22 Feb 2014 18:15:54 +0100
sched: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE
--- kernel/sched/auto_group.c | 2 +- kernel/sched/core.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-)
kernel/sched/auto_group.c +1 -1
@@ -203,7 +203,7 @@ int proc_sched_autogroup_set_nice(struct task_struct *p, int nice)struct autogroup *ag;int err; -if (nice <-20 || nice >19 ) +if (nice <MIN_NICE || nice >MAX_NICE )return -EINVAL ; err =security_task_setnice (current, nice);
kernel/sched/core.c +6 -6
@@ -2993,7 +2993,7 @@ void set_user_nice(struct task_struct *p, long nice)unsigned long flags;struct rq *rq; -if (task_nice (p) == nice || nice <-20 || nice >19 ) +if (task_nice (p) == nice || nice <MIN_NICE || nice >MAX_NICE )return ;/* * We have to be careful, if called from sys_setpriority(),
@@ -3072,10 +3072,10 @@ SYSCALL_DEFINE1(nice, int, increment) increment =40 ; nice =task_nice (current) + increment; -if (nice <-20 ) - nice =-20 ; -if (nice >19 ) - nice =19 ; +if (nice <MIN_NICE ) + nice =MIN_NICE ; +if (nice >MAX_NICE ) + nice =MAX_NICE ;if (increment <0 && !can_nice (current, nice))return -EPERM ;
@@ -3623,7 +3623,7 @@ static int sched_copy_attr(struct sched_attr __user *uattr,* XXX: do we want to be lenient like existing syscalls; or do we want * to be strict and return an error on out-of-bounds values? */ - attr->sched_nice =clamp (attr->sched_nice,-20 ,19 ); + attr->sched_nice =clamp (attr->sched_nice,MIN_NICE ,MAX_NICE ); out:return ret;
PATCH 7/9 sys: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE.
In reply to Dongsheng Yang--- kernel/sys.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/sys.c +4 -4
@@ -174,10 +174,10 @@ SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval)/* normalize: avoid signed division (rounding problems) */ error = -ESRCH ; -if (niceval <-20 ) - niceval =-20 ; -if (niceval >19 ) - niceval =19 ; +if (niceval <MIN_NICE ) + niceval =MIN_NICE ; +if (niceval >MAX_NICE ) + niceval =MAX_NICE ;rcu_read_lock ();read_lock (&tasklist_lock);
Signature · 1 line
1.8.2.1
Re: [PATCH 7/9] sys: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE.
Quoted 20 lines · Dongsheng Yang
Signed-off-by Dongsheng Yang <[email protected]>cc Andrew Morton <[email protected]>cc Oleg Nesterov <[email protected]>cc Robin Holt <[email protected]>cc Al Viro <[email protected]>cc Kees Cook <[email protected]>cc "Eric W. Biederman" <[email protected]>cc Stephen Rothwell <[email protected]>cc Peter Zijlstra <[email protected]>cc Ingo Molnar <[email protected]>--- kernel/sys.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)kernel/sys.c +0
-0@@ -174,10 +174,10 @@ SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval)
kernel/sys.c SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval) · line 180
Quoted 10 lines
kernel/sys.c +4
-4/* normalize: avoid signed division (rounding problems) */ error = -ESRCH ; -if (niceval <-20 ) - niceval =-20 ; -if (niceval >19 ) - niceval =19 ; +if (niceval <MIN_NICE ) + niceval =MIN_NICE ; +if (niceval >MAX_NICE ) + niceval =MAX_NICE ;
Good catch! I'm all for using names instead of numeric values, however, I wonder if it'd be more readable to use "clamp" instead?
niceval = clamp(niceval, MIN_NICE, MAX_NICE);
-Kees
Quoted 6 lines
kernel/sys.c +0
-1rcu_read_lock ();read_lock (&tasklist_lock); --1.8.2.1
Signature · 2 lines
Kees Cook Chrome OS Security
Re: [PATCH 7/9] sys: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE.
Hi Kees,
Quoted 35 lines · Kees Cook
Quoted 20 lines · Dongsheng Yang
Signed-off-by Dongsheng Yang <[email protected]>cc Andrew Morton <[email protected]>cc Oleg Nesterov <[email protected]>cc Robin Holt <[email protected]>cc Al Viro <[email protected]>cc Kees Cook <[email protected]>cc "Eric W. Biederman" <[email protected]>cc Stephen Rothwell <[email protected]>cc Peter Zijlstra <[email protected]>cc Ingo Molnar <[email protected]>--- kernel/sys.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)kernel/sys.c +0
-0@@ -174,10 +174,10 @@ SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval)kernel/sys.c SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval) · line 180
Quoted 10 lines
kernel/sys.c +4
-4/* normalize: avoid signed division (rounding problems) */ error = -ESRCH ; -if (niceval <-20 ) - niceval =-20 ; -if (niceval >19 ) - niceval =19 ; +if (niceval <MIN_NICE ) + niceval =MIN_NICE ; +if (niceval >MAX_NICE ) + niceval =MAX_NICE ;Good catch! I'm all for using names instead of numeric values, however, I wonder if it'd be more readable to use "clamp" instead?
Quoted 1 line
niceval =
clamp(niceval, MIN_NICE, MAX_NICE);
Good suggestion! This patch here is just to replace the numeric values with a name defined in prio.h. So I will send another patch to make it more readable with clamp after the patch set here applied. Is this plan ok to you?
Thanx.
Quoted 10 lines
-Kees
Quoted 5 lines
kernel/sys.c +0
-1rcu_read_lock ();read_lock (&tasklist_lock); --1.8.2.1
Re: [PATCH 7/9] sys: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE.
Quoted 43 lines · Dongsheng Yang
Hi Kees,
Quoted 39 lines · Kees Cook
Quoted 22 lines · Dongsheng Yang
Signed-off-by Dongsheng Yang <[email protected]>cc Andrew Morton <[email protected]>cc Oleg Nesterov <[email protected]>cc Robin Holt <[email protected]>cc Al Viro <[email protected]>cc Kees Cook <[email protected]>cc "Eric W. Biederman" <[email protected]>cc Stephen Rothwell <[email protected]>cc Peter Zijlstra <[email protected]>cc Ingo Molnar <[email protected]>--- kernel/sys.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)kernel/sys.c +0
-0@@ -174,10 +174,10 @@ SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval)kernel/sys.c SYSCALL_DEFINE3(setpriority, int, which, int, who, · line 181
Quoted 10 lines
kernel/sys.c +4
-4/* normalize: avoid signed division (rounding problems) */ error = -ESRCH ; -if (niceval <-20 ) - niceval =-20 ; -if (niceval >19 ) - niceval =19 ; +if (niceval <MIN_NICE ) + niceval =MIN_NICE ; +if (niceval >MAX_NICE ) + niceval =MAX_NICE ;Good catch! I'm all for using names instead of numeric values, however, I wonder if it'd be more readable to use "clamp" instead?
Quoted 7 lines
Quoted 1 line
niceval =
clamp(niceval, MIN_NICE, MAX_NICE);Good suggestion! This patch here is just to replace the numeric values with a name defined in
prio.h. So I will send another patch to make it more readable
with clamp after the patch set here applied. Is this plan ok to you?
Sounds good to me. Thanks!
-Kees
Quoted 14 lines
Thanx.
Quoted 10 lines
-Kees
Quoted 5 lines
kernel/sys.c +0
-1rcu_read_lock ();read_lock (&tasklist_lock); --1.8.2.1
Signature · 2 lines
Kees Cook Chrome OS Security
tip-bot for Dongsheng Yang
merge bot[tip:sched/core] sys: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE.
In reply to Dongsheng Yangsys: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE.
Commit-ID: 4870c6e5774424c994bfd606cd8adb8818e8a85c Gitweb: http://git.kernel.org/tip/4870c6e5774424c994bfd606cd8adb8818e8a85c Author: Dongsheng Yang <[email protected]> AuthorDate: Tue, 11 Feb 2014 15:34:51 +0800 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 21 Feb 2014 21:43:21 +0100
sys: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE.
--- kernel/sys.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/sys.c +4 -4
@@ -174,10 +174,10 @@ SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval)/* normalize: avoid signed division (rounding problems) */ error = -ESRCH ; -if (niceval <-20 ) - niceval =-20 ; -if (niceval >19 ) - niceval =19 ; +if (niceval <MIN_NICE ) + niceval =MIN_NICE ; +if (niceval >MAX_NICE ) + niceval =MAX_NICE ;rcu_read_lock ();read_lock (&tasklist_lock);
tip-bot for Dongsheng Yang
merge bot[tip:sched/core] sys: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE
In reply to Dongsheng Yangsys: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE
Commit-ID: c4a4d2f43177f6165132c6d36a4d46963018f726 Gitweb: http://git.kernel.org/tip/c4a4d2f43177f6165132c6d36a4d46963018f726 Author: Dongsheng Yang <[email protected]> AuthorDate: Tue, 11 Feb 2014 15:34:51 +0800 Committer: Ingo Molnar <[email protected]> CommitDate: Sat, 22 Feb 2014 18:16:19 +0100
sys: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE
--- kernel/sys.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/sys.c +4 -4
@@ -174,10 +174,10 @@ SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval)/* normalize: avoid signed division (rounding problems) */ error = -ESRCH ; -if (niceval <-20 ) - niceval =-20 ; -if (niceval >19 ) - niceval =19 ; +if (niceval <MIN_NICE ) + niceval =MIN_NICE ; +if (niceval >MAX_NICE ) + niceval =MAX_NICE ;rcu_read_lock ();read_lock (&tasklist_lock);
PATCH 8/9 workqueue: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE.
In reply to Dongsheng Yang--- kernel/workqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/workqueue.c +1 -1
@@ -3218,7 +3218,7 @@ static ssize_t wq_nice_store(struct device *dev, struct device_attribute *attr,return -ENOMEM ;if (sscanf (buf,"%d" , &attrs->nice) ==1 && - attrs->nice >=-20 && attrs->nice <=19 ) + attrs->nice >=MIN_NICE && attrs->nice <=MAX_NICE ) ret =apply_workqueue_attrs (wq, attrs);else ret = -EINVAL ;
Signature · 1 line
1.8.2.1
Re: [PATCH 8/9] workqueue: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE.
Quoted 13 lines · Dongsheng Yang
Signed-off-by Dongsheng Yang <[email protected]>cc Tejun Heo <[email protected]>cc Peter Zijlstra <[email protected]>cc Ingo Molnar <[email protected]>--- kernel/workqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/workqueue.c +0
-0
kernel/workqueue.c static ssize_t wq_nice_store(struct device *dev, struct device_attribute *attr, · line 3221
Quoted 5 lines
kernel/workqueue.c +1
-1@@ -3218,7 +3218,7 @@ static ssize_t wq_nice_store(struct device *dev, struct device_attribute *attr,return -ENOMEM ;if (sscanf (buf,"%d" , &attrs->nice) ==1 && - attrs->nice >=-20 && attrs->nice <=19 ) + attrs->nice >=MIN_NICE && attrs->nice <=MAX_NICE )
No objection. If this gets accepted, it will be routed through -tip, I suppose? Please feel free to add
Thanks.
Signature · 1 line
tejun
tip-bot for Dongsheng Yang
merge bot[tip:sched/core] workqueue: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE.
In reply to Dongsheng Yangworkqueue: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE.
Commit-ID: dbebf7f826e1b3935f8bcd5d9681bf97708a7ddb Gitweb: http://git.kernel.org/tip/dbebf7f826e1b3935f8bcd5d9681bf97708a7ddb Author: Dongsheng Yang <[email protected]> AuthorDate: Tue, 11 Feb 2014 15:34:52 +0800 Committer: Thomas Gleixner <[email protected]> CommitDate: Fri, 21 Feb 2014 21:43:21 +0100
workqueue: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE.
--- kernel/workqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/workqueue.c +1 -1
@@ -3225,7 +3225,7 @@ static ssize_t wq_nice_store(struct device *dev, struct device_attribute *attr,return -ENOMEM ;if (sscanf (buf,"%d" , &attrs->nice) ==1 && - attrs->nice >=-20 && attrs->nice <=19 ) + attrs->nice >=MIN_NICE && attrs->nice <=MAX_NICE ) ret =apply_workqueue_attrs (wq, attrs);else ret = -EINVAL ;
tip-bot for Dongsheng Yang
merge bot[tip:sched/core] workqueue: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE
In reply to Dongsheng Yangworkqueue: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE
Commit-ID: 144818422bfa272531250473b888394c21e6fe19 Gitweb: http://git.kernel.org/tip/144818422bfa272531250473b888394c21e6fe19 Author: Dongsheng Yang <[email protected]> AuthorDate: Tue, 11 Feb 2014 15:34:52 +0800 Committer: Ingo Molnar <[email protected]> CommitDate: Sat, 22 Feb 2014 18:16:41 +0100
workqueue: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE
--- kernel/workqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/workqueue.c +1 -1
@@ -3225,7 +3225,7 @@ static ssize_t wq_nice_store(struct device *dev, struct device_attribute *attr,return -ENOMEM ;if (sscanf (buf,"%d" , &attrs->nice) ==1 && - attrs->nice >=-20 && attrs->nice <=19 ) + attrs->nice >=MIN_NICE && attrs->nice <=MAX_NICE ) ret =apply_workqueue_attrs (wq, attrs);else ret = -EINVAL ;
PATCH 9/9 trace: Replace hardcoding of 19 with MAX_NICE.
In reply to Dongsheng Yang--- kernel/trace/ring_buffer_benchmark.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/trace/ring_buffer_benchmark.c +3 -3
@@ -40,8 +40,8 @@ static int write_iteration = 50;module_param (write_iteration, uint,0644 );MODULE_PARM_DESC (write_iteration,"# of writes between timestamp readings" ); -static int producer_nice =19 ; -static int consumer_nice =19 ; +static int producer_nice =MAX_NICE ; +static int consumer_nice =MAX_NICE ;static int producer_fifo =-1 ;static int consumer_fifo =-1 ;
@@ -308,7 +308,7 @@ static void ring_buffer_producer(void)/* Let the user know that the test is running at low priority */ if (producer_fifo <0 && consumer_fifo <0 && - producer_nice ==19 && consumer_nice ==19 ) + producer_nice ==MAX_NICE && consumer_nice ==MAX_NICE )trace_printk ("WARNING!!! This test is running at lowest priority.\n" );trace_printk ("Time: %lld (usecs)\n" , time);
Signature · 1 line
1.8.2.1
Re: [PATCH 9/9] trace: Replace hardcoding of 19 with MAX_NICE.
Hi Peter.
It seems the all other patches in this set were all applied to tip
except this one.
What is the problem with the [9/9]? Is there any thing I can do?
Thanx
Quoted 32 lines · Dongsheng Yang
Signed-off-by Dongsheng Yang <[email protected]>cc Steven Rostedt <[email protected]>cc Frederic Weisbecker <[email protected]>cc Ingo Molnar <[email protected]>--- kernel/trace/ring_buffer_benchmark.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)kernel/trace/ring_buffer_benchmark.c +3
-3@@ -40,8 +40,8 @@ static int write_iteration = 50;module_param (write_iteration, uint,0644 );MODULE_PARM_DESC (write_iteration,"# of writes between timestamp readings" ); -static int producer_nice =19 ; -static int consumer_nice =19 ; +static int producer_nice =MAX_NICE ; +static int consumer_nice =MAX_NICE ;static int producer_fifo =-1 ;static int consumer_fifo =-1 ;@@ -308,7 +308,7 @@ static void ring_buffer_producer(void)/* Let the user know that the test is running at low priority */ if (producer_fifo <0 && consumer_fifo <0 && - producer_nice ==19 && consumer_nice ==19 ) + producer_nice ==MAX_NICE && consumer_nice ==MAX_NICE )trace_printk ("WARNING!!! This test is running at lowest priority.\n" );trace_printk ("Time: %lld (usecs)\n" , time);
Peter Zijlstra
maintainerRe: [PATCH 9/9] trace: Replace hardcoding of 19 with MAX_NICE.
Quoted 4 lines · Dongsheng Yang
Hi Peter.
It seems the all other patches in this set were all applied to tip
except this one.
What is the problem with the [9/9]? Is there any thing I can do?
I might have just missed it; fail on my end. I'll try and sort it on monday.
Peter Zijlstra
maintainerRe: [PATCH 9/9] trace: Replace hardcoding of 19 with MAX_NICE.
In reply to Dongsheng YangQuoted 4 lines · Dongsheng Yang
Hi Peter.
It seems the all other patches in this set were all applied to tip
except this one.
What is the problem with the [9/9]? Is there any thing I can do?
The problem is that it never actually made it to my inbox; could you verify that I was indeed on the recipient list? And if not resend it.
In case I was actually on the recipient list I need to go figure out where it went.
Re: [PATCH 9/9] trace: Replace hardcoding of 19 with MAX_NICE.
Quoted 7 lines · Peter Zijlstra
Quoted 4 lines · Dongsheng Yang
Hi Peter.
It seems the all other patches in this set were all applied to tip
except this one.
What is the problem with the [9/9]? Is there any thing I can do?The problem is that it never actually made it to my inbox; could you verify that I was indeed on the recipient list? And if not resend it.
Oh, yes. Sorry for that. I will resend it soon with ccing you.
Quoted 9 lines
In case I was actually on the recipient list I need to go figure out where it went.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
PATCH RESEND 1/1 trace: Replace hardcoding of 19 with MAX_NICE.
In reply to Dongsheng Yang--- kernel/trace/ring_buffer_benchmark.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/trace/ring_buffer_benchmark.c +3 -3
@@ -40,8 +40,8 @@ static int write_iteration = 50;module_param (write_iteration, uint,0644 );MODULE_PARM_DESC (write_iteration,"# of writes between timestamp readings" ); -static int producer_nice =19 ; -static int consumer_nice =19 ; +static int producer_nice =MAX_NICE ; +static int consumer_nice =MAX_NICE ;static int producer_fifo =-1 ;static int consumer_fifo =-1 ;
@@ -308,7 +308,7 @@ static void ring_buffer_producer(void)/* Let the user know that the test is running at low priority */ if (producer_fifo <0 && consumer_fifo <0 && - producer_nice ==19 && consumer_nice ==19 ) + producer_nice ==MAX_NICE && consumer_nice ==MAX_NICE )trace_printk ("WARNING!!! This test is running at lowest priority.\n" );trace_printk ("Time: %lld (usecs)\n" , time);
Signature · 1 line
1.8.2.1
Peter Zijlstra
maintainerRe: [PATCH Resend] trace: Replace hardcoding of 19 with MAX_NICE.
Quoted 1 line · Dongsheng Yang
Signed-off-by Dongsheng Yang <[email protected]>
"Use MAX_NICE instead of the value 19 for ring_buffer_benchmark."
Quoted 5 lines
cc Steven Rostedt <[email protected]>cc Frederic Weisbecker <[email protected]>cc Ingo Molnar <[email protected]>cc Peter Zijlstra <[email protected]>---
Thanks.
Steven Rostedt
maintainerRe: [PATCH Resend] trace: Replace hardcoding of 19 with MAX_NICE.
In reply to Dongsheng YangQuoted 5 lines · On Mon, 24 Feb 2014 22:12:01 +0800 Dongsheng Yang <[email protected]>…
Signed-off-by Dongsheng Yang <[email protected]>cc Steven Rostedt <[email protected]>cc Frederic Weisbecker <[email protected]>cc Ingo Molnar <[email protected]>cc Peter Zijlstra <[email protected]>
Peter,
If you want to take this, you can add my Acked-by.
-- Steve
Quoted 28 lines
--- kernel/trace/ring_buffer_benchmark.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)kernel/trace/ring_buffer_benchmark.c +3
-3@@ -40,8 +40,8 @@ static int write_iteration = 50;module_param (write_iteration, uint,0644 );MODULE_PARM_DESC (write_iteration,"# of writes between timestamp readings" ); -static int producer_nice =19 ; -static int consumer_nice =19 ; +static int producer_nice =MAX_NICE ; +static int consumer_nice =MAX_NICE ;static int producer_fifo =-1 ;static int consumer_fifo =-1 ;@@ -308,7 +308,7 @@ static void ring_buffer_producer(void)/* Let the user know that the test is running at low priority */ if (producer_fifo <0 && consumer_fifo <0 && - producer_nice ==19 && consumer_nice ==19 ) + producer_nice ==MAX_NICE && consumer_nice ==MAX_NICE )trace_printk ("WARNING!!! This test is running at lowest priority.\n" );trace_printk ("Time: %lld (usecs)\n" , time);
Peter Zijlstra
maintainerRe: [PATCH Resend] trace: Replace hardcoding of 19 with MAX_NICE.
Quoted 9 lines · Steven Rostedt
Quoted 5 lines · On Mon, 24 Feb 2014 22:12:01 +0800 Dongsheng Yang <[email protected]>…
Signed-off-by Dongsheng Yang <[email protected]>cc Steven Rostedt <[email protected]>cc Frederic Weisbecker <[email protected]>cc Ingo Molnar <[email protected]>cc Peter Zijlstra <[email protected]>
Quoted 3 lines
Peter,
If you want to take this, you can add my Acked-by.
Done, thanks!
tip-bot for Dongsheng Yang
merge bot[tip:sched/core] trace: Replace hardcoding of 19 with MAX_NICE
In reply to Dongsheng Yangtrace: Replace hardcoding of 19 with MAX_NICE
Commit-ID: 2b3942e4bb20ef8ef26515bd958c2df83d9a6210 Gitweb: http://git.kernel.org/tip/2b3942e4bb20ef8ef26515bd958c2df83d9a6210 Author: Dongsheng Yang <[email protected]> AuthorDate: Mon, 24 Feb 2014 22:12:01 +0800 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 27 Feb 2014 12:41:03 +0100
trace: Replace hardcoding of 19 with MAX_NICE
Use MAX_NICE instead of the value 19 for ring_buffer_benchmark.
--- kernel/trace/ring_buffer_benchmark.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/trace/ring_buffer_benchmark.c +3 -3
@@ -40,8 +40,8 @@ static int write_iteration = 50;module_param (write_iteration, uint,0644 );MODULE_PARM_DESC (write_iteration,"# of writes between timestamp readings" ); -static int producer_nice =19 ; -static int consumer_nice =19 ; +static int producer_nice =MAX_NICE ; +static int consumer_nice =MAX_NICE ;static int producer_fifo =-1 ;static int consumer_fifo =-1 ;
@@ -308,7 +308,7 @@ static void ring_buffer_producer(void)/* Let the user know that the test is running at low priority */ if (producer_fifo <0 && consumer_fifo <0 && - producer_nice ==19 && consumer_nice ==19 ) + producer_nice ==MAX_NICE && consumer_nice ==MAX_NICE )trace_printk ("WARNING!!! This test is running at lowest priority.\n" );trace_printk ("Time: %lld (usecs)\n" , time);
Hi Ingo & Peter,
What's your opinion on this patchset?
Quoted 30 lines · Dongsheng Yang
Hi Peter,
There are lots of hardcoding of -20 and 19 in kernel to represent
minimum and maximum of nice value currently. This patch set define three macros inprio.hand replace some of the hardcoding with them.Please help to take a look at it, thanx :)
Dongsheng Yang (9):
sched: Prio: UseDEFAULT_PRIOto defineNICE_TO_PRIOandPRIO_TO_NICE.
sched: prio: Add 3 macros ofMAX_NICE,MIN_NICEandNICE_WIDTHinprio.h.sched: prio: Use
NICE_WIDTHmacro to avoid using of hard coding of 40
and 20 inprio.h.
sched: prio: Add spaces before and after operator of '-'.
rcu: UseMAX_NICEto replace hard coding of 19.
sched: Replace hardcoding of -20 and 19 withMIN_NICEandMAX_NICE.
sys: Replace hardcoding of -20 and 19 withMIN_NICEandMAX_NICE.
workqueue: Replace hardcoding of -20 and 19 withMIN_NICEand
MAX_NICE.
trace: Replace hardcoding of 19 withMAX_NICE.include/linux/sched/prio.h | 14 +++++++++----- kernel/rcu/torture.c | 8 ++++---- kernel/sched/auto_group.c | 2 +- kernel/sched/core.c | 12 ++++++------ kernel/sys.c | 8 ++++---- kernel/trace/ring_buffer_benchmark.c | 6 +++--- kernel/workqueue.c | 2 +- 7 files changed, 28 insertions(+), 24 deletions(-)
Quoted 2 lines · Dongsheng Yang
Hi Ingo & Peter,
What's your opinion on this patchset?
I queued it; I wasn't convinced but people seem to like it, which is good enough.
Quoted 5 lines · Peter Zijlstra
Quoted 2 lines · Dongsheng Yang
Hi Ingo & Peter,
What's your opinion on this patchset?I queued it; I wasn't convinced but people seem to like it, which is good enough.
Thank you :)
Quoted 6 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/