[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <161643536180.6320.4308324155205704739@kwain.local>
Date: Mon, 22 Mar 2021 18:49:21 +0100
From: Antoine Tenart <atenart@...nel.org>
To: Matthew Wilcox <willy@...radead.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
Quoting Matthew Wilcox (2021-03-22 18:44:21)
> 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.
All right. Thanks for the suggestions anyway!
Antoine
Powered by blists - more mailing lists