Re: [Patch 4/7] softirq: Use hotplug thread infrastructure
From: Paul E. McKenney
Date: Mon Jul 23 2012 - 17:15:49 EST
On Sat, Jul 21, 2012 at 10:21:51AM -0700, Paul E. McKenney wrote:
> On Mon, Jul 16, 2012 at 10:42:37AM -0000, Thomas Gleixner wrote:
> > Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> > ---
> > kernel/softirq.c | 107 +++++++++++++------------------------------------------
> > 1 file changed, 26 insertions(+), 81 deletions(-)
[ . . . ]
> Again, I also placed the updated series on -rcu at branch rcu/smp/hotplug
> (git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git),
> based on tip/smp/hotplug, for Linaro testing purposes.
>
> With these two changes, this series merged with Tejun's workqueue
> hotplug changes merged with my -rcu tree passed moderate rcutorture
> and hotplug testing, with the exception of some apparently unrelated
> build problems in UP configuration:
>
> warning: call to âcopy_from_user_overflowâ declared with attribute warning: copy_from_user() buffer size is not provably correct [enabled by default
>
> I have a fix for an earlier occurrence of this problem that I will try next.
And the fix worked, but uncovered a !SMP build problem in the underlying
patchset. I fixed this with the following patch, which is also available
as noted above.
Thanx, Paul
------------------------------------------------------------------------
Makefile | 3 +--
smpboot.c | 4 ++++
2 files changed, 5 insertions(+), 2 deletions(-)
hotplug: Fix UP bug in smpboot hotplug code
Because kernel subsystems need their per-CPU kthreads on UP systems
as well as on SMP systems, the smpboot hotplug kthread functions
must be provided in UP builds as well as in SMP builds. This commit
therefore adds smpboot.c to UP builds and excludes irrelevant code
via #ifdef.
Signed-off-by: Paul E. McKenney <paul.mckenney@xxxxxxxxxx>
Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
diff --git a/kernel/Makefile b/kernel/Makefile
index c0cc67a..e5602d3 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -10,7 +10,7 @@ obj-y = fork.o exec_domain.o panic.o printk.o \
kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \
hrtimer.o rwsem.o nsproxy.o srcu.o semaphore.o \
notifier.o ksysfs.o cred.o \
- async.o range.o groups.o lglock.o
+ async.o range.o groups.o lglock.o smpboot.o
ifdef CONFIG_FUNCTION_TRACER
# Do not trace debug files and internal ftrace files
@@ -46,7 +46,6 @@ obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o
obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o
obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
obj-$(CONFIG_SMP) += smp.o
-obj-$(CONFIG_SMP) += smpboot.o
ifneq ($(CONFIG_SMP),y)
obj-y += up.o
endif
diff --git a/kernel/smpboot.c b/kernel/smpboot.c
index b2545c8..0a49ee7 100644
--- a/kernel/smpboot.c
+++ b/kernel/smpboot.c
@@ -15,6 +15,8 @@
#include "smpboot.h"
+#ifdef CONFIG_SMP
+
#ifdef CONFIG_GENERIC_SMP_IDLE_THREAD
/*
* For the hotplug case we keep the task structs around and reuse
@@ -72,6 +74,8 @@ void __init idle_threads_init(void)
}
#endif
+#endif /* #ifdef CONFIG_SMP */
+
static LIST_HEAD(hotplug_threads);
static DEFINE_MUTEX(smpboot_threads_lock);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/