From: Eric Dumazet <dada1@cosmosbay.com>
To: Tom Herbert <therbert@google.com>
Cc: netdev@vger.kernel.org
Subject: Re: Question about locks in qdisc_restart
Date: Mon, 27 Apr 2009 22:20:29 +0200 [thread overview]
Message-ID: <49F6138D.6090007@cosmosbay.com> (raw)
In-Reply-To: <65634d660904271248p133717aam55751fc435f9fd3e@mail.gmail.com>
Tom Herbert a écrit :
> In qdisc_restart the qdisc lock is released before taking the
> netif_tx_lock, and only acquired again after unlocking the
> netif_tx_lock. There's a comment with the function that
> "qdisc_lock(q) and netif_tx_lock are mutually exclusive, if one is
> grabbed, another must be free." Can anyone tell me the motivation for
> this restriction? We are seeing some performance improvements by
> holding the lock through qdisc_restart, and I'm not sure why this
> would be bad to do.
>
Well, motivation is to let other users (cpus) have a chance getting the lock :)
Do you see performance improvements too if using spin_is_contended()
to break the __qdisc_run loop ?
if (need_resched() || jiffies != start_time || spin_is_contended(qdisc_lock(q))
(And removing the unlock/lock in qdisc_restart() as you did)
prev parent reply other threads:[~2009-04-27 20:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-27 19:48 Question about locks in qdisc_restart Tom Herbert
2009-04-27 20:20 ` Eric Dumazet [this message]
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=49F6138D.6090007@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=netdev@vger.kernel.org \
--cc=therbert@google.com \
/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).