From: Thomas Graf <tgraf@suug.ch>
To: Andi Kleen <andi@firstfloor.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH] pkt_sched: Control group classifier
Date: Fri, 17 Oct 2008 22:09:16 +0200 [thread overview]
Message-ID: <20081017200916.GF20815@postel.suug.ch> (raw)
In-Reply-To: <20081017183221.GA12825@one.firstfloor.org>
* Andi Kleen <andi@firstfloor.org> 2008-10-17 20:32
> > softirq_count() simply counts the levels of bh disable.
>
> softirqs always have bh disabled. So it's always true inside them.
> And you should know what _bh locks you hold.
I actually tried "softirq_count() == SOFTIRQ_OFFSET" to see if the
call is made form user context. It works pretty well because all
callers of dev_queue_xmit() are required to disable bh. Nevertheless
I think it's quite fragile. If a dev_queue_xmit() caller from softirq
does not disable bh explicitely on its own but instead relies on
do_softirq() to have disabled bh already, the softirq count of such
a call may be equal to the one of a user context call to dev_queue_xmit().
I found explicitely counting softirq_enter() to be more reliable
without having much of a performance impact. I'm happy with both
solutions though.
next prev parent reply other threads:[~2008-10-17 20:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-13 15:57 [PATCH] pkt_sched: Control group classifier Thomas Graf
2008-10-14 11:56 ` Chei-yol Kim
2008-10-14 17:00 ` Thomas Graf
2008-10-14 17:03 ` Thomas Graf
2008-10-16 5:41 ` Andi Kleen
2008-10-17 18:23 ` Thomas Graf
2008-10-17 18:32 ` Andi Kleen
2008-10-17 20:09 ` Thomas Graf [this message]
2008-10-18 5:38 ` Andi Kleen
2008-10-19 17:00 ` Thomas Graf
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=20081017200916.GF20815@postel.suug.ch \
--to=tgraf@suug.ch \
--cc=andi@firstfloor.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).