Re: [(resend)patch 3/7] Notify page fault call chain for ia64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Anil S Keshavamurthy (on Wed, 19 Apr 2006 15:14:22 -0700) wrote:
>Overloading of page fault notification with the
>notify_die() has performance issues(since the
>only interested components for page fault is
>kprobes and/or kdb) and hence this patch introduces 
>the new notifier call chain exclusively for page 
>fault notifications their by avoiding notifying
>unnecessary components in the do_page_fault() code
>path.
>
>Signed-off-by: Anil S Keshavamurthy <[email protected]>
>
>---
> arch/ia64/kernel/traps.c  |   11 +++++++++++
>===================================================================
>--- linux-2.6.17-rc1-mm3.orig/arch/ia64/kernel/traps.c
>+++ linux-2.6.17-rc1-mm3/arch/ia64/kernel/traps.c
>@@ -31,6 +31,7 @@ fpswa_interface_t *fpswa_interface;
> EXPORT_SYMBOL(fpswa_interface);
> 
> ATOMIC_NOTIFIER_HEAD(ia64die_chain);
>+ATOMIC_NOTIFIER_HEAD(notify_page_fault_chain);
> 
> int
> register_die_notifier(struct notifier_block *nb)
>@@ -46,6 +47,16 @@ unregister_die_notifier(struct notifier_
> }
> EXPORT_SYMBOL_GPL(unregister_die_notifier);
> 
>+int register_page_fault_notifier(struct notifier_block *nb)
>+{
>+	return atomic_notifier_chain_register(&notify_page_fault_chain, nb);
>+}
>+
>+int unregister_page_fault_notifier(struct notifier_block *nb)
>+{
>+	return atomic_notifier_chain_unregister(&notify_page_fault_chain, nb);
>+}
>+

Why is register_page_fault_notifier defined in traps.c?  Surely it
should be in mm/fault.c, which is the only place that uses the chain.

> trap_init (void)
> {
>Index: linux-2.6.17-rc1-mm3/arch/ia64/mm/fault.c
>===================================================================
>--- linux-2.6.17-rc1-mm3.orig/arch/ia64/mm/fault.c
>+++ linux-2.6.17-rc1-mm3/arch/ia64/mm/fault.c
>@@ -84,7 +84,7 @@ ia64_do_page_fault (unsigned long addres
> 	/*
> 	 * This is to handle the kprobes on user space access instructions
> 	 */
>-	if (notify_die(DIE_PAGE_FAULT, "page fault", regs, code, TRAP_BRKPT,
>+	if (notify_page_fault(DIE_PAGE_FAULT, "page fault", regs, code, TRAP_BRKPT,
> 					SIGSEGV) == NOTIFY_STOP)
> 		return;

Since this is a critical path, please remove all references to
notify_page_fault() and its register functions when CONFIG_KPROBES=n.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux