public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu
Subject: Re: [patch 1/3] Drop tasklist lock in do_sched_setscheduler
Date: Fri, 23 Jun 2006 08:01:39 +0200	[thread overview]
Message-ID: <1151042499.25491.211.camel@localhost.localdomain> (raw)
In-Reply-To: <20060622184850.29e26ce6.akpm@osdl.org>

On Thu, 2006-06-22 at 18:48 -0700, Andrew Morton wrote:
> On Thu, 22 Jun 2006 09:08:38 -0000
> Thomas Gleixner <tglx@linutronix.de> 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.
> > 
> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> > Signed-off-by: Ingo Molnar <mingo@elte.hu>
> > 
> >  kernel/sched.c |    4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > Index: linux-2.6.17-mm/kernel/sched.c
> > ===================================================================
> > --- 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;
> >  }
> >  
> 
> Is this optimisation actually related to the rt-mutex patches, or to the
> other two patches?

Yes. We neither want interrupt disabled nor holding tasklist lock when
it comes to the lock chain walk. So its a preperatory patch and a
general optimization.

	tglx



  reply	other threads:[~2006-06-23  6:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2006-06-24  8:07   ` Andrew Morton
2006-06-24  8:25     ` Thomas Gleixner
2006-06-22  9:08 ` [patch 2/3] rtmutex: Propagate priority settings into PI lock chains Thomas Gleixner
2006-06-22 14:20   ` Steven Rostedt
2006-06-22 18:02     ` Esben Nielsen
2006-06-23  6:27       ` Steven Rostedt
2006-06-23  2:08     ` Andrew Morton
2006-06-23  9:28       ` [PATCH -mm] bug if setscheduler is called from interrupt context Steven Rostedt
2006-06-23  2:06   ` [patch 2/3] rtmutex: Propagate priority settings into PI lock chains Andrew Morton
2006-06-23 16:26     ` Thomas Gleixner
2006-06-22  9:08 ` [patch 3/3] rtmutex: Modify rtmutex-tester to test the setscheduler propagation Thomas Gleixner
  -- strict thread matches above, loose matches on Subject: below --
2006-06-25  0:50 [patch 1/3] Drop tasklist lock in do_sched_setscheduler Oleg Nesterov
2006-06-25 15:35 ` Thomas Gleixner

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=1151042499.25491.211.camel@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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