public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [patch 1/3] Drop tasklist lock in do_sched_setscheduler
@ 2006-06-25  0:50 Oleg Nesterov
  2006-06-25 15:35 ` Thomas Gleixner
  0 siblings, 1 reply; 7+ messages in thread
From: Oleg Nesterov @ 2006-06-25  0:50 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Ingo Molnar, Andrew Morton, linux-kernel

Thomas Gleixner wrote:
>
> There is no need to hold tasklist_lock across the setscheduler call, when we
> pin the task structure with get_task_struct(). Interrupts are disabled in 
> setscheduler anyway and the permission checks do not need interrupts disabled.
>
> --- linux-2.6.17-mm.orig/kernel/sched.c	2006-06-22 10:26:11.000000000 +0200
> +++ linux-2.6.17-mm/kernel/sched.c	2006-06-22 10:26:11.000000000 +0200
> @@ -4140,8 +4140,10 @@
>  		read_unlock_irq(&tasklist_lock);
>  		return -ESRCH;
>  	}
> -	retval = sched_setscheduler(p, policy, &lparam);
> +	get_task_struct(p);
>  	read_unlock_irq(&tasklist_lock);
> +	retval = sched_setscheduler(p, policy, &lparam);
> +	put_task_struct(p);
>  	return retval;
>  }

But we don't need read_lock(tasklist) and get_task_struct(p) at all?

rcu_read_lock/rcu_read_unlock is enough, no?

Oleg.


^ permalink raw reply	[flat|nested] 7+ messages in thread
* [patch 0/3] rtmutex: Propagate priority setting into lock chains
@ 2006-06-22  9:08 Thomas Gleixner
  2006-06-22  9:08 ` [patch 1/3] Drop tasklist lock in do_sched_setscheduler Thomas Gleixner
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Gleixner @ 2006-06-22  9:08 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, Ingo Molnar

Andrew,

Please add the following patches to the rtmutex / pi-futex patchset.

This ensures that asynchronous setscheduler() calls are properly propagated
into a already blocked task's lock dependency chain.
The testsuite has also been improved to verify this behaviour.

	tglx

--


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

end of thread, other threads:[~2006-06-25 15:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-25  0:50 [patch 1/3] Drop tasklist lock in do_sched_setscheduler Oleg Nesterov
2006-06-25 15:35 ` Thomas Gleixner
  -- strict thread matches above, loose matches on Subject: below --
2006-06-22  9:08 [patch 0/3] rtmutex: Propagate priority setting into lock chains Thomas Gleixner
2006-06-22  9:08 ` [patch 1/3] Drop tasklist lock in do_sched_setscheduler Thomas Gleixner
2006-06-23  1:48   ` Andrew Morton
2006-06-23  6:01     ` Thomas Gleixner
2006-06-24  8:07   ` Andrew Morton
2006-06-24  8:25     ` Thomas Gleixner

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