Thread (7 messages) flat view 7 messages, 3 authors, 2021-03-22

Re: [PATCH net-next] net-sysfs: remove possible sleep from an RCU read-side critical section

From: Matthew Wilcox <willy@infradead.org>
Date: 2021-03-22 17:45:56

On Mon, Mar 22, 2021 at 06:41:30PM +0100, Antoine Tenart wrote:
Quoting Matthew Wilcox (2021-03-22 17:54:39)
quoted
-       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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help