From: Francois Romieu <romieu@fr.zoreil.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Jia-Ju Bai <baijiaju1990@gmail.com>,
nic_swsd@realtek.com, alexander.h.duyck@redhat.com,
David Miller <davem@davemloft.net>,
dhowells@redhat.com, paulmck@linux.vnet.ibm.com,
will.deacon@arm.com, netdev@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: net: r8169: a question of memory barrier in the r8169 driver
Date: Sat, 20 Jan 2018 01:00:12 +0100 [thread overview]
Message-ID: <20180120000012.GB14475@electric-eye.fr.zoreil.com> (raw)
In-Reply-To: <20180119171442.GY2228@hirez.programming.kicks-ass.net>
Peter Zijlstra <peterz@infradead.org> :
> On Fri, Jan 19, 2018 at 02:11:18AM +0100, Francois Romieu wrote:
> > Peter Zijlstra <peterz@infradead.org> :
> > [...]
> > > There is only 1 variable afaict. Memory barriers need at least 2 in
> > > order to be able to do _anything_.
> >
> > I don't get your point: why don't {cur_tx, dirty_tx} qualify as said
> > two variables ?
>
> There wasn't any cur_tx in the code you provided.
/* A skbuff with nr_frags needs nr_frags+1 entries in the tx queue */
#define TX_FRAGS_READY_FOR(tp,nr_frags) \
(TX_SLOTS_AVAIL(tp) >= (nr_frags + 1))
#define TX_SLOTS_AVAIL(tp) \
(tp->dirty_tx + NUM_TX_DESC - tp->cur_tx)
Both are also used in rtl_tx.
I don't get your point. Even a single variable is scattered through
the system.
--
Ueimor
next prev parent reply other threads:[~2018-01-20 0:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-18 14:06 net: r8169: a question of memory barrier in the r8169 driver Jia-Ju Bai
2018-01-18 15:06 ` Peter Zijlstra
2018-01-19 1:11 ` Francois Romieu
2018-01-19 17:14 ` Peter Zijlstra
2018-01-20 0:00 ` Francois Romieu [this message]
2018-01-19 1:11 ` Francois Romieu
2018-01-19 1:24 ` Jia-Ju Bai
2018-01-19 23:59 ` Francois Romieu
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=20180120000012.GB14475@electric-eye.fr.zoreil.com \
--to=romieu@fr.zoreil.com \
--cc=alexander.h.duyck@redhat.com \
--cc=baijiaju1990@gmail.com \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nic_swsd@realtek.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=will.deacon@arm.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).