Commit e6eb307d authored by Chris Leech's avatar Chris Leech Committed by David S. Miller

[I/OAT]: Remove CPU hotplug lock from net_dma_rebalance

Remove the lock_cpu_hotplug()/unlock_cpu_hotplug() calls from
net_dma_rebalance

The lock_cpu_hotplug()/unlock_cpu_hotplug() sequence in
net_dma_rebalance is both incorrect (as pointed out by David Miller)
because lock_cpu_hotplug() may sleep while the net_dma_event_lock
spinlock is held, and unnecessary (as pointed out by Andrew Morton) as
spin_lock() disables preemption which protects from CPU hotplug
events.
Signed-off-by: default avatarChris Leech <christopher.leech@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9bbf28a1
...@@ -3419,12 +3419,9 @@ static void net_dma_rebalance(void) ...@@ -3419,12 +3419,9 @@ static void net_dma_rebalance(void)
unsigned int cpu, i, n; unsigned int cpu, i, n;
struct dma_chan *chan; struct dma_chan *chan;
lock_cpu_hotplug();
if (net_dma_count == 0) { if (net_dma_count == 0) {
for_each_online_cpu(cpu) for_each_online_cpu(cpu)
rcu_assign_pointer(per_cpu(softnet_data.net_dma, cpu), NULL); rcu_assign_pointer(per_cpu(softnet_data.net_dma, cpu), NULL);
unlock_cpu_hotplug();
return; return;
} }
...@@ -3444,8 +3441,6 @@ static void net_dma_rebalance(void) ...@@ -3444,8 +3441,6 @@ static void net_dma_rebalance(void)
i++; i++;
} }
rcu_read_unlock(); rcu_read_unlock();
unlock_cpu_hotplug();
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment