Hello, again.
On 08/02/2010 07:10 PM, Thomas Gleixner wrote:
Yeah, these differences all come down to expecting. If it weren't for
expecting, one timer to rule them all should have been enough. I'll
continue below.
The current logic isn't that different except that it always considers
periods instead of consecutive ones and uses exponential backoff for
re-enable timing.
Hmmm... there _are_ some complications but they're mainly how
different mechanisms may interact with each other (ie. watching
delayed while spurious polling is in effect kind of thing) and turning
IRQs on/off (mostly due to locking), but the spurious irq polling part
isn't exactly convoluted. Which part do you find so convoluted? I do
agree it's somewhat complex and if you have different model in mind,
it might not match your expectations. I tried to clean it up at least
in its current structure but I could have been looking at it for a bit
too long.
WATCH shouldn't be used in normal paths because the polling code
doesn't have enough information to reduce overhead. It can only be
used in occassional events like IRQ enable, timeout detected by driver
kind of events, so WATCH case overhead doesn't really matter. Its
primary use case would be invoking it right after requesting IRQ as
USB does.
For watch only, I agree that global timer would work better.
It's just multiplexing timer. If the biggest issue is convolution in
irq_poll(), I can try to make it prettier for sure, but I guess that
discussion is for later time.
Well, it's fairly common to have tens of secs for timeouts. Even
going into minute range isn't too uncommon.
No, the goal is to use it for normal cases, so that we can provide
reasonable level of protection against occassional hiccups at fairly
low overhead. Otherwise, it wouldn't be different at all from IRQ
watching.
Yeah, that's how irq_watch is supposed to be used. irq_expect is for
cases where drivers can provide better information about when to start
and finish expecting interrupts. For these cases, we can provide
protection against occassional IRQ hiccups too. A few secs of hiccup
would be an order of magnitude better and will actually make such
failures mostly bearable.
Well, now we're talking about different problems. If it were not for
using it in normal cases, it would be better to just rip off expecting
and use watching.
Cool, I'm happy as long as you agree on that. So, here's where I'm
coming from: There are two classes of ATA bugs which have been
bothering me for quite some time now. Both are pretty cumbersome to
solve from libata proper.
The first is some ATAPI devices locking up because we use different
probing sequence than windows and other media presence polling related
issues. I think we'll need in-kernel media presence detection and
with cmwq it shouldn't be too hard to implement.
The other, as you might have expected, is these frigging IRQ issues.
There are several different patterns of failures. One is misrouting
or other persistent delivery failure. irq_watch alone should be able
to solve most part of this. Another common one is stuck IRQ line.
Cases where this condition is sporadic and transient aren't too rare,
so the updates to spurious handling. The last is occassional delivery
failures which unnecessarily lead to full blown command timeouts.
This is what irq_expect tries to work around.
After spending some time w/ ATA, what I've learned is that shit
happens no matter what and os/driver better be ready to handle them
and, for a lot of cases, the driver has enough information to be able
to work around and survive most IRQ problems.
I don't think that IRQ expect/unexpect is pushing it too far. It sure
adds some level of complexity but I don't think it is an inherently
complex thing - it could be just that my code sucks. Anyways, so
there are two things to discuss here, I guess. First, irq_expect
itself and second the implementation deatils. If you can think of
something which is simpler and achieves about the same thing, it would
great.
Thanks.
--
tejun
--