public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Steven Rostedt <rostedt@goodmis.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] rt/threadirqs: don't need to save irqs in do_hardirq()
Date: Fri, 13 Feb 2009 00:27:58 +0100	[thread overview]
Message-ID: <20090212232758.GA5865@nowhere> (raw)
In-Reply-To: <20090212232459.GD5348@ghostprotocols.net>

On Thu, Feb 12, 2009 at 09:24:59PM -0200, Arnaldo Carvalho de Melo wrote:
> Em Thu, Feb 12, 2009 at 07:27:08PM +0100, Frederic Weisbecker escreveu:
> > do_hardirq() has only one caller do_irqd() in a path where irq are already
> > disabled. So we don't need to save irqs while holding desc->lock
> > 
> > Replace spin_lock_irqsave by spin_lock.
> > 
> > Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> > ---
> >  kernel/irq/manage.c |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
> > index ed7c5e3..6e9baf8 100644
> > --- a/kernel/irq/manage.c
> > +++ b/kernel/irq/manage.c
> > @@ -905,7 +905,7 @@ static void do_hardirq(struct irq_desc *desc)
> >  {
> >  	unsigned long flags;
> 
> Can flags be removed too?


Actually... I cheated.
Once the two patches were done, I saw the unused variable warning. So I remade the second patch
to remove flags but..yes it should be on the first patch, I must confess...
   
> > -	spin_lock_irqsave(&desc->lock, flags);
> > +	spin_lock(&desc->lock);
> >  
> >  	if (!(desc->status & IRQ_INPROGRESS))
> >  		goto out;
> > @@ -921,7 +921,7 @@ static void do_hardirq(struct irq_desc *desc)
> >  	else
> >  		thread_do_irq(desc);
> >   out:
> > -	spin_unlock_irqrestore(&desc->lock, flags);
> > +	spin_unlock(&desc->lock);
> >  
> >  	if (waitqueue_active(&desc->wait_for_handler))
> >  		wake_up(&desc->wait_for_handler);


  reply	other threads:[~2009-02-12 23:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-12 18:27 [PATCH 1/2] rt/threadirqs: don't need to save irqs in do_hardirq() Frederic Weisbecker
2009-02-12 23:24 ` Arnaldo Carvalho de Melo
2009-02-12 23:27   ` Frederic Weisbecker [this message]
2009-02-12 23:37     ` Steven Rostedt
2009-02-12 23:43       ` Arnaldo Carvalho de Melo

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=20090212232758.GA5865@nowhere \
    --to=fweisbec@gmail.com \
    --cc=acme@ghostprotocols.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /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