提交 b55071eb 编写于 作者: L Lai Jiangshan 提交者: Paul E. McKenney

net,rcu: convert call_rcu(xps_dev_maps_release) to kfree_rcu()

The rcu callback xps_dev_maps_release() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(xps_dev_maps_release).
Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: NJosh Triplett <josh@joshtriplett.org>
上级 edc86d8a
...@@ -891,14 +891,6 @@ static ssize_t show_xps_map(struct netdev_queue *queue, ...@@ -891,14 +891,6 @@ static ssize_t show_xps_map(struct netdev_queue *queue,
return len; return len;
} }
static void xps_dev_maps_release(struct rcu_head *rcu)
{
struct xps_dev_maps *dev_maps =
container_of(rcu, struct xps_dev_maps, rcu);
kfree(dev_maps);
}
static DEFINE_MUTEX(xps_map_mutex); static DEFINE_MUTEX(xps_map_mutex);
#define xmap_dereference(P) \ #define xmap_dereference(P) \
rcu_dereference_protected((P), lockdep_is_held(&xps_map_mutex)) rcu_dereference_protected((P), lockdep_is_held(&xps_map_mutex))
...@@ -1008,7 +1000,7 @@ static ssize_t store_xps_map(struct netdev_queue *queue, ...@@ -1008,7 +1000,7 @@ static ssize_t store_xps_map(struct netdev_queue *queue,
} }
if (dev_maps) if (dev_maps)
call_rcu(&dev_maps->rcu, xps_dev_maps_release); kfree_rcu(dev_maps, rcu);
netdev_queue_numa_node_write(queue, (numa_node >= 0) ? numa_node : netdev_queue_numa_node_write(queue, (numa_node >= 0) ? numa_node :
NUMA_NO_NODE); NUMA_NO_NODE);
...@@ -1080,7 +1072,7 @@ static void netdev_queue_release(struct kobject *kobj) ...@@ -1080,7 +1072,7 @@ static void netdev_queue_release(struct kobject *kobj)
if (!nonempty) { if (!nonempty) {
RCU_INIT_POINTER(dev->xps_maps, NULL); RCU_INIT_POINTER(dev->xps_maps, NULL);
call_rcu(&dev_maps->rcu, xps_dev_maps_release); kfree_rcu(dev_maps, rcu);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册