* RE: [PATCH] Only process_die notifier in ia64_do_page_fault if KPROBES is configured.
@ 2005-08-30 23:05 Luck, Tony
2005-08-30 23:38 ` Andi Kleen
0 siblings, 1 reply; 12+ messages in thread
From: Luck, Tony @ 2005-08-30 23:05 UTC (permalink / raw)
To: Christoph Lameter, Rusty Lynch
Cc: Andi Kleen, Lynch, Rusty, linux-mm, prasanna, linux-ia64,
linux-kernel, Keshavamurthy, Anil S
>Please do not generate any code if the feature cannot ever be
>used (CONFIG_KPROBES off). With this patch we still have lots of
>unnecessary code being executed on each page fault.
I can (eventually) wrap this call inside the #ifdef CONFIG_KPROBES.
But I'd like to keep following leads on making the overhead as
low as possible for those people that do have KPROBES configured
(which may be most people if OS distributors ship kernels with
this enabled).
-Tony
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH] Only process_die notifier in ia64_do_page_fault if KPROBES is configured. 2005-08-30 23:05 [PATCH] Only process_die notifier in ia64_do_page_fault if KPROBES is configured Luck, Tony @ 2005-08-30 23:38 ` Andi Kleen 2005-08-30 23:54 ` Christoph Lameter 2005-08-30 23:56 ` [PATCH] Only process_die notifier in ia64_do_page_fault if KPROBES is configured., " David S. Miller, Andi Kleen 0 siblings, 2 replies; 12+ messages in thread From: Andi Kleen @ 2005-08-30 23:38 UTC (permalink / raw) To: Luck, Tony Cc: Christoph Lameter, Rusty Lynch, Lynch, Rusty, linux-mm, prasanna, linux-ia64, linux-kernel, Keshavamurthy, Anil S On Wednesday 31 August 2005 01:05, Luck, Tony wrote: > >Please do not generate any code if the feature cannot ever be > >used (CONFIG_KPROBES off). With this patch we still have lots of > >unnecessary code being executed on each page fault. > > I can (eventually) wrap this call inside the #ifdef CONFIG_KPROBES. At least the original die notifiers were designed as a generic debugger interface, not a kprobes specific thing. So I don't think it's a good idea. Given most debuggers don't need the early page fault hook and it's mostly needed for a special case in kprobes, but it doesn't seem nice to only offer a subset of the hooks with specific config options. Also with the inline the test should be essentially a single test of a global variable and jump. Hardly a big performance issue, no? -Andi -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Only process_die notifier in ia64_do_page_fault if KPROBES is configured. 2005-08-30 23:38 ` Andi Kleen @ 2005-08-30 23:54 ` Christoph Lameter 2005-08-31 0:05 ` Andi Kleen 2005-08-30 23:56 ` [PATCH] Only process_die notifier in ia64_do_page_fault if KPROBES is configured., " David S. Miller, Andi Kleen 1 sibling, 1 reply; 12+ messages in thread From: Christoph Lameter @ 2005-08-30 23:54 UTC (permalink / raw) To: Andi Kleen Cc: Luck, Tony, Rusty Lynch, Lynch, Rusty, linux-mm, prasanna, linux-ia64, linux-kernel, Keshavamurthy, Anil S On Wed, 31 Aug 2005, Andi Kleen wrote: > Also with the inline the test should be essentially a single test of > a global variable and jump. Hardly a big performance issue, no? There are multiple effects of this code. - Additional cacheline in use in the page fault handler increasing the cache foot print. - There are registers in use for checking the global variable. - The compilers will reserve registers for the code that is never executed which may affect other elements of performance. From the register perspective a function call may be better on ia64. Certainly not a big effect (if we make sure the compiler knows that this test mostly fails and insure that the variable is in __mostly_read) but this is a frequently executed code path and the code is there without purpose if CONFIG_KPROBES is off. It wont get too bad unless lots of other people have similar ideas about fixing their race conditions using similar methods. But we will be setting a bad precedent if we allow this. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Only process_die notifier in ia64_do_page_fault if KPROBES is configured. 2005-08-30 23:54 ` Christoph Lameter @ 2005-08-31 0:05 ` Andi Kleen 0 siblings, 0 replies; 12+ messages in thread From: Andi Kleen @ 2005-08-31 0:05 UTC (permalink / raw) To: Christoph Lameter Cc: Luck, Tony, Rusty Lynch, Lynch, Rusty, linux-mm, prasanna, linux-ia64, linux-kernel, Keshavamurthy, Anil S On Wednesday 31 August 2005 01:54, Christoph Lameter wrote: > Certainly not a big effect (if we make sure the compiler knows that > this test mostly fails and insure that the variable is in > __mostly_read) Currently neither, but that could be easily fixed. > but this is a frequently executed code path and the code > is there without purpose if CONFIG_KPROBES is off. Well if you really worry about it then it might be better to do some dynamic code patching to make generic and distribution kernels too. > It wont get too bad unless lots of other people have similar ideas about > fixing their race conditions using similar methods. But we will be setting > a bad precedent if we allow this. Agreed on the general direction, but I didn't see an alternative for kprobes for this. Well actually the hook could be maybe right now moved into the part before kernel oops which is much less frequently executed, but then it'll likely move up again once kprobes support user space probes. -Andi -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Only process_die notifier in ia64_do_page_fault if KPROBES is configured., Re: [PATCH] Only process_die notifier in ia64_do_page_fault if KPROBES is configured. 2005-08-30 23:38 ` Andi Kleen 2005-08-30 23:54 ` Christoph Lameter @ 2005-08-30 23:56 ` David S. Miller, Andi Kleen 1 sibling, 0 replies; 12+ messages in thread From: David S. Miller, Andi Kleen @ 2005-08-30 23:56 UTC (permalink / raw) To: ak Cc: tony.luck, clameter, rusty, rusty.lynch, linux-mm, prasanna, linux-ia64, linux-kernel, anil.s.keshavamurthy > On Wednesday 31 August 2005 01:05, Luck, Tony wrote: > > >Please do not generate any code if the feature cannot ever be > > >used (CONFIG_KPROBES off). With this patch we still have lots of > > >unnecessary code being executed on each page fault. > > > > I can (eventually) wrap this call inside the #ifdef CONFIG_KPROBES. > > At least the original die notifiers were designed as a generic debugger > interface, not a kprobes specific thing. So I don't think it's a good idea. Me neither, I think a way too big deal is being made about about this by the ia64 folks. Just put the dang hook in there unconditionally already :-) -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re:[PATCH] Only process_die notifier in ia64_do_page_fault if KPROBES is configured. @ 2005-08-26 22:46 Rusty Lynch 2005-08-26 23:05 ` Christoph Lameter 0 siblings, 1 reply; 12+ messages in thread From: Rusty Lynch @ 2005-08-26 22:46 UTC (permalink / raw) To: Christoph Lameter Cc: linux-mm, prasanna, linux-ia64, linux-kernel, anil.s.keshavamurthy >-----Original Message----- >From: linux-ia64-owner@vger.kernel.org [mailto:linux-ia64- >owner@vger.kernel.org] On Behalf Of Christoph Lameter >Sent: Thursday, August 25, 2005 1:14 PM >To: linux-ia64@vger.kernel.org >Cc: linux-mm@kvack.org; prasanna@in.ibm.com >Subject: [PATCH] Only process_die notifier in ia64_do_page_fault if KPROBES is configured. > >ia64_do_page_fault is a path critical for system performance. >The code to call notify_die() should not be compiled into that critical path >if the system is not configured to use KPROBES. Just to be sure everyone understands the overhead involved, kprobes only registers a single notifier. If kprobes is disabled (CONFIG_KPROBES is off) then the overhead on a page fault is the overhead to execute an empty notifier chain. The debate over wrapping this notification call chain by a #define has surfaced in the past for other architectures (and also when the initial ia64 kprobe patches were submitted to the MM tree), and when the dust settled the notifier chain was left unwrapped. If the consensus is that executing an empty notifier chain introduces a measurable performance hit, then I think: * A new config option should be introduced to disable this hook and then let CONFIG_KPROBES depend on this new option since other kernel components could choose to use this hook. * The patch should do the same for all architectures, not just ia64 --rusty >Signed-off-by: Christoph Lameter <clameter@sgi.com> > >Index: linux-2.6.13-rc7/arch/ia64/mm/fault.c >=================================================================== >--- linux-2.6.13-rc7.orig/arch/ia64/mm/fault.c 2005-08-23 >20:39:14.000000000 -0700 >+++ linux-2.6.13-rc7/arch/ia64/mm/fault.c 2005-08-25 13:04:57.000000000 - 0700 >@@ -103,12 +103,16 @@ ia64_do_page_fault (unsigned long addres > goto bad_area_no_up; > #endif > >+#ifdef CONFIG_KPROBES > /* >- * This is to handle the kprobes on user space access instructions >+ * This is to handle the kprobes on user space access instructions. >+ * This is a path criticial for system performance. So only >+ * process this notifier if we are compiled with kprobes support. > */ > if (notify_die(DIE_PAGE_FAULT, "page fault", regs, code, TRAP_BRKPT, > SIGSEGV) == NOTIFY_STOP) > return; >+#endif > > down_read(&mm->mmap_sem); -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re:[PATCH] Only process_die notifier in ia64_do_page_fault if KPROBES is configured. 2005-08-26 22:46 Rusty Lynch @ 2005-08-26 23:05 ` Christoph Lameter 2005-08-27 0:24 ` [PATCH] " Andi Kleen 0 siblings, 1 reply; 12+ messages in thread From: Christoph Lameter @ 2005-08-26 23:05 UTC (permalink / raw) To: Rusty Lynch Cc: linux-mm, prasanna, linux-ia64, linux-kernel, anil.s.keshavamurthy On Fri, 26 Aug 2005, Rusty Lynch wrote: > Just to be sure everyone understands the overhead involved, kprobes only > registers a single notifier. If kprobes is disabled (CONFIG_KPROBES is > off) then the overhead on a page fault is the overhead to execute an empty > notifier chain. Its the overhead of using registers to pass parameters, performing a function call that does nothing etc. A waste of computing resources. All of that unconditionally in a performance critical execution path that is executed a gazillion times for an optional feature that I frankly find not useful at all and that is disabled by default. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Only process_die notifier in ia64_do_page_fault if KPROBES is configured. 2005-08-26 23:05 ` Christoph Lameter @ 2005-08-27 0:24 ` Andi Kleen 2005-08-30 0:19 ` Rusty Lynch 0 siblings, 1 reply; 12+ messages in thread From: Andi Kleen @ 2005-08-27 0:24 UTC (permalink / raw) To: Christoph Lameter Cc: Rusty Lynch, linux-mm, prasanna, linux-ia64, linux-kernel, anil.s.keshavamurthy On Saturday 27 August 2005 01:05, Christoph Lameter wrote: > On Fri, 26 Aug 2005, Rusty Lynch wrote: > > Just to be sure everyone understands the overhead involved, kprobes only > > registers a single notifier. If kprobes is disabled (CONFIG_KPROBES is > > off) then the overhead on a page fault is the overhead to execute an > > empty notifier chain. > > Its the overhead of using registers to pass parameters, performing a > function call that does nothing etc. A waste of computing resources. All > of that unconditionally in a performance critical execution path that > is executed a gazillion times for an optional feature that I frankly > find not useful at all and that is disabled by default. In the old days notifier_call_chain used to be inline. Then someone looking at code size out of lined it. Perhaps it should be inlined again or notifier.h could supply a special faster inline version for time critical code. Then it would be simple if (global_var != NULL) { ... } in the fast path. In addition the call chain could be declared __read_mostly. I suspect with these changes Christoph's concerns would go away, right? -Andi -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Only process_die notifier in ia64_do_page_fault if KPROBES is configured. 2005-08-27 0:24 ` [PATCH] " Andi Kleen @ 2005-08-30 0:19 ` Rusty Lynch 2005-08-30 1:08 ` Andi Kleen ` (2 more replies) 0 siblings, 3 replies; 12+ messages in thread From: Rusty Lynch @ 2005-08-30 0:19 UTC (permalink / raw) To: Andi Kleen Cc: Christoph Lameter, Rusty Lynch, linux-mm, prasanna, linux-ia64, linux-kernel, anil.s.keshavamurthy On Sat, Aug 27, 2005 at 02:24:25AM +0200, Andi Kleen wrote: > On Saturday 27 August 2005 01:05, Christoph Lameter wrote: > > On Fri, 26 Aug 2005, Rusty Lynch wrote: > > > Just to be sure everyone understands the overhead involved, kprobes only > > > registers a single notifier. If kprobes is disabled (CONFIG_KPROBES is > > > off) then the overhead on a page fault is the overhead to execute an > > > empty notifier chain. > > > > Its the overhead of using registers to pass parameters, performing a > > function call that does nothing etc. A waste of computing resources. All > > of that unconditionally in a performance critical execution path that > > is executed a gazillion times for an optional feature that I frankly > > find not useful at all and that is disabled by default. > > In the old days notifier_call_chain used to be inline. Then someone looking > at code size out of lined it. Perhaps it should be inlined again or notifier.h > could supply a special faster inline version for time critical code. > > Then it would be simple if (global_var != NULL) { ... } in the fast path. > In addition the call chain could be declared __read_mostly. > > I suspect with these changes Christoph's concerns would go away, right? > > -Andi So, assuming inlining the notifier_call_chain would address Christoph's conserns, is the following patch something like what you are sugesting? This would make all the kdebug.h::notify_die() calls use the inline version. (WARNING: The following has only been tested on ia64.) include/asm-i386/kdebug.h | 2 +- include/asm-ia64/kdebug.h | 2 +- include/asm-ppc64/kdebug.h | 2 +- include/asm-sparc64/kdebug.h | 2 +- include/asm-x86_64/kdebug.h | 2 +- include/linux/notifier.h | 18 ++++++++++++++++++ kernel/sys.c | 14 +------------- 7 files changed, 24 insertions(+), 18 deletions(-) Index: linux-2.6.13/include/linux/notifier.h =================================================================== --- linux-2.6.13.orig/include/linux/notifier.h +++ linux-2.6.13/include/linux/notifier.h @@ -72,5 +72,23 @@ extern int notifier_call_chain(struct no #define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */ #define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ +static inline int fast_notifier_call_chain(struct notifier_block **n, + unsigned long val, void *v) +{ + int ret=NOTIFY_DONE; + struct notifier_block *nb = *n; + + while(nb) + { + ret=nb->notifier_call(nb,val,v); + if(ret&NOTIFY_STOP_MASK) + { + return ret; + } + nb=nb->next; + } + return ret; +} + #endif /* __KERNEL__ */ #endif /* _LINUX_NOTIFIER_H */ Index: linux-2.6.13/kernel/sys.c =================================================================== --- linux-2.6.13.orig/kernel/sys.c +++ linux-2.6.13/kernel/sys.c @@ -169,19 +169,7 @@ EXPORT_SYMBOL(notifier_chain_unregister) int notifier_call_chain(struct notifier_block **n, unsigned long val, void *v) { - int ret=NOTIFY_DONE; - struct notifier_block *nb = *n; - - while(nb) - { - ret=nb->notifier_call(nb,val,v); - if(ret&NOTIFY_STOP_MASK) - { - return ret; - } - nb=nb->next; - } - return ret; + return fast_notifier_call_chain(n, val, v); } EXPORT_SYMBOL(notifier_call_chain); Index: linux-2.6.13/include/asm-ia64/kdebug.h =================================================================== --- linux-2.6.13.orig/include/asm-ia64/kdebug.h +++ linux-2.6.13/include/asm-ia64/kdebug.h @@ -55,7 +55,7 @@ static inline int notify_die(enum die_va .signr = sig }; - return notifier_call_chain(&ia64die_chain, val, &args); + return fast_notifier_call_chain(&ia64die_chain, val, &args); } #endif Index: linux-2.6.13/include/asm-i386/kdebug.h =================================================================== --- linux-2.6.13.orig/include/asm-i386/kdebug.h +++ linux-2.6.13/include/asm-i386/kdebug.h @@ -44,7 +44,7 @@ enum die_val { static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err,int trap, int sig) { struct die_args args = { .regs=regs, .str=str, .err=err, .trapnr=trap,.signr=sig }; - return notifier_call_chain(&i386die_chain, val, &args); + return fast_notifier_call_chain(&i386die_chain, val, &args); } #endif Index: linux-2.6.13/include/asm-ppc64/kdebug.h =================================================================== --- linux-2.6.13.orig/include/asm-ppc64/kdebug.h +++ linux-2.6.13/include/asm-ppc64/kdebug.h @@ -37,7 +37,7 @@ enum die_val { static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err,int trap, int sig) { struct die_args args = { .regs=regs, .str=str, .err=err, .trapnr=trap,.signr=sig }; - return notifier_call_chain(&ppc64_die_chain, val, &args); + return fast_notifier_call_chain(&ppc64_die_chain, val, &args); } #endif Index: linux-2.6.13/include/asm-sparc64/kdebug.h =================================================================== --- linux-2.6.13.orig/include/asm-sparc64/kdebug.h +++ linux-2.6.13/include/asm-sparc64/kdebug.h @@ -46,7 +46,7 @@ static inline int notify_die(enum die_va .trapnr = trap, .signr = sig }; - return notifier_call_chain(&sparc64die_chain, val, &args); + return fast_notifier_call_chain(&sparc64die_chain, val, &args); } #endif Index: linux-2.6.13/include/asm-x86_64/kdebug.h =================================================================== --- linux-2.6.13.orig/include/asm-x86_64/kdebug.h +++ linux-2.6.13/include/asm-x86_64/kdebug.h @@ -38,7 +38,7 @@ enum die_val { static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err,int trap, int sig) { struct die_args args = { .regs=regs, .str=str, .err=err, .trapnr=trap,.signr=sig }; - return notifier_call_chain(&die_chain, val, &args); + return fast_notifier_call_chain(&die_chain, val, &args); } extern int printk_address(unsigned long address); -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Only process_die notifier in ia64_do_page_fault if KPROBES is configured. 2005-08-30 0:19 ` Rusty Lynch @ 2005-08-30 1:08 ` Andi Kleen 2005-08-30 3:28 ` Christoph Lameter 2005-08-30 11:18 ` Matthew Wilcox 2 siblings, 0 replies; 12+ messages in thread From: Andi Kleen @ 2005-08-30 1:08 UTC (permalink / raw) To: Rusty Lynch Cc: Christoph Lameter, Rusty Lynch, linux-mm, prasanna, linux-ia64, linux-kernel, anil.s.keshavamurthy On Tuesday 30 August 2005 02:19, Rusty Lynch wrote: > > So, assuming inlining the notifier_call_chain would address Christoph's > conserns, is the following patch something like what you are sugesting? Yes. Well in theory you could make fast and slow notify_die too, but that's probably not worth it. -Andi -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Only process_die notifier in ia64_do_page_fault if KPROBES is configured. 2005-08-30 0:19 ` Rusty Lynch 2005-08-30 1:08 ` Andi Kleen @ 2005-08-30 3:28 ` Christoph Lameter 2005-08-30 11:18 ` Matthew Wilcox 2 siblings, 0 replies; 12+ messages in thread From: Christoph Lameter @ 2005-08-30 3:28 UTC (permalink / raw) To: Rusty Lynch Cc: Andi Kleen, Rusty Lynch, linux-mm, prasanna, linux-ia64, linux-kernel, anil.s.keshavamurthy On Mon, 29 Aug 2005, Rusty Lynch wrote: > So, assuming inlining the notifier_call_chain would address Christoph's > conserns, is the following patch something like what you are sugesting? > This would make all the kdebug.h::notify_die() calls use the inline version. Please do not generate any code if the feature cannot ever be used (CONFIG_KPROBES off). With this patch we still have lots of unnecessary code being executed on each page fault. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Only process_die notifier in ia64_do_page_fault if KPROBES is configured. 2005-08-30 0:19 ` Rusty Lynch 2005-08-30 1:08 ` Andi Kleen 2005-08-30 3:28 ` Christoph Lameter @ 2005-08-30 11:18 ` Matthew Wilcox 2005-09-19 18:22 ` Christoph Lameter 2 siblings, 1 reply; 12+ messages in thread From: Matthew Wilcox @ 2005-08-30 11:18 UTC (permalink / raw) To: Rusty Lynch Cc: Andi Kleen, Christoph Lameter, Rusty Lynch, linux-mm, prasanna, linux-ia64, linux-kernel, anil.s.keshavamurthy On Mon, Aug 29, 2005 at 05:19:05PM -0700, Rusty Lynch wrote: > So, assuming inlining the notifier_call_chain would address Christoph's > conserns, is the following patch something like what you are sugesting? > This would make all the kdebug.h::notify_die() calls use the inline version. I think we need something more like this ... include/linux/notifier.h: +static inline int notifier_call_chain(struct notifier_block **n, + unsigned long val, void *v) +{ + if (n) + return __notifier_call_chain(n, val, v); + return NOTIFY_DONE; +} kernel/sys.c: -int notifier_call_chain(struct notifier_block **n, unsigned long val, void *v) +int __notifier_call_chain(struct notifier_block **n, unsigned long val, void *v) -EXPORT_SYMBOL(notifier_call_chain); +EXPORT_SYMBOL(__notifier_call_chain); That way everyone gets both the quick test and the global size reduction. -- "Next the statesmen will invent cheap lies, putting the blame upon the nation that is attacked, and every man will be glad of those conscience-soothing falsities, and will diligently study them, and refuse to examine any refutations of them; and thus he will by and by convince himself that the war is just, and will thank God for the better sleep he enjoys after this process of grotesque self-deception." -- Mark Twain -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Only process_die notifier in ia64_do_page_fault if KPROBES is configured. 2005-08-30 11:18 ` Matthew Wilcox @ 2005-09-19 18:22 ` Christoph Lameter 0 siblings, 0 replies; 12+ messages in thread From: Christoph Lameter @ 2005-09-19 18:22 UTC (permalink / raw) To: Matthew Wilcox Cc: Rusty Lynch, Andi Kleen, Rusty Lynch, linux-mm, prasanna, linux-ia64, linux-kernel, anil.s.keshavamurthy On Tue, 30 Aug 2005, Matthew Wilcox wrote: > On Mon, Aug 29, 2005 at 05:19:05PM -0700, Rusty Lynch wrote: > > So, assuming inlining the notifier_call_chain would address Christoph's > > conserns, is the following patch something like what you are sugesting? > > This would make all the kdebug.h::notify_die() calls use the inline version. > > I think we need something more like this ... > > include/linux/notifier.h: > +static inline int notifier_call_chain(struct notifier_block **n, > + unsigned long val, void *v) > +{ > + if (n) > + return __notifier_call_chain(n, val, v); > + return NOTIFY_DONE; > +} > kernel/sys.c: > -int notifier_call_chain(struct notifier_block **n, unsigned long val, void *v) > +int __notifier_call_chain(struct notifier_block **n, unsigned long val, void *v) > -EXPORT_SYMBOL(notifier_call_chain); > +EXPORT_SYMBOL(__notifier_call_chain); > > That way everyone gets both the quick test and the global size reduction. And then do #ifndef CONFIG_KPROBES #define ia64die_chain 0 #endif in include/asm-ia64/kdebug.h? Otherwise we still check a notifier chain that cannot ever be activated. But then the patch is essentially the same as the last one I proposed. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] Only process_die notifier in ia64_do_page_fault if KPROBES is configured. @ 2005-08-25 20:14 Christoph Lameter 0 siblings, 0 replies; 12+ messages in thread From: Christoph Lameter @ 2005-08-25 20:14 UTC (permalink / raw) To: linux-ia64; +Cc: linux-mm, prasanna ia64_do_page_fault is a path critical for system performance. The code to call notify_die() should not be compiled into that critical path if the system is not configured to use KPROBES. Signed-off-by: Christoph Lameter <clameter@sgi.com> Index: linux-2.6.13-rc7/arch/ia64/mm/fault.c =================================================================== --- linux-2.6.13-rc7.orig/arch/ia64/mm/fault.c 2005-08-23 20:39:14.000000000 -0700 +++ linux-2.6.13-rc7/arch/ia64/mm/fault.c 2005-08-25 13:04:57.000000000 -0700 @@ -103,12 +103,16 @@ ia64_do_page_fault (unsigned long addres goto bad_area_no_up; #endif +#ifdef CONFIG_KPROBES /* - * This is to handle the kprobes on user space access instructions + * This is to handle the kprobes on user space access instructions. + * This is a path criticial for system performance. So only + * process this notifier if we are compiled with kprobes support. */ if (notify_die(DIE_PAGE_FAULT, "page fault", regs, code, TRAP_BRKPT, SIGSEGV) == NOTIFY_STOP) return; +#endif down_read(&mm->mmap_sem); -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2005-09-19 18:22 UTC | newest] Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2005-08-30 23:05 [PATCH] Only process_die notifier in ia64_do_page_fault if KPROBES is configured Luck, Tony 2005-08-30 23:38 ` Andi Kleen 2005-08-30 23:54 ` Christoph Lameter 2005-08-31 0:05 ` Andi Kleen 2005-08-30 23:56 ` [PATCH] Only process_die notifier in ia64_do_page_fault if KPROBES is configured., " David S. Miller, Andi Kleen -- strict thread matches above, loose matches on Subject: below -- 2005-08-26 22:46 Rusty Lynch 2005-08-26 23:05 ` Christoph Lameter 2005-08-27 0:24 ` [PATCH] " Andi Kleen 2005-08-30 0:19 ` Rusty Lynch 2005-08-30 1:08 ` Andi Kleen 2005-08-30 3:28 ` Christoph Lameter 2005-08-30 11:18 ` Matthew Wilcox 2005-09-19 18:22 ` Christoph Lameter 2005-08-25 20:14 Christoph Lameter
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox