From: Ingo Molnar <mingo@elte.hu>
To: Andrew Morton <akpm@osdl.org>
Cc: Andi Kleen <ak@suse.de>, Linus Torvalds <torvalds@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: [patch, -rc6] x86_64: UP build fixes
Date: Thu, 16 Nov 2006 10:45:18 +0100 [thread overview]
Message-ID: <20061116094518.GA17933@elte.hu> (raw)
In-Reply-To: <20061116092801.GA14322@elte.hu>
* Ingo Molnar <mingo@elte.hu> wrote:
> > on_each_cpu() does this and one caller (at least) relies upon it
> > (invalidate_bh_lrus(), iirc).
>
> ok, fair enough. Then this is a (minor) bugfix as well.
ok, this doesnt build on some configs - so the replacement patch below
moves the UP variant to a function (which makes sense anyway).
Ingo
--------------->
Subject: x86_64: build fixes
From: Ingo Molnar <mingo@elte.hu>
x86_64 does not build cleanly on UP:
arch/x86_64/kernel/vsyscall.c: In function 'cpu_vsyscall_notifier':
arch/x86_64/kernel/vsyscall.c:282: warning: implicit declaration of function 'smp_call_function_single'
arch/x86_64/kernel/vsyscall.c: At top level:
arch/x86_64/kernel/vsyscall.c:279: warning: 'cpu_vsyscall_notifier' defined but not used
this patch fixes it by making smp_call_function_single() globally available.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
include/asm-x86_64/smp.h | 11 ++---------
include/linux/smp.h | 10 +++++++---
kernel/sched.c | 19 +++++++++++++++++++
3 files changed, 28 insertions(+), 12 deletions(-)
Index: linux/include/asm-x86_64/smp.h
===================================================================
--- linux.orig/include/asm-x86_64/smp.h
+++ linux/include/asm-x86_64/smp.h
@@ -115,16 +115,9 @@ static __inline int logical_smp_processo
}
#ifdef CONFIG_SMP
-#define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu]
+# define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu]
#else
-#define cpu_physical_id(cpu) boot_cpu_id
-static inline int smp_call_function_single(int cpuid, void (*func) (void *info),
- void *info, int retry, int wait)
-{
- /* Disable interrupts here? */
- func(info);
- return 0;
-}
+# define cpu_physical_id(cpu) boot_cpu_id
#endif /* !CONFIG_SMP */
#endif
Index: linux/include/linux/smp.h
===================================================================
--- linux.orig/include/linux/smp.h
+++ linux/include/linux/smp.h
@@ -53,9 +53,6 @@ extern void smp_cpus_done(unsigned int m
*/
int smp_call_function(void(*func)(void *info), void *info, int retry, int wait);
-int smp_call_function_single(int cpuid, void (*func) (void *info), void *info,
- int retry, int wait);
-
/*
* Call a function on all processors
*/
@@ -103,6 +100,13 @@ static inline void smp_send_reschedule(i
#endif /* !SMP */
/*
+ * Call a function on a specific CPU (on UP the function gets executed
+ * on the current CPU, immediately):
+ */
+int smp_call_function_single(int cpuid, void (*func) (void *info), void *info,
+ int retry, int wait);
+
+/*
* smp_processor_id(): get the current CPU ID.
*
* if DEBUG_PREEMPT is enabled the we check whether it is
Index: linux/kernel/sched.c
===================================================================
--- linux.orig/kernel/sched.c
+++ linux/kernel/sched.c
@@ -1110,6 +1110,25 @@ repeat:
task_rq_unlock(rq, &flags);
}
+#ifndef CONFIG_SMP
+/*
+ * Call a function on a specific CPU (on UP the function gets executed
+ * on the current CPU, immediately):
+ */
+int smp_call_function_single(int cpuid, void (*func) (void *info), void *info,
+ int retry, int wait)
+{
+ unsigned long flags;
+
+ local_irq_save(flags);
+ func(info);
+ local_irq_restore(flags);
+
+ return 0;
+}
+EXPORT_SYMBOL(smp_call_function_single);
+#endif
+
/***
* kick_process - kick a running thread to enter/exit the kernel
* @p: the to-be-kicked thread
next prev parent reply other threads:[~2006-11-16 9:46 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-16 8:48 [patch, -rc6] x86_64: UP build fixes Ingo Molnar
2006-11-16 8:58 ` Andrew Morton
2006-11-16 9:28 ` Ingo Molnar
2006-11-16 9:45 ` Ingo Molnar [this message]
2006-11-16 9:01 ` Andi Kleen
2006-11-16 9:17 ` Andrew Morton
2006-11-16 9:22 ` Andi Kleen
2006-11-16 9:48 ` Ingo Molnar
2006-11-16 10:09 ` Andi Kleen
2006-11-16 12:29 ` Ingo Molnar
2006-11-16 9:03 ` Ingo Molnar
2006-11-16 9:32 ` [patch] hotplug CPU: clean up hotcpu_notifier() use Ingo Molnar
2006-11-16 21:59 ` Linus Torvalds
2006-11-17 3:52 ` Ingo Molnar
2006-11-17 6:02 ` Linus Torvalds
2006-11-17 7:28 ` Ingo Molnar
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=20061116094518.GA17933@elte.hu \
--to=mingo@elte.hu \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/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