From: Eric Dumazet <eric.dumazet@gmail.com>
To: Kirill Tkhai <ktkhai@virtuozzo.com>,
alexandre.besnard@softathome.com, davem@davemloft.net,
ecree@solarflare.com, jiri@mellanox.com, petrm@mellanox.com,
alexander.h.duyck@intel.com, amritha.nambiar@intel.com,
lirongqing@baidu.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: check negative value for signed refcnt
Date: Thu, 31 Jan 2019 07:15:53 -0800 [thread overview]
Message-ID: <7bc31b61-8852-88a7-12bf-494c0e54574b@gmail.com> (raw)
In-Reply-To: <8b654b17-f8b4-0c89-26b5-311aeb703f6d@virtuozzo.com>
On 01/31/2019 05:49 AM, Kirill Tkhai wrote:
>
> 2)Not related to your patch -- it looks like we have problem in existing
> code with this netdev_refcnt_read(). It does not imply a memory ordering
> or some guarantees about reading percpu values. For example, in generic
> code struct percpu_ref switches a counter into atomic mode before it checks
> for the last reference. But there is nothing in netdev_refcnt_read().
Well, if we read an old value here, after a full and expensive synchronize_net(),
then we would have lot more problems than simply having a second round in
netdev_wait_allrefs()
next prev parent reply other threads:[~2019-01-31 15:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-31 13:20 [PATCH] net: check negative value for signed refcnt alexandre.besnard
2019-01-31 13:49 ` Kirill Tkhai
2019-01-31 15:14 ` Alexandre BESNARD
2019-01-31 15:31 ` Kirill Tkhai
2019-01-31 15:15 ` Eric Dumazet [this message]
2019-01-31 15:21 ` Eric Dumazet
2019-01-31 15:34 ` Kirill Tkhai
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=7bc31b61-8852-88a7-12bf-494c0e54574b@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=alexander.h.duyck@intel.com \
--cc=alexandre.besnard@softathome.com \
--cc=amritha.nambiar@intel.com \
--cc=davem@davemloft.net \
--cc=ecree@solarflare.com \
--cc=jiri@mellanox.com \
--cc=ktkhai@virtuozzo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lirongqing@baidu.com \
--cc=netdev@vger.kernel.org \
--cc=petrm@mellanox.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).