Skip to content

Commit

Permalink
[I/OAT]: Remove CPU hotplug lock from net_dma_rebalance
Browse files Browse the repository at this point in the history
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: Chris Leech <christopher.leech@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Chris Leech authored and David S. Miller committed Aug 2, 2006
1 parent 9bbf28a commit e6eb307
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -3419,12 +3419,9 @@ static void net_dma_rebalance(void)
unsigned int cpu, i, n;
struct dma_chan *chan;

lock_cpu_hotplug();

if (net_dma_count == 0) {
for_each_online_cpu(cpu)
rcu_assign_pointer(per_cpu(softnet_data.net_dma, cpu), NULL);
unlock_cpu_hotplug();
return;
}

Expand All @@ -3444,8 +3441,6 @@ static void net_dma_rebalance(void)
i++;
}
rcu_read_unlock();

unlock_cpu_hotplug();
}

/**
Expand Down

0 comments on commit e6eb307

Please sign in to comment.