From: Michael Neuling <mikey@neuling.org>
To: Thomas Klein <tklein@de.ibm.com>,
Jan-Bernd Themann <themann@de.ibm.com>,
netdev <netdev@vger.kernel.org>,
Christoph Raisch <raisch@de.ibm.com>,
Stefan Roscher <ossrosch@linux.vnet.ibm.com>,
linux-ppc <linuxppc-dev@ozlabs.org>
Cc: anton@samba.org
Subject: Possible eHEA performance issue
Date: Thu, 19 Jul 2007 20:02:04 -0700 [thread overview]
Message-ID: <4634.1184900524@neuling.org> (raw)
>From ehea_start_xmit in ehea_main.c we have:
if (unlikely(atomic_read(&pr->swqe_avail) <= 1)) {
spin_lock_irqsave(&pr->netif_queue, flags);
if (unlikely(atomic_read(&pr->swqe_avail) <= 1)) {
pr->p_stats.queue_stopped++;
netif_stop_queue(dev);
pr->queue_stopped = 1;
}
spin_unlock_irqrestore(&pr->netif_queue, flags);
}
Since the conditions are the same, isn't it likely that the second 'if'
is going to be taken. Hence, shouldn't the second 'unlikely' hint be
removed or even changed to likely?
Either way, some documentation here as to why it's done this way would
be useful. I assume the atomic_read is cheap compared to the
spin_unlock_irqsave, so we quickly check swqe_avail before we check it
again properly with the lock on so we can change some stuff.
Mikey
next reply other threads:[~2007-07-20 3:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-20 3:02 Michael Neuling [this message]
2007-07-20 8:17 ` Possible eHEA performance issue Thomas Klein
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=4634.1184900524@neuling.org \
--to=mikey@neuling.org \
--cc=anton@samba.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=netdev@vger.kernel.org \
--cc=ossrosch@linux.vnet.ibm.com \
--cc=raisch@de.ibm.com \
--cc=themann@de.ibm.com \
--cc=tklein@de.ibm.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).