* Re: RE: [PATCH] qe_ic: Do a sync when masking interrupts.
@ 2006-10-23 15:30 Michael R. Zucca
2006-10-23 16:49 ` Segher Boessenkool
0 siblings, 1 reply; 8+ messages in thread
From: Michael R. Zucca @ 2006-10-23 15:30 UTC (permalink / raw)
To: Li Yang-r58472, Paul Mackerras, Wood Scott-B07421; +Cc: linuxppc-dev
>From: Li Yang-r58472 <LeoLi@freescale.com>
>
>But an i/o read will be considerably slower than a sync, and it is in
>the critical path of interrupt. I have tested the patch under
>relatively heavy Ethernet load, and there is no spurious interrupt.
>Maybe it is because the device is an SOC device and MMIO store completes
>faster. I'm wondering if there is a standard test method to show if the
>faster approach is sufficient or not.
All a sync tells you is that an I/O made it out of the CPU. The problem is, there may be other places a write could get hung up. For instance, sometimes devices sit behind a bridge with a write FIFO. In such a scenario, you can't be sure a write has made it to the device until you do a read to flush the FIFO.
If you're trying to figure out the minimum thing to do (eieio, sync, read-back, etc.) you have to understand what your system is doing between the store and the bits going into the register.
It may be that a sync is enough, but you won't know until you fully understand the system's bus/bridge topolgy between the CPU and the device.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] qe_ic: Do a sync when masking interrupts.
2006-10-23 15:30 RE: [PATCH] qe_ic: Do a sync when masking interrupts Michael R. Zucca
@ 2006-10-23 16:49 ` Segher Boessenkool
2006-10-23 18:27 ` Scott Wood
0 siblings, 1 reply; 8+ messages in thread
From: Segher Boessenkool @ 2006-10-23 16:49 UTC (permalink / raw)
To: mrz5149; +Cc: linuxppc-dev, Paul Mackerras
> ll a sync tells you is that an I/O made it out of the CPU. The
> problem is, there may be other places a write could get hung up.
> For instance, sometimes devices sit behind a bridge with a write
> FIFO. In such a scenario, you can't be sure a write has made it to
> the device until you do a read to flush the FIFO.
It's not enough that a write made it to the device even -- you
have to make sure the device has acted on it.
> If you're trying to figure out the minimum thing to do (eieio,
> sync, read-back, etc.) you have to understand what your system is
> doing between the store and the bits going into the register.
What the system is doing, and also what exactly you want to
accomplish (what ordering and what completion you depend on).
> It may be that a sync is enough, but you won't know until you fully
> understand the system's bus/bridge topolgy between the CPU and the
> device.
If a sync after an MMIO write is enough, then (in almost all
cases) so is an eieio.
Segher
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] qe_ic: Do a sync when masking interrupts.
2006-10-23 16:49 ` Segher Boessenkool
@ 2006-10-23 18:27 ` Scott Wood
2006-10-23 18:46 ` Segher Boessenkool
2006-10-24 7:17 ` Li Yang-r58472
0 siblings, 2 replies; 8+ messages in thread
From: Scott Wood @ 2006-10-23 18:27 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: Paul Mackerras, linuxppc-dev
Segher Boessenkool wrote:
> If a sync after an MMIO write is enough, then (in almost all
> cases) so is an eieio.
In this case, the spurious interrupts still happen with eieio, but not
with sync. It's probably synchronizing the MMIO write with some
unrelated load from memory (such as reading the stack frame to return
from the mask function, or reading action->flags to determine whether to
check for IRQ_DISABLED).
-Scott
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] qe_ic: Do a sync when masking interrupts.
2006-10-23 18:27 ` Scott Wood
@ 2006-10-23 18:46 ` Segher Boessenkool
2006-10-24 7:17 ` Li Yang-r58472
1 sibling, 0 replies; 8+ messages in thread
From: Segher Boessenkool @ 2006-10-23 18:46 UTC (permalink / raw)
To: Scott Wood; +Cc: Paul Mackerras, linuxppc-dev
>> If a sync after an MMIO write is enough, then (in almost all
>> cases) so is an eieio.
>
> In this case, the spurious interrupts still happen with eieio, but
> not with sync. It's probably synchronizing the MMIO write with
> some unrelated load from memory (such as reading the stack frame to
> return from the mask function, or reading action->flags to
> determine whether to check for IRQ_DISABLED).
Yes, it sure sounds like the only reason the sync insn helps
is that it causes a (small) delay. If you document this (and
also that it isn't required for correctness) in the code, I
don't think anyone will complain / be curious about it anymore.
Segher
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH] qe_ic: Do a sync when masking interrupts.
2006-10-23 18:27 ` Scott Wood
2006-10-23 18:46 ` Segher Boessenkool
@ 2006-10-24 7:17 ` Li Yang-r58472
2006-10-25 3:51 ` Benjamin Herrenschmidt
1 sibling, 1 reply; 8+ messages in thread
From: Li Yang-r58472 @ 2006-10-24 7:17 UTC (permalink / raw)
To: Wood Scott-B07421, Segher Boessenkool; +Cc: Paul Mackerras, linuxppc-dev
> -----Original Message-----
> From: Scott Wood [mailto:scottwood@freescale.com]
> Sent: Tuesday, October 24, 2006 2:27 AM
> To: Segher Boessenkool
> Cc: mrz5149@acm.org; Li Yang-r58472; Paul Mackerras;
linuxppc-dev@ozlabs.org
> Subject: Re: [PATCH] qe_ic: Do a sync when masking interrupts.
>=20
> Segher Boessenkool wrote:
> > If a sync after an MMIO write is enough, then (in almost all
> > cases) so is an eieio.
>=20
> In this case, the spurious interrupts still happen with eieio, but not
> with sync. =20
eieio on e300 core is just a no-op.
- Leo
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH] qe_ic: Do a sync when masking interrupts.
2006-10-24 7:17 ` Li Yang-r58472
@ 2006-10-25 3:51 ` Benjamin Herrenschmidt
2006-10-25 4:47 ` Liu Dave-r63238
0 siblings, 1 reply; 8+ messages in thread
From: Benjamin Herrenschmidt @ 2006-10-25 3:51 UTC (permalink / raw)
To: Li Yang-r58472; +Cc: linuxppc-dev, Paul Mackerras
On Tue, 2006-10-24 at 15:17 +0800, Li Yang-r58472 wrote:
> > -----Original Message-----
> > From: Scott Wood [mailto:scottwood@freescale.com]
> > Sent: Tuesday, October 24, 2006 2:27 AM
> > To: Segher Boessenkool
> > Cc: mrz5149@acm.org; Li Yang-r58472; Paul Mackerras;
> linuxppc-dev@ozlabs.org
> > Subject: Re: [PATCH] qe_ic: Do a sync when masking interrupts.
> >
> > Segher Boessenkool wrote:
> > > If a sync after an MMIO write is enough, then (in almost all
> > > cases) so is an eieio.
> >
> > In this case, the spurious interrupts still happen with eieio, but not
> > with sync.
>
> eieio on e300 core is just a no-op.
It's not sent to the bus on non-cahed storage (like the PCI bridge ?)
That's pretty bad ... there is quite a bit of code that assumes that
eieio's will prevent write combining...
Ben.
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH] qe_ic: Do a sync when masking interrupts.
2006-10-25 3:51 ` Benjamin Herrenschmidt
@ 2006-10-25 4:47 ` Liu Dave-r63238
0 siblings, 0 replies; 8+ messages in thread
From: Liu Dave-r63238 @ 2006-10-25 4:47 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Li Yang-r58472; +Cc: linuxppc-dev, Paul Mackerras
> > > Segher Boessenkool wrote:
> > > > If a sync after an MMIO write is enough, then (in almost all
> > > > cases) so is an eieio.
> > >=20
> > > In this case, the spurious interrupts still happen with=20
> eieio, but=20
> > > not with sync.
> >=20
> > eieio on e300 core is just a no-op.
>=20
> It's not sent to the bus on non-cahed storage (like the PCI=20
> bridge ?) That's pretty bad ... there is quite a bit of code=20
> that assumes that eieio's will prevent write combining...
Due to the LSU, the e300 cored doesn't reorder non-cached
stroage, and doesn't implementation of write commbining.
So, actually its behavior likes eieio.
-Dave
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: RE: [PATCH] qe_ic: Do a sync when masking interrupts.
@ 2006-10-23 15:32 Michael R. Zucca
0 siblings, 0 replies; 8+ messages in thread
From: Michael R. Zucca @ 2006-10-23 15:32 UTC (permalink / raw)
To: Li Yang-r58472, Paul Mackerras, Wood Scott-B07421; +Cc: linuxppc-dev
>From: Li Yang-r58472 <LeoLi@freescale.com>
>
>But an i/o read will be considerably slower than a sync, and it is in
>the critical path of interrupt. I have tested the patch under
>relatively heavy Ethernet load, and there is no spurious interrupt.
>Maybe it is because the device is an SOC device and MMIO store completes
>faster. I'm wondering if there is a standard test method to show if the
>faster approach is sufficient or not.
All a sync tells you is that an I/O made it out of the CPU. The problem is, there may be other places a write could get hung up. For instance, sometimes devices sit behind a bridge with a write FIFO. In such a scenario, you can't be sure a write has made it to the device until you do a read to flush the FIFO.
If you're trying to figure out the minimum thing to do (eieio, sync, read-back, etc.) you have to understand what your system is doing between the store and the bits going into the register.
It may be that a sync is enough, but you won't know until you fully understand the system's bus/bridge topolgy between the CPU and the device.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2006-10-25 4:47 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-23 15:30 RE: [PATCH] qe_ic: Do a sync when masking interrupts Michael R. Zucca
2006-10-23 16:49 ` Segher Boessenkool
2006-10-23 18:27 ` Scott Wood
2006-10-23 18:46 ` Segher Boessenkool
2006-10-24 7:17 ` Li Yang-r58472
2006-10-25 3:51 ` Benjamin Herrenschmidt
2006-10-25 4:47 ` Liu Dave-r63238
-- strict thread matches above, loose matches on Subject: below --
2006-10-23 15:32 Michael R. Zucca
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).