Re: [PATCH 2/2] implement new notifier function to panic_notifier_list

Previous thread: [PATCH 1/2] add tunable_notifier function by Takenori Nagano on Thursday, October 4, 2007 - 4:38 am. (6 messages)

Next thread: [PATCH] remove throttle_vm_writeout() by Miklos Szeredi on Thursday, October 4, 2007 - 5:25 am. (36 messages)
From: Takenori Nagano
Date: Thursday, October 4, 2007 - 4:38 am

This patch implements new notifier function to panic_notifier_list. We can
change the list of order by debugfs.

Thanks,

---

Signed-off-by: Takenori Nagano <t-nagano@ah.jp.nec.com>

---
diff -uprN linux-2.6.23-rc9.orig/arch/alpha/kernel/setup.c
linux-2.6.23-rc9/arch/alpha/kernel/setup.c
--- linux-2.6.23-rc9.orig/arch/alpha/kernel/setup.c	2007-10-02
12:24:52.000000000 +0900
+++ linux-2.6.23-rc9/arch/alpha/kernel/setup.c	2007-10-04 09:49:34.440000000 +0900
@@ -45,14 +45,22 @@
 #include <asm/io.h>
 #include <linux/log2.h>

-extern struct atomic_notifier_head panic_notifier_list;
+extern struct tunable_notifier_head panic_notifier_list;
 static int alpha_panic_event(struct notifier_block *, unsigned long, void *);
-static struct notifier_block alpha_panic_block = {
+static struct notifier_block alpha_panic_block_base = {
 	alpha_panic_event,
         NULL,
         INT_MAX /* try to do it first */
 };

+static struct tunable_notifier_block alpha_panic_block = {
+	&alpha_panic_block_base,
+	NULL,
+	NULL,
+	NULL,
+	NULL
+};
+
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 #include <asm/system.h>
@@ -522,8 +530,8 @@ setup_arch(char **cmdline_p)
 	}

 	/* Register a call for panic conditions. */
-	atomic_notifier_chain_register(&panic_notifier_list,
-			&alpha_panic_block);
+	tunable_notifier_chain_register(&panic_notifier_list,
+			&alpha_panic_block, "alpha_panic", NULL);

 #ifdef CONFIG_ALPHA_GENERIC
 	/* Assume that we've booted from SRM if we haven't booted from MILO.
diff -uprN linux-2.6.23-rc9.orig/arch/arm/mach-omap1/board-voiceblue.c
linux-2.6.23-rc9/arch/arm/mach-omap1/board-voiceblue.c
--- linux-2.6.23-rc9.orig/arch/arm/mach-omap1/board-voiceblue.c	2007-10-02
12:24:52.000000000 +0900
+++ linux-2.6.23-rc9/arch/arm/mach-omap1/board-voiceblue.c	2007-10-04
09:53:17.008000000 +0900
@@ -228,14 +228,23 @@ static int panic_event(struct notifier_b
 	return NOTIFY_DONE;
 }

-static struct notifier_block panic_block = {
+static struct ...
From: Randy Dunlap
Date: Thursday, October 4, 2007 - 9:07 am

"softlockup"

---
~Randy
-

From: Takenori Nagano
Date: Thursday, October 4, 2007 - 9:59 pm

Hi Randy,

Thank you for reviewing. :)
I'll fix next version.
-

From: Vivek Goyal
Date: Thursday, October 4, 2007 - 10:49 pm

I think it might be good idea to somehow create provisions for another a
help string. This help string will inform admin that what a registered
user does? Ideally this should be visible in /sys/kernel/debug/<user module>/description file.

This kind of description can help admin to decide the priority among various
registered users withoug having to look at the source code.

Thanks
Vivek
-

From: Takenori Nagano
Date: Thursday, October 4, 2007 - 11:19 pm

Hi Vivek,

We can make description file with tunable_notifier_chain_register 4th argument.
If developer sets 4th argument, tunable_notifier_chain_register makes
/sys/kernel/debug/<name>/description file. Admin can get information from the
description file.

+/**
+ *	tunable_notifier_chain_register - Add notifier to an tunable notifier chain
+ *	@nh: Pointer to head of the tunable notifier chain
+ *	@n: New entry in notifier chain
+ *	@name: Pointer to the name of the new notifier entry
+ *	@desc: Pointer to the description of new entry
+ *
+ *	Adds a notifier to an tunable notifier chain and makes control dir.
+ *
+ *	Returns zero on success or %-ENODEV on failure.
+ */

Thanks,

Takenori Nagano <t-nagano@ah.jp.nec.com>
-

Previous thread: [PATCH 1/2] add tunable_notifier function by Takenori Nagano on Thursday, October 4, 2007 - 4:38 am. (6 messages)

Next thread: [PATCH] remove throttle_vm_writeout() by Miklos Szeredi on Thursday, October 4, 2007 - 5:25 am. (36 messages)