[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-fd7355ba1e936487f5aae6fc058c6cb300e44a64@git.kernel.org>
Date: Mon, 27 Jun 2011 23:16:06 GMT
From: tip-bot for Tejun Heo <tj@...nel.org>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
a.p.zijlstra@...llo.nl, torvalds@...ux-foundation.org,
akpm@...ux-foundation.org, tj@...nel.org,
suresh.b.siddha@...el.com, tglx@...utronix.de, hpa@...ux.intel.com,
mingo@...e.hu
Subject: [tip:x86/mtrr] stop_machine: reorganize stop_cpus() implementation
Commit-ID: fd7355ba1e936487f5aae6fc058c6cb300e44a64
Gitweb: http://git.kernel.org/tip/fd7355ba1e936487f5aae6fc058c6cb300e44a64
Author: Tejun Heo <tj@...nel.org>
AuthorDate: Thu, 23 Jun 2011 11:19:27 -0700
Committer: H. Peter Anvin <hpa@...ux.intel.com>
CommitDate: Mon, 27 Jun 2011 15:17:07 -0700
stop_machine: reorganize stop_cpus() implementation
Refactor the queuing part of the stop cpus work from __stop_cpus() into
queue_stop_cpus_work().
The reorganization is to help future improvements to stop_machine()
and doesn't introduce any behavior difference.
Signed-off-by: Tejun Heo <tj@...nel.org>
Link: http://lkml.kernel.org/r/20110623182056.897818337@sbsiddha-MOBL3.sc.intel.com
Signed-off-by: Suresh Siddha <suresh.b.siddha@...el.com>
Cc: Ingo Molnar <mingo@...e.hu>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Signed-off-by: H. Peter Anvin <hpa@...ux.intel.com>
---
kernel/stop_machine.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
index 0cae1cc..4c89ee9 100644
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
@@ -136,10 +136,11 @@ DEFINE_MUTEX(stop_cpus_mutex);
/* static data for stop_cpus */
static DEFINE_PER_CPU(struct cpu_stop_work, stop_cpus_work);
-int __stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg)
+static void queue_stop_cpus_work(const struct cpumask *cpumask,
+ cpu_stop_fn_t fn, void *arg,
+ struct cpu_stop_done *done)
{
struct cpu_stop_work *work;
- struct cpu_stop_done done;
unsigned int cpu;
/* initialize works and done */
@@ -147,9 +148,8 @@ int __stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg)
work = &per_cpu(stop_cpus_work, cpu);
work->fn = fn;
work->arg = arg;
- work->done = &done;
+ work->done = done;
}
- cpu_stop_init_done(&done, cpumask_weight(cpumask));
/*
* Disable preemption while queueing to avoid getting
@@ -161,7 +161,15 @@ int __stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg)
cpu_stop_queue_work(&per_cpu(cpu_stopper, cpu),
&per_cpu(stop_cpus_work, cpu));
preempt_enable();
+}
+static int __stop_cpus(const struct cpumask *cpumask,
+ cpu_stop_fn_t fn, void *arg)
+{
+ struct cpu_stop_done done;
+
+ cpu_stop_init_done(&done, cpumask_weight(cpumask));
+ queue_stop_cpus_work(cpumask, fn, arg, &done);
wait_for_completion(&done.completion);
return done.executed ? done.ret : -ENOENT;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists