[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210322174421.GT1719932@casper.infradead.org>
Date: Mon, 22 Mar 2021 17:44:21 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Antoine Tenart <atenart@...nel.org>
Cc: davem@...emloft.net, kuba@...nel.org, alexander.duyck@...il.com,
netdev@...r.kernel.org, kernel test robot <oliver.sang@...el.com>
Subject: Re: [PATCH net-next] net-sysfs: remove possible sleep from an RCU
read-side critical section
On Mon, Mar 22, 2021 at 06:41:30PM +0100, Antoine Tenart wrote:
> Quoting Matthew Wilcox (2021-03-22 17:54:39)
> > - rcu_read_lock();
> > - dev_maps = rcu_dereference(dev->xps_maps[type]);
> > + dev_maps = READ_ONCE(dev->xps_maps[type]);
>
> Couldn't dev_maps be freed between here and the read of dev_maps->nr_ids
> as we're not in an RCU read-side critical section?
Oh, good point. Never mind, then.
> My feeling is there is not much value in having a tricky allocation
> logic for reads from xps_cpus and xps_rxqs. While we could come up with
> something, returning -ENOMEM on memory pressure should be fine.
That's fine. It's your code, and this is probably a small allocation
anyway.
Powered by blists - more mailing lists