提交 7f08ec6e 编写于 作者: A Antoine Tenart 提交者: David S. Miller

net-sysfs: remove possible sleep from an RCU read-side critical section

xps_queue_show is mostly made of an RCU read-side critical section and
calls bitmap_zalloc with GFP_KERNEL in the middle of it. That is not
allowed as this call may sleep and such behaviours aren't allowed in RCU
read-side critical sections. Fix this by using GFP_NOWAIT instead.

Fixes: 5478fcd0 ("net: embed nr_ids in the xps maps")
Reported-by: Nkernel test robot <oliver.sang@intel.com>
Suggested-by: NMatthew Wilcox <willy@infradead.org>
Signed-off-by: NAntoine Tenart <atenart@kernel.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 7ec05a60
...@@ -1378,7 +1378,7 @@ static ssize_t xps_queue_show(struct net_device *dev, unsigned int index, ...@@ -1378,7 +1378,7 @@ static ssize_t xps_queue_show(struct net_device *dev, unsigned int index,
nr_ids = dev_maps ? dev_maps->nr_ids : nr_ids = dev_maps ? dev_maps->nr_ids :
(type == XPS_CPUS ? nr_cpu_ids : dev->num_rx_queues); (type == XPS_CPUS ? nr_cpu_ids : dev->num_rx_queues);
mask = bitmap_zalloc(nr_ids, GFP_KERNEL); mask = bitmap_zalloc(nr_ids, GFP_NOWAIT);
if (!mask) { if (!mask) {
rcu_read_unlock(); rcu_read_unlock();
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册