mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Chris Leech" <christopher.leech@intel.com>
To: "David Miller" <davem@davemloft.net>
Cc: dan.j.williams@intel.com, linux-kernel@vger.kernel.org,
	neilb@suse.de, galak@kernel.crashing.org,
	alan@lxorguk.ukuu.org.uk
Subject: [PATCH] I/OAT: remove CPU hotplug lock from net_dma_rebalance
Date: Tue, 1 Aug 2006 11:33:02 -0700	[thread overview]
Message-ID: <41b516cb0608011133r2332161dx4b43a845bfa74062@mail.gmail.com> (raw)

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();
 }

 /**

             reply	other threads:[~2006-08-01 18:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-01 18:33 Chris Leech [this message]
2006-08-02 21:20 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41b516cb0608011133r2332161dx4b43a845bfa74062@mail.gmail.com \
    --to=christopher.leech@intel.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=chris.leech@gmail.com \
    --cc=dan.j.williams@intel.com \
    --cc=davem@davemloft.net \
    --cc=galak@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®