From: Don Provan <dprovan@bivio.net>
To: "Richardson, Bruce" <bruce.richardson@intel.com>,
Neil Horman <nhorman@tuxdriver.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] mbuf: add comment explaining confusing code
Date: Mon, 30 Mar 2015 17:39:06 +0000 [thread overview]
Message-ID: <CY1PR0101MB098798EEE9925C308B388CCDA0F50@CY1PR0101MB0987.prod.exchangelabs.com> (raw)
In-Reply-To: <59AF69C657FD0841A61C55336867B5B0344F112F@IRSMSX103.ger.corp.intel.com>
> > > > > > > > if (likely (rte_mbuf_refcnt_read(m) == 1) ||
> > > > > > > > likely (rte_mbuf_refcnt_update(m, -1) == 0))
In all the debate about atomics, I don't think anyone got around to pointing out that in the unlikely case that the refcnt is not 1, then it's equally unlikely that decrementing it will result in 0 despite the code's claim to the contrary. That's the part that confused me. Would it make sense to fix this while adding the comment?
-don
dprovan@bivio.net
next prev parent reply other threads:[~2015-03-30 17:39 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-26 21:14 Bruce Richardson
2015-03-26 21:31 ` Olivier MATZ
2015-03-27 10:29 ` Neil Horman
2015-03-27 10:49 ` Ananyev, Konstantin
2015-03-27 11:32 ` Bruce Richardson
2015-03-27 12:42 ` Neil Horman
2015-03-27 14:07 ` Neil Horman
2015-03-27 14:30 ` Bruce Richardson
2015-03-27 14:38 ` Neil Horman
2015-03-27 14:55 ` Bruce Richardson
2015-03-27 16:43 ` Neil Horman
2015-03-27 16:56 ` Richardson, Bruce
2015-03-30 17:11 ` Thomas Monjalon
2015-03-30 17:39 ` Don Provan [this message]
2015-03-30 18:15 ` Stephen Hemminger
2015-03-31 12:33 ` Zoltan Kiss
2015-03-30 19:39 ` Marc Sune
2015-03-30 20:26 ` Neil Horman
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=CY1PR0101MB098798EEE9925C308B388CCDA0F50@CY1PR0101MB0987.prod.exchangelabs.com \
--to=dprovan@bivio.net \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=nhorman@tuxdriver.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).