Re: local_irq_save()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/24/07, Rajat Jain <rajat.noida.india@xxxxxxxxx> wrote:
On 4/23/07, pradeep singh <2500.pradeep@xxxxxxxxx> wrote:
> On 4/23/07, Mukund JB. <mukundjb@xxxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > > On 4/23/07, Guennadi Liakhovetski <gl@xxxxxxxxx> wrote:
> > > > On Mon, 23 Apr 2007, pradeep singh wrote:
> > > >
> > > > > On 4/23/07, Guennadi Liakhovetski <gl@xxxxxxxxx> wrote:
> > > > > >
> > > > > > This cannot be true. Lost interrupts are bad, and you'd get them
> > all
> > > the
> > > > > > time, so, nothing would work.
> > > > > Right.That clears a lot of doubts.
> > > > > But all the interrupts in the mean time are taken care by the PIC
> > only
> > > > > AFAIK.Am i right? The moment CPU is ready to accept the interrupts
> > > > > again on the line, the inetrrupts are served.
> > > >
> > > > Yes, as long as these are different interrupts.
> > > Means the interrupt disabled using local_irq_save() if received in
> > > this period of time will be kind of buffered by the PIC only and only
> > > will be delivered to the CPU the moment interrupt is enabled
> > > again.Right? I am a little confused.Can you please help?
> >
> > AFAIK When you disable using local_irq_save(), the PIC interrupt lines
> > going to the CPU will be copied to the flags variable and all interrupts
> > on that CPU will be disabled.
> Only the maskable interrupts i guess.
> >
> > When you again use restore call, the flags variables which was earlier
> > saved in call to local_irq_save() will be restored.
> Yes, agreed.
> >
> > >
> > > What would happen if the same interrupt which was disabled using
> > > local_irq_save() is recieved again before local_irq_restore()?
> > > It will be buffered at the PIC only, right? Or is it that it will be
> > > served?Just like any interrupt on other lines?
> >
> > Lets say you were trying to hold Interrupt 9, and even if you receive
> > any multiple interrupts before call to local_irq_restore(), the old
> > value saved at local_irq_save() call will only be restored. So, NO new
> > PIC vales will be reflected on the CPU after call to
> > local_irq_restore().
> So you are saying they are lost???
>


If you disable an interrupt across all CPUs using disable_irq(), then
the IRQ is disabled at the PCI level. And hence if the hardware tries
to generate
an interrupt while interrupts are disabled, the interrupt is lost forever.

I guess you mean local_disable_irq()? I cannot find a single
invocation of disable_irq() in my src. As i see it, it would be stupid
to disable interrupts on all the CPUs.What can be possible use of such
a futile thing?


But if you try local_irq_save(), interrupts are disabled only on the
local processor. And any interrupts that arrive will be routed to
other processors in the system. Hence they won't be missed.

Yes, but what I mean is a uniprocessor and not a multiprocessor system.


What remains is a scenario where local_irq_save() is used on a
uniprocessor machine. In such a case, AFAIK, the interrupt will be
buffered in PIC till the interrupts are enabled again at the CPU.
However, if the same IRQ is generated multiple times while the IRQ is
disabled on the CPU, only one instance is delivered to the processor
and the rest get lost.

Ok.

Thank you
~psr


Thanks,

Rajat



--
play the game

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux