[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220819170301.43675f1a@kernel.org>
Date: Fri, 19 Aug 2022 17:03:01 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Kuniyuki Iwashima <kuniyu@...zon.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
Kuniyuki Iwashima <kuni1840@...il.com>,
<netdev@...r.kernel.org>,
Matthias Tafelmeier <matthias.tafelmeier@....net>
Subject: Re: [PATCH v3 net 02/17] net: Fix data-races around weight_p and
dev_weight_[rt]x_bias.
On Thu, 18 Aug 2022 11:26:38 -0700 Kuniyuki Iwashima wrote:
> - dev_rx_weight = weight_p * dev_weight_rx_bias;
> - dev_tx_weight = weight_p * dev_weight_tx_bias;
> + WRITE_ONCE(dev_rx_weight,
> + READ_ONCE(weight_p) * READ_ONCE(dev_weight_rx_bias));
> + WRITE_ONCE(dev_tx_weight,
> + READ_ONCE(weight_p) * READ_ONCE(dev_weight_tx_bias));
Is there some locking on procfs writes? Otherwise one interrupted write
may get overtaken by another and we'll end up with inconsistent values.
OTOH if there is some locking we shouldn't have to protect weight_p
here.
Powered by blists - more mailing lists