* Inline local_bh_disable when TRACE_IRQFLAGS
@ 2007-12-19 3:40 Herbert Xu
2007-12-19 11:31 ` Ingo Molnar
0 siblings, 1 reply; 4+ messages in thread
From: Herbert Xu @ 2007-12-19 3:40 UTC (permalink / raw)
To: Ingo Molnar, Linux Kernel Mailing List; +Cc: David S. Miller, netdev
Hi Ingo:
I noticed that local_bh_disable is now always out-of-line. The
change was made when TRACE_IRQFLAGS was added. However, with
TRACE_IRQFLAGS off, local_bh_disable does exactly the same work
as before. In particular, it does pretty much the same as what
preempt_disable does and the latter is always inline.
So I'm wondering if it would be reasonable to make it out-of-line
when TRACE_IRQFLAGS is off. This may make a difference because
the networking stack is a frequent user of local_bh_disable and
local_bh_enable.
Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Inline local_bh_disable when TRACE_IRQFLAGS
2007-12-19 3:40 Inline local_bh_disable when TRACE_IRQFLAGS Herbert Xu
@ 2007-12-19 11:31 ` Ingo Molnar
2007-12-19 11:50 ` Herbert Xu
0 siblings, 1 reply; 4+ messages in thread
From: Ingo Molnar @ 2007-12-19 11:31 UTC (permalink / raw)
To: Herbert Xu; +Cc: Linux Kernel Mailing List, David S. Miller, netdev
* Herbert Xu <herbert@gondor.apana.org.au> wrote:
> Hi Ingo:
>
> I noticed that local_bh_disable is now always out-of-line. The change
> was made when TRACE_IRQFLAGS was added. However, with TRACE_IRQFLAGS
> off, local_bh_disable does exactly the same work as before. In
> particular, it does pretty much the same as what preempt_disable does
> and the latter is always inline.
>
> So I'm wondering if it would be reasonable to make it out-of-line when
> TRACE_IRQFLAGS is off. This may make a difference because the
> networking stack is a frequent user of local_bh_disable and
> local_bh_enable.
do you mean to make it inline again?
(btw., generally i think local_bh_disable() is a poor API because it is
opaque about the data structure dependency that it governs. Explicit
exclusion rules generally work better.)
Ingo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Inline local_bh_disable when TRACE_IRQFLAGS
2007-12-19 11:31 ` Ingo Molnar
@ 2007-12-19 11:50 ` Herbert Xu
2007-12-19 14:03 ` Ingo Molnar
0 siblings, 1 reply; 4+ messages in thread
From: Herbert Xu @ 2007-12-19 11:50 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Linux Kernel Mailing List, David S. Miller, netdev
On Wed, Dec 19, 2007 at 12:31:52PM +0100, Ingo Molnar wrote:
>
> > So I'm wondering if it would be reasonable to make it out-of-line when
> > TRACE_IRQFLAGS is off. This may make a difference because the
> > networking stack is a frequent user of local_bh_disable and
> > local_bh_enable.
>
> do you mean to make it inline again?
Yes I meant in-line :)
> (btw., generally i think local_bh_disable() is a poor API because it is
> opaque about the data structure dependency that it governs. Explicit
> exclusion rules generally work better.)
I see where you're coming from especially with your preemptible
softirq work. However I'm mostly thinking about the existing
callers of local_bh_disable in the networking stack.
Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Inline local_bh_disable when TRACE_IRQFLAGS
2007-12-19 11:50 ` Herbert Xu
@ 2007-12-19 14:03 ` Ingo Molnar
0 siblings, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2007-12-19 14:03 UTC (permalink / raw)
To: Herbert Xu; +Cc: Linux Kernel Mailing List, David S. Miller, netdev
* Herbert Xu <herbert@gondor.apana.org.au> wrote:
> On Wed, Dec 19, 2007 at 12:31:52PM +0100, Ingo Molnar wrote:
> >
> > > So I'm wondering if it would be reasonable to make it out-of-line
> > > when TRACE_IRQFLAGS is off. This may make a difference because
> > > the networking stack is a frequent user of local_bh_disable and
> > > local_bh_enable.
> >
> > do you mean to make it inline again?
>
> Yes I meant in-line :)
if that decreases code size then i guess we could do that.
> > (btw., generally i think local_bh_disable() is a poor API because it
> > is opaque about the data structure dependency that it governs.
> > Explicit exclusion rules generally work better.)
>
> I see where you're coming from especially with your preemptible
> softirq work. However I'm mostly thinking about the existing callers
> of local_bh_disable in the networking stack.
yeah, i was just commenting on the general concept of 'naked'
local_bh_disable(). And just to make it clear: with that i'm not
implying anything about the quality of the networking code - networking
is one of the cleanest [if not the cleanest] subsystems in the kernel.
It's just that it's long term more useful for us if our "global scope"
APIs have direct, programmatic relationship to the data structures /
data flow they control. So i'd love to have the same flow/performance,
just coded a bit more explicitly. [preempt_disable() for example has
similar issues.]
Ingo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-12-19 14:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-19 3:40 Inline local_bh_disable when TRACE_IRQFLAGS Herbert Xu
2007-12-19 11:31 ` Ingo Molnar
2007-12-19 11:50 ` Herbert Xu
2007-12-19 14:03 ` Ingo Molnar
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).