public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	lkml <linux-kernel@vger.kernel.org>,
	linux-arch <linux-arch@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [RFC][PATCH] irq: remove IRQF_DISABLED
Date: Mon, 2 Mar 2009 18:55:02 +0100	[thread overview]
Message-ID: <200903021855.02765.bzolnier@gmail.com> (raw)
In-Reply-To: <alpine.LFD.2.00.0903020852220.3111@localhost.localdomain>

On Monday 02 March 2009, Linus Torvalds wrote:
> 
> On Mon, 2 Mar 2009, Peter Zijlstra wrote:
> > 
> > Would you be willing to take such a patch?
> 
> Yes - some day.
> 
> The "irq's disabled fastpath" thing has been there since pretty much day 
> one, because some irq handlers always wanted it. Making it the default 
> (and the only choice) is fine.
> 
> HOWEVER.
> 
> The fact is, some interrupt handlers are too slow for this. If you are 
> using a PIO IDE driver, not enabling interrupts will not only make you 
> lose serial line interrupts like mad (even at slow speeds), but has 
> historically resulted in even timer interrupts being lost because the IDE 
> layer is so slow.
> 
> The thing is, with PIO, a 512-byte disk read ends up doing 256 16-bit word 
> reads from the controller, each potentially up to 600ns long (PIO0 
> timings). That's 150ms - for a single sector!
> 
> Now, IDE controllers that we end up using PIO on all tend to be pretty 
> old, but admittedly even the old ones are faster than the worst-case 
> timings, so in practice you're not looking quite at that kind of horror 
> case, but you're still looking at each sector transfer (256 16-bit words) 
> taking on the order of tens of us.
> 
> For example, Mode2 timings are probably still something we should consider 
> realistic, and that's 240ns per word - a single sector now takes ~60ms to 
> read off the disk.
> 
> And we don't do single sectors. Most transfers will be 8 sectors (4k 
> contiguos read). So now that 60ms is 480ms per such IDE interrupt. And 
> even with the _good_ timings, we're certainly looking at a reduction of 
> that to about half.
> 
> Imagine what happens when we have interrupts disabled for half a second at 
> a time.  
> 
> In other words, I do not think we are ready for this.
> 
> Now: I suspect you don't have a single machine that does PIO by default, 
> and you probably haven't had any for the last ten years. These things 
> _are_ old. But they do exist. 
> 
> Could we make IRQF_DISABLED the default? Hell yes. We probably should. But 
> we realistically can't remove the non-disabled case, until you also have a 
> (tested) patch to fix these kinds of issues for the IDE PIO case (and 
> possibly others - IDE is the one I _know_ needs it).
> 
> Could we make just the IDE driver itself enable interrupts? Sure. But that 

Actually it has been doing it for years (some host drivers don't do this by
default and still need "hdparm -u" or equivalent but I was planning to change
it for 2.6.30).

> means that the interrupt controller code needs to know that some drivers 
> may enable interrupts and they may have recursive interrupts occurring. In 
> which case you really do want a flag anyway, since the interrupt 
> controller may well end up deciding that the "we're not going to enable 
> interrupts" case allows certain optimizations (like just ACK'ing it 
> immediately and not masking it at the interrupt controller).
> So this is not as simple as your patch. Not even _nearly_.

IDE IRQ handler (& probably many others) assume that IRQ layer won't be
trying to call it again while IRQ is being serviced -- is this going to
change with the introduction of threaded IRQs?

Thanks,
Bart

  reply	other threads:[~2009-03-02 17:53 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-02 12:21 [RFC][PATCH] irq: remove IRQF_DISABLED Peter Zijlstra
2009-03-02 14:43 ` Ingo Molnar
2009-03-02 15:47   ` Matthew Wilcox
2009-03-02 15:59     ` Peter Zijlstra
2009-03-02 16:32       ` Matthew Wilcox
2009-03-02 21:01       ` Russell King
2009-03-02 21:17         ` Ingo Molnar
2009-03-02 21:17           ` Ingo Molnar
2009-03-02 17:11 ` Linus Torvalds
2009-03-02 17:55   ` Bartlomiej Zolnierkiewicz [this message]
2009-03-02 18:02     ` Peter Zijlstra
2009-03-02 18:07     ` Peter Zijlstra
2009-03-02 18:27       ` Bartlomiej Zolnierkiewicz
2009-03-02 18:29     ` Linus Torvalds
2009-03-02 18:48       ` Bartlomiej Zolnierkiewicz
2009-03-02 19:06         ` Linus Torvalds
2009-03-02 19:18           ` Bartlomiej Zolnierkiewicz
2009-03-02 17:56   ` Peter Zijlstra
2009-03-02 18:45   ` Vadim Lobanov
2009-03-02 18:45     ` Vadim Lobanov
2009-03-02 18:54     ` Linus Torvalds
2009-03-05 15:40       ` Mark Lord
2009-03-02 21:17   ` Alan Cox
2009-03-02 21:17     ` Alan Cox
2009-03-06  8:58   ` Benjamin Herrenschmidt
2009-03-06  9:12     ` Peter Zijlstra
2009-03-06  9:59       ` Benjamin Herrenschmidt
2009-03-06 10:05         ` Benjamin Herrenschmidt
2009-03-06 10:24         ` Peter Zijlstra
2009-03-06 17:02           ` Peter Zijlstra
2009-03-06 21:40             ` Benjamin Herrenschmidt
2009-03-02 17:55 ` Andrew Morton
2009-03-02 18:10   ` Peter Zijlstra

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=200903021855.02765.bzolnier@gmail.com \
    --to=bzolnier@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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