linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* 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-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
* [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