mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] I/OAT: remove CPU hotplug lock from net_dma_rebalance
@ 2006-08-01 18:33 Chris Leech
  2006-08-02 21:20 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Leech @ 2006-08-01 18:33 UTC (permalink / raw)
  To: David Miller; +Cc: dan.j.williams, linux-kernel, neilb, galak, alan

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>
---

  net/core/dev.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 4d2b516..780d770 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3429,12 +3429,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;
        }

@@ -3454,8 +3451,6 @@ static void net_dma_rebalance(void)
                i++;
        }
        rcu_read_unlock();
-
-       unlock_cpu_hotplug();
 }

 /**

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] I/OAT: remove CPU hotplug lock from net_dma_rebalance
  2006-08-01 18:33 [PATCH] I/OAT: remove CPU hotplug lock from net_dma_rebalance Chris Leech
@ 2006-08-02 21:20 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2006-08-02 21:20 UTC (permalink / raw)
  To: chris.leech, christopher.leech
  Cc: dan.j.williams, linux-kernel, neilb, galak, alan

From: "Chris Leech" <christopher.leech@intel.com>
Date: Tue, 1 Aug 2006 11:33:02 -0700

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

Why is proper patch submission so damn difficult for people?
This patch is corrupted severely.

I'm fixing this up since it's such an obvious patch, but this
issue is getting really rediculious.  I can't believe how many
people submit line-wrapped, tab destroyed, patches these days.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-08-02 21:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-01 18:33 [PATCH] I/OAT: remove CPU hotplug lock from net_dma_rebalance Chris Leech
2006-08-02 21:20 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®