public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] MAX_USER_RT_PRIO and MAX_RT_PRIO are wrong!
       [not found] ` <20050607053306.GA16181@elte.hu>
@ 2005-06-07 11:25   ` Steven Rostedt
  2005-06-07 15:48     ` Dean Nelson
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2005-06-07 11:25 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-ia64, linux-altix, edwardsg, LKML, Andrew Morton,
	anton.wilson

On Tue, 2005-06-07 at 07:33 +0200, Ingo Molnar wrote:
> * Steven Rostedt <rostedt@goodmis.org> wrote:
> 
> > I tested the patch on an SMP machine where MAX_RT_PRIO = 100 and 
> > MAX_USER_RT_PRIO = 99. Without the patch, the system crashes with a 
> > reboot.
> 
> Acked-by: Ingo Molnar <mingo@elte.hu>

If this patch does go in, then xpc_activating in
arch/ia64/sn/kernel/xpc_main.c (from rc6) also needs to use MAX_RT_PRIO
instead of MAX_USER_RT_PRIO. Unless it is OK that it runs lower in
priority than other kernel threads.

-- Steve



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] MAX_USER_RT_PRIO and MAX_RT_PRIO are wrong!
  2005-06-07 11:25   ` [PATCH] MAX_USER_RT_PRIO and MAX_RT_PRIO are wrong! Steven Rostedt
@ 2005-06-07 15:48     ` Dean Nelson
  2005-06-07 17:31       ` Steven Rostedt
  0 siblings, 1 reply; 6+ messages in thread
From: Dean Nelson @ 2005-06-07 15:48 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: mingo, linux-ia64, linux-altix, edwardsg, linux-kernel, akpm,
	anton.wilson

On Tue, Jun 07, 2005 at 07:25:04AM -0400, Steven Rostedt wrote:
> On Tue, 2005-06-07 at 07:33 +0200, Ingo Molnar wrote:
> > * Steven Rostedt <rostedt@goodmis.org> wrote:
> > 
> > > I tested the patch on an SMP machine where MAX_RT_PRIO = 100 and 
> > > MAX_USER_RT_PRIO = 99. Without the patch, the system crashes with a 
> > > reboot.
> > 
> > Acked-by: Ingo Molnar <mingo@elte.hu>
> 
> If this patch does go in, then xpc_activating in
> arch/ia64/sn/kernel/xpc_main.c (from rc6) also needs to use MAX_RT_PRIO
> instead of MAX_USER_RT_PRIO. Unless it is OK that it runs lower in
> priority than other kernel threads.

You are correct xpc_activating() needs to be changed to use MAX_RT_PRIO.
So please do add that change to your patch.

Thanks,
Dean


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] MAX_USER_RT_PRIO and MAX_RT_PRIO are wrong!
  2005-06-07 15:48     ` Dean Nelson
@ 2005-06-07 17:31       ` Steven Rostedt
  2005-06-07 19:10         ` Dean Nelson
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2005-06-07 17:31 UTC (permalink / raw)
  To: Dean Nelson
  Cc: mingo, linux-ia64, linux-altix, edwardsg, linux-kernel, akpm,
	anton.wilson

On Tue, 2005-06-07 at 10:48 -0500, Dean Nelson wrote:
> You are correct xpc_activating() needs to be changed to use MAX_RT_PRIO.
> So please do add that change to your patch.

I haven't tested this patch, I just used the previous patch (which I did
test) and added your change.

-- Steve

--- linux-2.6.12-rc6/kernel/sched.c.orig	2005-06-07 13:22:33.000000000 -0400
+++ linux-2.6.12-rc6/kernel/sched.c	2005-06-07 13:22:37.000000000 -0400
@@ -3347,7 +3347,7 @@
 	p->policy = policy;
 	p->rt_priority = prio;
 	if (policy != SCHED_NORMAL)
-		p->prio = MAX_USER_RT_PRIO-1 - p->rt_priority;
+		p->prio = MAX_RT_PRIO-1 - p->rt_priority;
 	else
 		p->prio = p->static_prio;
 }
@@ -3379,7 +3379,8 @@
 	 * 1..MAX_USER_RT_PRIO-1, valid priority for SCHED_NORMAL is 0.
 	 */
 	if (param->sched_priority < 0 ||
-	    param->sched_priority > MAX_USER_RT_PRIO-1)
+	    (p->mm &&  param->sched_priority > MAX_USER_RT_PRIO-1) ||
+	    (!p->mm && param->sched_priority > MAX_RT_PRIO-1))
 		return -EINVAL;
 	if ((policy = SCHED_NORMAL) != (param->sched_priority = 0))
 		return -EINVAL;
--- linux-2.6.12-rc6/arch/ia64/sn/kernel/xpc_main.c.orig	2005-06-07 13:23:26.000000000 -0400
+++ linux-2.6.12-rc6/arch/ia64/sn/kernel/xpc_main.c	2005-06-07 13:23:43.000000000 -0400
@@ -420,7 +420,7 @@
 	partid_t partid = (u64) __partid;
 	struct xpc_partition *part = &xpc_partitions[partid];
 	unsigned long irq_flags;
-	struct sched_param param = { sched_priority: MAX_USER_RT_PRIO - 1 };
+	struct sched_param param = { sched_priority: MAX_RT_PRIO - 1 };
 	int ret;
 
 




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] MAX_USER_RT_PRIO and MAX_RT_PRIO are wrong!
  2005-06-07 17:31       ` Steven Rostedt
@ 2005-06-07 19:10         ` Dean Nelson
  2005-06-07 19:23           ` Steven Rostedt
  0 siblings, 1 reply; 6+ messages in thread
From: Dean Nelson @ 2005-06-07 19:10 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: mingo, linux-ia64, linux-altix, edwardsg, linux-kernel, akpm,
	anton.wilson

On Tue, Jun 07, 2005 at 01:31:59PM -0400, Steven Rostedt wrote:
> On Tue, 2005-06-07 at 10:48 -0500, Dean Nelson wrote:
> > You are correct xpc_activating() needs to be changed to use MAX_RT_PRIO.
> > So please do add that change to your patch.
> 
> I haven't tested this patch, I just used the previous patch (which I did
> test) and added your change.

I just built and tested a kernel and xp/xpc/xpnet modules with your patch
applied. It ran fine. The priorities of the xpc kthreads were correct.

Looks good to me.

Thanks,
Dean


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] MAX_USER_RT_PRIO and MAX_RT_PRIO are wrong!
  2005-06-07 19:10         ` Dean Nelson
@ 2005-06-07 19:23           ` Steven Rostedt
  2005-06-07 20:19             ` Dean Nelson
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2005-06-07 19:23 UTC (permalink / raw)
  To: Dean Nelson
  Cc: mingo, linux-ia64, linux-altix, edwardsg, linux-kernel, akpm,
	anton.wilson

On Tue, 2005-06-07 at 14:10 -0500, Dean Nelson wrote:

> I just built and tested a kernel and xp/xpc/xpnet modules with your patch
> applied. It ran fine. The priorities of the xpc kthreads were correct.
> 
> Looks good to me.

Dean, 

If you can do me a favor, the way you really want to test this is by
changing MAX_USER_RT_PRIO to 99 and MAX_RT_PRIO to 
(MAX_USER_RT_PRIO+1).  This will make sure that the patch is working.
Your kernel thread should still run at priority 99. 

Check it with:  ps -eo pid,rtprio,comm

And grep for your thread name.

Thanks,

-- Steve



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] MAX_USER_RT_PRIO and MAX_RT_PRIO are wrong!
  2005-06-07 19:23           ` Steven Rostedt
@ 2005-06-07 20:19             ` Dean Nelson
  0 siblings, 0 replies; 6+ messages in thread
From: Dean Nelson @ 2005-06-07 20:19 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: mingo, linux-ia64, linux-altix, edwardsg, linux-kernel, akpm,
	anton.wilson

On Tue, Jun 07, 2005 at 03:23:02PM -0400, Steven Rostedt wrote:
> On Tue, 2005-06-07 at 14:10 -0500, Dean Nelson wrote:
> 
> > I just built and tested a kernel and xp/xpc/xpnet modules with your patch
> > applied. It ran fine. The priorities of the xpc kthreads were correct.
> > 
> > Looks good to me.
> 
> Dean, 
> 
> If you can do me a favor, the way you really want to test this is by
> changing MAX_USER_RT_PRIO to 99 and MAX_RT_PRIO to 
> (MAX_USER_RT_PRIO+1).  This will make sure that the patch is working.
> Your kernel thread should still run at priority 99. 
> 
> Check it with:  ps -eo pid,rtprio,comm
> 
> And grep for your thread name.

Just did as you asked and things seem fine. Ran on an SGI altix.
(The first process shown below shouldn't have a priority of 99,
just the others.)

cranberry5:~ # ps -eo pid,rtprio,comm | grep xpc
13325      - xpc_hb
13327     99 xpc08
13467     99 xpc06
13469     99 xpc06c1
13501     99 xpc06c1
13502     99 xpc06c1
cranberry5:~ #


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-06-07 20:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1118112390.4533.10.camel@localhost.localdomain>
     [not found] ` <20050607053306.GA16181@elte.hu>
2005-06-07 11:25   ` [PATCH] MAX_USER_RT_PRIO and MAX_RT_PRIO are wrong! Steven Rostedt
2005-06-07 15:48     ` Dean Nelson
2005-06-07 17:31       ` Steven Rostedt
2005-06-07 19:10         ` Dean Nelson
2005-06-07 19:23           ` Steven Rostedt
2005-06-07 20:19             ` Dean Nelson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox