mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mikulas Patocka <mpatocka@redhat.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Jens Axboe <jens.axboe@oracle.com>,
	linux-kernel@vger.kernel.org, Neil Brown <neilb@suse.de>
Subject: Re: [PATCH 1/2] Avoid bio_endio recursion
Date: Thu, 3 Jul 2008 17:03:44 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0807031637040.20244@engineering.redhat.com> (raw)
In-Reply-To: <20080702090048.2ec99b72@lxorguk.ukuu.org.uk>

On Wed, 2 Jul 2008, Alan Cox wrote:

> On Wed, 2 Jul 2008 00:09:22 -0400 (EDT)
> Mikulas Patocka <mpatocka@redhat.com> wrote:
>
>>> Right, that wont work of course. Completions are typically done through
>>> a softirq, so it is not currently done with hard interrupts disabled.
>>
>> I thought, from hardirq - that's what IDE is doing. And they are called
>
> Even IDE will sometimes complete from a timer on an error.
>
>> And does local_irq_restore() need to execute even more costy "popf" when
>> it makes a transition from disabled to disabled state? What's
>> local_irq_restore semantics --- is it allowed to use local_irq_restore for
>> transition from interrupt-enabled state into interrupt-disabled state?
>
> If you are worried about performance the network layer has _irq variants
> of various functions that are faster and can only be called from the
> right context (eg kfree_skb_irq), so you could do two versions of that
> code.
>
> Alan

I was thinking about a general optimization --- something like this. On 
Core2 it doesn't make much sense --- cli is fast there (just 11 ticks). On 
Pentium 4 it would make sense, because cli is much more costy there.

Mikulas

---
  include/asm-x86/irqflags.h |    3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6.26-rc8/include/asm-x86/irqflags.h
===================================================================
--- linux-2.6.26-rc8.orig/include/asm-x86/irqflags.h	2008-06-02 23:13:32.000000000 +0200
+++ linux-2.6.26-rc8/include/asm-x86/irqflags.h	2008-07-03 22:53:32.000000000 +0200
@@ -101,7 +101,8 @@ static inline unsigned long __raw_local_
  {
  	unsigned long flags = __raw_local_save_flags();

-	raw_local_irq_disable();
+	if (flags & X86_EFLAGS_IF)
+		raw_local_irq_disable();

  	return flags;
  }

  reply	other threads:[~2008-07-03 21:04 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-24  5:22 Mikulas Patocka
2008-06-24  6:08 ` Neil Brown
2008-06-24 14:36   ` Mikulas Patocka
2008-06-24  8:07 ` Jens Axboe
2008-06-24 14:27   ` Mikulas Patocka
2008-06-25  8:24     ` Jens Axboe
2008-06-26  0:13       ` Mikulas Patocka
2008-06-26  7:07         ` Jens Axboe
2008-07-02  4:09           ` Mikulas Patocka
2008-07-02  8:00             ` Alan Cox
2008-07-03 21:03               ` Mikulas Patocka [this message]
2008-07-02  8:25             ` Jens Axboe
2008-07-03 21:08               ` Mikulas Patocka
2008-07-03 21:04                 ` Alan Cox
2008-07-03 22:54                   ` Mikulas Patocka
2008-07-03 23:00                     ` Alan Cox
2008-07-03 23:51                       ` Mikulas Patocka
2008-07-03 23:44                         ` Alan Cox
2008-07-04  3:26                           ` Mikulas Patocka
2008-07-04  8:11                             ` Alan Cox

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=Pine.LNX.4.64.0807031637040.20244@engineering.redhat.com \
    --to=mpatocka@redhat.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@suse.de \
    /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

Powered by JetHome