diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-04-11 22:41:20 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-04-11 22:41:20 -0700 |
| commit | b283f09cf8f51c29bf90e42e22099f76d0f33378 (patch) | |
| tree | 7aee46f073ec3c8fc678b64eb430e2958ff0de1e /arch/m68k/kernel | |
| parent | ee28db843649533f5650186251ae4a8bd49a3da9 (diff) | |
[PATCH] Fix get_wchan() FIXME wrt. order of functions
From: William Lee Irwin III <wli@holomorphy.com>
This addresses the issue with get_wchan() that the various functions acting
as scheduling-related primitives are not, in fact, contiguous in the text
segment. It creates an ELF section for scheduling primitives to be placed
in, and places currently-detected (i.e. skipped during stack decoding)
scheduling primitives and others like io_schedule() and down(), which are
currently missed by get_wchan() code, into this section also.
The net effects are more reliability of get_wchan()'s results and the new
ability, made use of by this code, to arbitrarily place scheduling
primitives in the source code without disturbing get_wchan()'s accuracy.
Suggestions by Arnd Bergmann and Matthew Wilcox regarding reducing the
invasiveness of the patch were incorporated during prior rounds of review.
I've at least tried to sweep all arches in this patch.
Diffstat (limited to 'arch/m68k/kernel')
| -rw-r--r-- | arch/m68k/kernel/process.c | 5 | ||||
| -rw-r--r-- | arch/m68k/kernel/semaphore.c | 5 | ||||
| -rw-r--r-- | arch/m68k/kernel/vmlinux-std.lds | 1 | ||||
| -rw-r--r-- | arch/m68k/kernel/vmlinux-sun3.lds | 1 |
4 files changed, 5 insertions, 7 deletions
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c index 8d72a5c5b0c7..fc2c753c332b 100644 --- a/arch/m68k/kernel/process.c +++ b/arch/m68k/kernel/process.c @@ -65,8 +65,6 @@ asmlinkage void ret_from_fork(void); */ unsigned long thread_saved_pc(struct task_struct *tsk) { - extern void scheduling_functions_start_here(void); - extern void scheduling_functions_end_here(void); struct switch_stack *sw = (struct switch_stack *)tsk->thread.ksp; /* Check whether the thread is blocked in resume() */ if (sw->retpc > (unsigned long)scheduling_functions_start_here && @@ -387,8 +385,6 @@ out: /* * These bracket the sleeping functions.. */ -extern void scheduling_functions_start_here(void); -extern void scheduling_functions_end_here(void); #define first_sched ((unsigned long) scheduling_functions_start_here) #define last_sched ((unsigned long) scheduling_functions_end_here) @@ -407,7 +403,6 @@ unsigned long get_wchan(struct task_struct *p) fp >= 8184+stack_page) return 0; pc = ((unsigned long *)fp)[1]; - /* FIXME: This depends on the order of these functions. */ if (pc < first_sched || pc >= last_sched) return pc; fp = *(unsigned long *) fp; diff --git a/arch/m68k/kernel/semaphore.c b/arch/m68k/kernel/semaphore.c index 690efce1e437..1ebb79baaa8c 100644 --- a/arch/m68k/kernel/semaphore.c +++ b/arch/m68k/kernel/semaphore.c @@ -5,6 +5,7 @@ #include <linux/config.h> #include <linux/sched.h> +#include <linux/init.h> #include <asm/semaphore-helper.h> #ifndef CONFIG_RMW_INSNS @@ -95,7 +96,7 @@ void __up(struct semaphore *sem) current->state = TASK_RUNNING; \ remove_wait_queue(&sem->wait, &wait); -void __down(struct semaphore * sem) +void __sched __down(struct semaphore * sem) { DECLARE_WAITQUEUE(wait, current); @@ -106,7 +107,7 @@ void __down(struct semaphore * sem) DOWN_TAIL(TASK_UNINTERRUPTIBLE) } -int __down_interruptible(struct semaphore * sem) +int __sched __down_interruptible(struct semaphore * sem) { DECLARE_WAITQUEUE(wait, current); int ret = 0; diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds index bd41fc992169..6dc62684c7b9 100644 --- a/arch/m68k/kernel/vmlinux-std.lds +++ b/arch/m68k/kernel/vmlinux-std.lds @@ -12,6 +12,7 @@ SECTIONS _text = .; /* Text and read-only data */ .text : { *(.text) + SCHED_TEXT *(.fixup) *(.gnu.warning) } = 0x4e75 diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds index 2e81cde14987..f293e567192c 100644 --- a/arch/m68k/kernel/vmlinux-sun3.lds +++ b/arch/m68k/kernel/vmlinux-sun3.lds @@ -13,6 +13,7 @@ SECTIONS .text : { *(.head) *(.text) + SCHED_TEXT *(.fixup) *(.gnu.warning) } = 0x4e75 |
