From jlan@sgi.com Wed Apr 9 11:24:44 2008 Received: with ECARTIS (v1.0.0; list kdb); Wed, 09 Apr 2008 11:24:53 -0700 (PDT) Received: from kluge.engr.sgi.com (kluge.engr.sgi.com [192.102.96.102]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m39IOisP000577 for ; Wed, 9 Apr 2008 11:24:44 -0700 Received: from [150.166.8.78] (aware.engr.sgi.com [150.166.8.78]) by kluge.engr.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m39IPN98305797; Wed, 9 Apr 2008 11:25:23 -0700 (PDT) Message-ID: <47FD0A12.1010205@sgi.com> Date: Wed, 09 Apr 2008 11:25:22 -0700 From: Jay Lan User-Agent: Thunderbird 2.0.0.6 (X11/20070801) MIME-Version: 1.0 To: jidong xiao CC: KDB Subject: Re: bb1 command fails on x86 References: <4104961b0803250607q423fd367n11293b64a8f35249@mail.gmail.com> In-Reply-To: <4104961b0803250607q423fd367n11293b64a8f35249@mail.gmail.com> Content-type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 1336 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: jlan@sgi.com Precedence: bulk X-list: kdb jidong xiao wrote: > Hi, > > I am using sles10sp2 beta kernel(x86_64) in which the new backtrace > mechanism for x86 is used. Hi Jidong, Sorry for being late in response. I have been away for two weeks. The "undefined BBRG_RSP" problem hit me at i386 even worse. I was not even able to do a 'bt' while i was able to do a 'bt' after i triggered a MCA on x86_64 using a test module. I do not know how to fix this problem. Any suggestion from anyone? Keith? - jay > I was attemptting to use bb1 command to analysis > do_hypervisor_callback and evtchn_do_upcall. In SLES10Sp2, > do_hypervisor_callback is defined in arch/x86_64/kernel/entry-xen.S, > although there is no such a file in the mainline kernel, but I think > this has nothing to do with the problem. > > below is the disassemble result of > do_hypervisor_callback.(evtchn_do_upcall is called by > do_hypervisor_callback). > > [0]kdb> id do_hypervisor_callback > 0xffffffff8010ab7c do_hypervisor_callback: mov %rdi,%rsp > 0xffffffff8010ab7f do_hypervisor_callback+0x3: incl %gs:0x20 > 0xffffffff8010ab87 do_hypervisor_callback+0xb: mov %rsp,%rbp > 0xffffffff8010ab8a do_hypervisor_callback+0xe: cmove %gs:0x28,%rsp > 0xffffffff8010ab94 do_hypervisor_callback+0x18: push %rbp > 0xffffffff8010ab95 do_hypervisor_callback+0x19: callq > 0xffffffff80281871 evtchn_do_upcall > 0xffffffff8010ab9a do_hypervisor_callback+0x1e: pop %rsp > 0xffffffff8010ab9b do_hypervisor_callback+0x1f: decl %gs:0x20 > 0xffffffff8010aba3 do_hypervisor_callback+0x27: jmpq > 0xffffffff8010aaef error_exit > 0xffffffff8010aba8 restore_all_enable_events: mov %gs:0x24,%rsi > 0xffffffff8010abb1 restore_all_enable_events+0x9: shl $0x20,%rsi > 0xffffffff8010abb5 restore_all_enable_events+0xd: shr $0x1a,%rsi > 0xffffffff8010abb9 restore_all_enable_events+0x11: add > 0xffffffff8039d628,%rsi > 0xffffffff8010abc1 restore_all_enable_events+0x19: movb $0x0,0x1(%rsi) > > Here we see 0xffffffff8010ab9a is the exit point of evtchn_do_upcall. > However bb1 command fails when I tried to give it this address. > > [0]kdb> bb1 0xffffffff8010ab9a > bb_pass1: func_name do_hypervisor_callback func_start > 0xffffffff8010ab7c func_end 0xffffffff8010aba8 > bb_pass1: end > bb[0] start 0xffffffff8010ab7c end 0xffffffff8010aba3 drop_through 0 > bb_pass2: start > > bb_pass2_do_changed_blocks: allow_missing 0 > > bb[0] > bb_reg_state ffffffff805153d8 > rax = rax > rbx = rbx > rcx = rcx > rdx = rdx > rdi = rdi > rsi = rsi > rbp = rbp > rsp = osp+0x0 > r8 = r8 > r9 = r9 > r10 = r10 > r11 = r11 > r12 = r12 > r13 = r13 > r14 = r14 > r15 = r15 > '0xffffffff8010ab7c do_hypervisor_callback: mov %rdi,%rsp' > opcode 'mov' matched by 'mov', usage 36 > src R: %rdi base_rc 6 (rdi) > dst R: %rsp base_rc 9 (rsp) > rsp = rdi (rdi) > '0xffffffff8010ab7f do_hypervisor_callback+0x3: incl %gs:0x20' > opcode 'incl' matched by 'inc', usage 5 > src M: %gs:0x20 > '0xffffffff8010ab87 do_hypervisor_callback+0xb: mov %rsp,%rbp' > opcode 'mov' matched by 'mov', usage 36 > src R: %rsp base_rc 9 (rsp) > dst R: %rbp base_rc 8 (rbp) > rbp = rsp (rdi) > '0xffffffff8010ab8a do_hypervisor_callback+0xe: cmove %gs:0x28,%rsp' > opcode 'cmove' matched by 'cmov', usage 19 > src M: %gs:0x28 > dst R: %rsp base_rc 9 (rsp) > '0xffffffff8010ab94 do_hypervisor_callback+0x18: push %rbp' > opcode 'push' matched by 'push', usage 44 > src R: %rbp base_rc 8 (rbp) > push when BBRG_RSP is undefined? > bb_pass2: end bb_reg_params 0 bb_memory_params 0 > kdb_bb: 0xffffffff8010ab9a [kernel]do_hypervisor_callback failed at > 0xffffffff8010ab94 > > It's very clear why this issue happens, since the first step of this > function, rsp becomes no longer being referenced by osp. My question > is, is there any way to fix this? > > Regards > Jason > --------------------------- > Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From t-nagano@ah.jp.nec.com Fri Apr 11 00:53:49 2008 Received: with ECARTIS (v1.0.0; list kdb); Fri, 11 Apr 2008 01:00:59 -0700 (PDT) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3B7riD8012415 for ; Fri, 11 Apr 2008 00:53:49 -0700 X-ASG-Debug-ID: 1207900461-3e8001600000-sLlkUa X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo202.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id EEC4577D925 for ; Fri, 11 Apr 2008 00:54:22 -0700 (PDT) Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by cuda.sgi.com with ESMTP id QiABHL9h9YPlYzlH for ; Fri, 11 Apr 2008 00:54:22 -0700 (PDT) Received: from mailgate3.nec.co.jp (mailgate53.nec.co.jp [10.7.69.161]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m3B7rrht018467; Fri, 11 Apr 2008 16:53:53 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m3B7rrh23887; Fri, 11 Apr 2008 16:53:53 +0900 (JST) Received: from mailsv.linux.bs1.fc.nec.co.jp (mailsv.linux.bs1.fc.nec.co.jp [10.34.125.2]) by mailsv4.nec.co.jp (8.13.8/8.13.4) with ESMTP id m3B7rqZW000782; Fri, 11 Apr 2008 16:53:52 +0900 (JST) Received: from [10.34.125.197] (T-NAGANO-AH1.linux.bs1.fc.nec.co.jp [10.34.125.197]) by mailsv.linux.bs1.fc.nec.co.jp (Postfix) with ESMTP id 7CBD2E4829A; Fri, 11 Apr 2008 16:53:52 +0900 (JST) Message-ID: <47FF1910.1070001@ah.jp.nec.com> Date: Fri, 11 Apr 2008 16:53:52 +0900 From: Takenori Nagano User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: linux-kernel@vger.kernel.org, Andrew Morton CC: kdb@oss.sgi.com, vgoyal@in.ibm.com, "Eric W. Biederman" , k-miyoshi@cb.jp.nec.com, kexec@lists.infradead.org, Bernhard Walle , Keith Owens , nickpiggin@yahoo.com.au, Randy Dunlap , greg@kroah.com X-ASG-Orig-Subj: [PATCH 1/2] add tunable_notifier function ,take2 Subject: [PATCH 1/2] add tunable_notifier function ,take2 References: <47FF0EA5.8090804@ah.jp.nec.com> In-Reply-To: <47FF0EA5.8090804@ah.jp.nec.com> Content-type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 8bit X-Barracuda-Connect: TYO202.gate.nec.co.jp[202.32.8.206] X-Barracuda-Start-Time: 1207900462 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.47462 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-archive-position: 1337 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: t-nagano@ah.jp.nec.com Precedence: bulk X-list: kdb This patch adds new notifier function tunable_notifier_chain. Its base is atomic_notifier_chain. Thanks, --- Signed-off-by: Takenori Nagano --- diff -uprN linux-2.6.25-rc8-mm1.orig/include/linux/notifier.h linux-2.6.25-rc8-mm1/include/linux/notifier.h --- linux-2.6.25-rc8-mm1.orig/include/linux/notifier.h 2008-04-08 16:37:43.700000000 +0900 +++ linux-2.6.25-rc8-mm1/include/linux/notifier.h 2008-04-09 20:01:10.328000000 +0900 @@ -13,6 +13,7 @@ #include #include #include +#include /* * Notifier chains are of four types: @@ -53,6 +54,13 @@ struct notifier_block { int priority; }; +struct tunable_atomic_notifier_block { + struct notifier_block *nb; + struct tunable_atomic_notifier_head *head; + struct kobject kobj; + char *desc; +}; + struct atomic_notifier_head { spinlock_t lock; struct notifier_block *head; @@ -63,6 +71,13 @@ struct blocking_notifier_head { struct notifier_block *head; }; +struct tunable_atomic_notifier_head { + spinlock_t lock; + struct notifier_block *head; + char *name; + struct kset *notifier_sub_kset; +}; + struct raw_notifier_head { struct notifier_block *head; }; @@ -73,6 +88,13 @@ struct srcu_notifier_head { struct notifier_block *head; }; +struct control_file_info { + struct tunable_atomic_notifier_head *nh; + struct tunable_atomic_notifier_block *n; + char *name; + struct control_file_info *next; +}; + #define ATOMIC_INIT_NOTIFIER_HEAD(name) do { \ spin_lock_init(&(name)->lock); \ (name)->head = NULL; \ @@ -81,6 +103,12 @@ struct srcu_notifier_head { init_rwsem(&(name)->rwsem); \ (name)->head = NULL; \ } while (0) +#define TUNABLE_ATOMIC_INIT_NOTIFIER(val1, val2) do { \ + spin_lock_init(&(val1)->lock); \ + (val1)->head = NULL; \ + (val1)->name = val2; \ + (val1)->notifier_sub_kset = NULL; \ + } while (0) #define RAW_INIT_NOTIFIER_HEAD(name) do { \ (name)->head = NULL; \ } while (0) @@ -96,6 +124,11 @@ extern void srcu_init_notifier_head(stru #define BLOCKING_NOTIFIER_INIT(name) { \ .rwsem = __RWSEM_INITIALIZER((name).rwsem), \ .head = NULL } +#define TUNABLE_ATOMIC_NOTIFIER_INIT(val1, val2) { \ + .lock =__SPIN_LOCK_UNLOCKED(val1.lock), \ + .head = NULL, \ + .name = val2, \ + .notifier_sub_kset = NULL } #define RAW_NOTIFIER_INIT(name) { \ .head = NULL } /* srcu_notifier_heads cannot be initialized statically */ @@ -106,6 +139,9 @@ extern void srcu_init_notifier_head(stru #define BLOCKING_NOTIFIER_HEAD(name) \ struct blocking_notifier_head name = \ BLOCKING_NOTIFIER_INIT(name) +#define TUNABLE_ATOMIC_NOTIFIER_HEAD(name, val) \ + struct tunable_atomic_notifier_head name = \ + TUNABLE_ATOMIC_NOTIFIER_INIT(name, val) #define RAW_NOTIFIER_HEAD(name) \ struct raw_notifier_head name = \ RAW_NOTIFIER_INIT(name) @@ -116,6 +152,10 @@ extern int atomic_notifier_chain_registe struct notifier_block *nb); extern int blocking_notifier_chain_register(struct blocking_notifier_head *nh, struct notifier_block *nb); +extern int tunable_atomic_notifier_chain_register( + struct tunable_atomic_notifier_head *nh, + struct tunable_atomic_notifier_block *nb, + char *name, char *desc); extern int raw_notifier_chain_register(struct raw_notifier_head *nh, struct notifier_block *nb); extern int srcu_notifier_chain_register(struct srcu_notifier_head *nh, @@ -129,6 +169,9 @@ extern int atomic_notifier_chain_unregis struct notifier_block *nb); extern int blocking_notifier_chain_unregister(struct blocking_notifier_head *nh, struct notifier_block *nb); +extern int tunable_atomic_notifier_chain_unregister( + struct tunable_atomic_notifier_head *nh, + struct tunable_atomic_notifier_block *nb); extern int raw_notifier_chain_unregister(struct raw_notifier_head *nh, struct notifier_block *nb); extern int srcu_notifier_chain_unregister(struct srcu_notifier_head *nh, @@ -142,6 +185,14 @@ extern int blocking_notifier_call_chain( unsigned long val, void *v); extern int __blocking_notifier_call_chain(struct blocking_notifier_head *nh, unsigned long val, void *v, int nr_to_call, int *nr_calls); +extern int tunable_atomic_notifier_call_chain( + struct tunable_atomic_notifier_head *nh, + unsigned long val, void *v); +extern int __tunable_atomic_notifier_call_chain( + struct tunable_atomic_notifier_head *nh, + unsigned long val, void *v, + int nr_to_call, int *nr_calls); +extern int tunable_atomic_notifier_init(void); extern int raw_notifier_call_chain(struct raw_notifier_head *nh, unsigned long val, void *v); extern int __raw_notifier_call_chain(struct raw_notifier_head *nh, diff -uprN linux-2.6.25-rc8-mm1.orig/kernel/ksysfs.c linux-2.6.25-rc8-mm1/kernel/ksysfs.c --- linux-2.6.25-rc8-mm1.orig/kernel/ksysfs.c 2008-04-02 04:44:26.000000000 +0900 +++ linux-2.6.25-rc8-mm1/kernel/ksysfs.c 2008-04-09 20:11:15.440000000 +0900 @@ -15,6 +15,7 @@ #include #include #include +#include #define KERNEL_ATTR_RO(_name) \ static struct kobj_attribute _name##_attr = __ATTR_RO(_name) @@ -146,7 +147,10 @@ static int __init ksysfs_init(void) if (error) goto notes_exit; - return 0; + /* create the /sys/kernel/notifiers directory */ + error = tunable_atomic_notifier_init(); + + return error; notes_exit: if (notes_size > 0) diff -uprN linux-2.6.25-rc8-mm1.orig/kernel/notifier.c linux-2.6.25-rc8-mm1/kernel/notifier.c --- linux-2.6.25-rc8-mm1.orig/kernel/notifier.c 2008-04-08 16:37:44.904000000 +0900 +++ linux-2.6.25-rc8-mm1/kernel/notifier.c 2008-04-11 16:31:14.765088353 +0900 @@ -319,6 +319,261 @@ int blocking_notifier_call_chain(struct EXPORT_SYMBOL_GPL(blocking_notifier_call_chain); /* + * Tunable atomic notifier chain routines. Registration and unregistration + * use a spinlock, and call_chain is synchronized by RCU (no locks). + * User can change the list order to use /sys/kernel/notifiers/list-name/. + */ + +static ssize_t priority_show(struct kobject *kobj, + struct kobj_attribute *attr, const char *buf) +{ + struct tunable_atomic_notifier_block *n = container_of(kobj, + struct tunable_atomic_notifier_block, kobj); + + return sprintf(buf, "%d\n", n->nb->priority); +} + +static ssize_t priority_store(struct kobject *kobj, + struct kobj_attribute *attr, const char *buf, size_t size) +{ + struct tunable_atomic_notifier_block *n = container_of(kobj, + struct tunable_atomic_notifier_block, kobj); + struct tunable_atomic_notifier_head *nh = n->head; + unsigned long flags; + int priority, ret; + + sscanf(buf, "%d", &priority); + n->nb->priority = priority; + + spin_lock_irqsave(&nh->lock, flags); + ret = notifier_chain_unregister(&nh->head, n->nb); + if (ret) + goto out_unlock; + ret = notifier_chain_register(&nh->head, n->nb); + +out_unlock: + spin_unlock_irqrestore(&nh->lock, flags); + + return (ret ? ret : size); + +} + +static ssize_t description_show(struct kobject *kobj, + struct kobj_attribute *attr, const char *buf) +{ + struct tunable_atomic_notifier_block *n = container_of(kobj, + struct tunable_atomic_notifier_block, kobj); + + if (n->desc) + return sprintf(buf, "%s\n", n->desc); + + return sprintf(buf, "Description is not available\n"); +} + +static struct kobj_attribute priority_attr = + __ATTR(priority, 0644, priority_show, priority_store); +static struct kobj_attribute description_attr = + __ATTR_RO(description); + +static struct attribute *notifiers_attributes[] = { + &priority_attr.attr, &description_attr.attr, NULL +}; + +static struct kobj_type notifiers_ktype = { + .sysfs_ops = &kobj_sysfs_ops, + .default_attrs = notifiers_attributes, +}; + +static struct kobject *notifiers_kobj; +struct control_file_info *base; + +int notifiers_kobject_create(struct tunable_atomic_notifier_head *nh, + struct tunable_atomic_notifier_block *n, char *name) +{ + int error = -ENOMEM; + struct kobject *kobj = &n->kobj; + + if (!nh->notifier_sub_kset) { + nh->notifier_sub_kset = kset_create_and_add(nh->name, NULL, + notifiers_kobj); + if (!nh->notifier_sub_kset) + goto out; + } + + memset(kobj, 0, sizeof(struct kobject)); + kobj->kset = nh->notifier_sub_kset; + error = kobject_init_and_add(kobj, ¬ifiers_ktype, NULL, "%s", name); + if (error) + kobject_put(kobj); + +out: + return error; +} + +/** + * tunable_atomic_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. + * This function must be called after kmem_cache_init(). + * + * Returns zero on success or %-ENODEV on failure. + */ + +int tunable_atomic_notifier_chain_register( + struct tunable_atomic_notifier_head *nh, + struct tunable_atomic_notifier_block *n, char *name, char *desc) +{ + unsigned long flags; + int ret; + + if (!name) + return -EINVAL; + if (desc) + n->desc = desc; + + if (!notifiers_kobj) { + struct control_file_info *temp, *new; + + temp = kmalloc(sizeof(struct control_file_info), GFP_ATOMIC); + if (!temp) + return -ENOMEM; + temp->nh = nh; + temp->n = n; + temp->name = name; + temp->next = NULL; + if (!base) + base = temp; + else { + new = base; + while (new->next) { + new = new->next; + } + new->next = temp; + } + goto regist; + } + + ret = notifiers_kobject_create(nh, n, name); + if (ret) + return ret; + +regist: + spin_lock_irqsave(&nh->lock, flags); + ret = notifier_chain_register(&nh->head, n->nb); + spin_unlock_irqrestore(&nh->lock, flags); + n->head = nh; + + return ret; +} +EXPORT_SYMBOL_GPL(tunable_atomic_notifier_chain_register); + +/** + * tunable_atomic_notifier_chain_unregister - Remove notifier from a tunable notifier chain + * @nh: Pointer to head of the tunable notifier chain + * @n: Entry to remove from notifier chain + * + * Removes a notifier from a tunable notifier chain. + * + * Retunrns zero on success or %-ENOENT on failure. + */ + +int tunable_atomic_notifier_chain_unregister( + struct tunable_atomic_notifier_head *nh, + struct tunable_atomic_notifier_block *n) +{ + unsigned long flags; + int ret; + + spin_lock_irqsave(&nh->lock, flags); + ret = notifier_chain_unregister(&nh->head, n->nb); + spin_unlock_irqrestore(&nh->lock, flags); + synchronize_rcu(); + + if (ret) + return ret; + + kobject_del(&n->kobj); + kobject_put(&n->kobj); + + return 0; +} +EXPORT_SYMBOL_GPL(tunable_atomic_notifier_chain_unregister); + +/** + * __tunable_atomic_notifier_call_chain - Call functions in a tunable notifier chain + * @nh: Pointer to head of the tunable notifier chain + * @val: Value passed unmodified to notifier function + * @v: Pointer passed unmodified to notifier function + * @nr_to_call: See the comment for notifier_call_chain + * @nr_calls: See the comment for notifier_call_chain + * + * Calls each function in a notifier chain in turn. The functions + * run in an atomic context, so they must not block. + * This routine uses RCU to synchronize with changes to the chain. + * + * If the return value of the notifier can be and'ed + * with %NOTIFY_STOP_MASK then tunable_atomic_notifier_call_chain() + * will return immediately, with the return value of + * the notifier function which halted execution. + * Otherwise the return value is the return value + * of the last notifier function called. + */ + +int __kprobes __tunable_atomic_notifier_call_chain( + struct tunable_atomic_notifier_head *nh, + unsigned long val, void *v, + int nr_to_call, int *nr_calls) +{ + int ret; + + rcu_read_lock(); + ret = notifier_call_chain(&nh->head, val, v, nr_to_call, nr_calls); + rcu_read_unlock(); + return ret; +} +EXPORT_SYMBOL_GPL(__tunable_atomic_notifier_call_chain); + +int __kprobes tunable_atomic_notifier_call_chain( + struct tunable_atomic_notifier_head *nh, + unsigned long val, void *v) +{ + return __tunable_atomic_notifier_call_chain(nh, val, v, -1, NULL); +} +EXPORT_SYMBOL_GPL(tunable_atomic_notifier_call_chain); + +int __init tunable_atomic_notifier_init(void) { + struct control_file_info *prev, *temp = base; + struct tunable_atomic_notifier_head *nh; + struct tunable_atomic_notifier_block *n; + char *name; + int error; + + notifiers_kobj = kobject_create_and_add("notifiers", kernel_kobj); + + if (!notifiers_kobj) + return -ENOMEM; + + while (temp) { + nh = temp->nh; + n = temp->n; + name = temp->name; + + error = notifiers_kobject_create(nh, n, name); + if (error) + printk("%s: %s is failed to create. err = %d\n", + nh->name, name, error); + prev = temp; + temp = temp->next; + kfree(prev); + } + return 0; +} + +/* * Raw notifier chain routines. There is no protection; * the caller must provide it. Use at your own risk! */ --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From t-nagano@ah.jp.nec.com Fri Apr 11 00:56:06 2008 Received: with ECARTIS (v1.0.0; list kdb); Fri, 11 Apr 2008 01:03:18 -0700 (PDT) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3B7u5JB012717 for ; Fri, 11 Apr 2008 00:56:05 -0700 X-ASG-Debug-ID: 1207900601-661d01490000-sLlkUa X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo201.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E37E29B2BF1 for ; Fri, 11 Apr 2008 00:56:41 -0700 (PDT) Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by cuda.sgi.com with ESMTP id FAE8opfSnbcQDUy5 for ; Fri, 11 Apr 2008 00:56:41 -0700 (PDT) Received: from mailgate3.nec.co.jp (mailgate54B.nec.co.jp [10.7.69.195]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m3B7rwas015228; Fri, 11 Apr 2008 16:53:58 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m3B7rw219511; Fri, 11 Apr 2008 16:53:58 +0900 (JST) Received: from mailsv.linux.bs1.fc.nec.co.jp (mailsv.linux.bs1.fc.nec.co.jp [10.34.125.2]) by mailsv4.nec.co.jp (8.13.8/8.13.4) with ESMTP id m3B7rvTs001104; Fri, 11 Apr 2008 16:53:57 +0900 (JST) Received: from [10.34.125.197] (T-NAGANO-AH1.linux.bs1.fc.nec.co.jp [10.34.125.197]) by mailsv.linux.bs1.fc.nec.co.jp (Postfix) with ESMTP id 61EB9E4829A; Fri, 11 Apr 2008 16:53:57 +0900 (JST) Message-ID: <47FF1915.6030102@ah.jp.nec.com> Date: Fri, 11 Apr 2008 16:53:57 +0900 From: Takenori Nagano User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: linux-kernel@vger.kernel.org, Andrew Morton CC: kdb@oss.sgi.com, vgoyal@in.ibm.com, "Eric W. Biederman" , k-miyoshi@cb.jp.nec.com, kexec@lists.infradead.org, Bernhard Walle , Keith Owens , nickpiggin@yahoo.com.au, Randy Dunlap , greg@kroah.com X-ASG-Orig-Subj: [PATCH 2/2] implement new notifier function to panic_notifier_list ,take3 Subject: [PATCH 2/2] implement new notifier function to panic_notifier_list ,take3 References: <47FF0EA5.8090804@ah.jp.nec.com> In-Reply-To: <47FF0EA5.8090804@ah.jp.nec.com> Content-type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 8bit X-Barracuda-Connect: TYO201.gate.nec.co.jp[202.32.8.193] X-Barracuda-Start-Time: 1207900602 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.82 X-Barracuda-Spam-Status: No, SCORE=-1.82 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615 X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.47461 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-archive-position: 1338 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: t-nagano@ah.jp.nec.com Precedence: bulk X-list: kdb 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 --- diff -uprN linux-2.6.25-rc8-mm1.orig/arch/alpha/kernel/setup.c linux-2.6.25-rc8-mm1/arch/alpha/kernel/setup.c --- linux-2.6.25-rc8-mm1.orig/arch/alpha/kernel/setup.c 2008-04-02 04:44:26.000000000 +0900 +++ linux-2.6.25-rc8-mm1/arch/alpha/kernel/setup.c 2008-04-10 21:30:16.143555075 +0900 @@ -44,14 +44,18 @@ #include #include -extern struct atomic_notifier_head panic_notifier_list; +extern struct tunable_atomic_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_atomic_notifier_block alpha_panic_block = { + .nb = &alpha_panic_block_base +}; + #include #include #include @@ -521,8 +525,8 @@ setup_arch(char **cmdline_p) } /* Register a call for panic conditions. */ - atomic_notifier_chain_register(&panic_notifier_list, - &alpha_panic_block); + tunable_atomic_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.25-rc8-mm1.orig/arch/arm/mach-omap1/board-voiceblue.c linux-2.6.25-rc8-mm1/arch/arm/mach-omap1/board-voiceblue.c --- linux-2.6.25-rc8-mm1.orig/arch/arm/mach-omap1/board-voiceblue.c 2008-04-02 04:44:26.000000000 +0900 +++ linux-2.6.25-rc8-mm1/arch/arm/mach-omap1/board-voiceblue.c 2008-04-10 22:01:58.275482847 +0900 @@ -226,14 +226,19 @@ static int panic_event(struct notifier_b return NOTIFY_DONE; } -static struct notifier_block panic_block = { +static struct notifier_block panic_block_base = { .notifier_call = panic_event, }; +static struct tunable_atomic_notifier_block panic_block = { + .nb = &panic_block_base +}; + static int __init voiceblue_setup(void) { /* Setup panic notifier */ - atomic_notifier_chain_register(&panic_notifier_list, &panic_block); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &panic_block, "VoiceBlue", NULL); return 0; } diff -uprN linux-2.6.25-rc8-mm1.orig/arch/mips/lasat/setup.c linux-2.6.25-rc8-mm1/arch/mips/lasat/setup.c --- linux-2.6.25-rc8-mm1.orig/arch/mips/lasat/setup.c 2008-04-02 04:44:26.000000000 +0900 +++ linux-2.6.25-rc8-mm1/arch/mips/lasat/setup.c 2008-04-10 21:10:23.147126270 +0900 @@ -106,7 +106,7 @@ static int lasat_panic_prom_monitor(stru return NOTIFY_DONE; } -static struct notifier_block lasat_panic_block[] = +static struct notifier_block lasat_panic_block_base[] = { { .notifier_call = lasat_panic_display, @@ -117,6 +117,18 @@ static struct notifier_block lasat_panic } }; +static struct tunable_atomic_notifier_block lasat_panic_block[] = { + { + .nb = &lasat_panic_block_base[0] + }, { + .nb = &lasat_panic_block_base[1] + } +}; + +static char* notifier_name[] = { + "lasat_panic_display", "lasat_panic_prom_monitor" +}; + void __init plat_time_init(void) { mips_hpt_frequency = lasat_board_info.li_cpu_hz / 2; @@ -134,8 +146,8 @@ void __init plat_mem_setup(void) /* Set up panic notifier */ for (i = 0; i < ARRAY_SIZE(lasat_panic_block); i++) - atomic_notifier_chain_register(&panic_notifier_list, - &lasat_panic_block[i]); + tunable_notifier_chain_register(&panic_notifier_list, + &lasat_panic_block[i], notifier_name[i], NULL); lasat_reboot_setup(); diff -uprN linux-2.6.25-rc8-mm1.orig/arch/mips/sgi-ip22/ip22-reset.c linux-2.6.25-rc8-mm1/arch/mips/sgi-ip22/ip22-reset.c --- linux-2.6.25-rc8-mm1.orig/arch/mips/sgi-ip22/ip22-reset.c 2008-04-02 04:44:26.000000000 +0900 +++ linux-2.6.25-rc8-mm1/arch/mips/sgi-ip22/ip22-reset.c 2008-04-10 22:04:16.570605171 +0900 @@ -226,10 +226,14 @@ static int panic_event(struct notifier_b return NOTIFY_DONE; } -static struct notifier_block panic_block = { +static struct notifier_block panic_block_base = { .notifier_call = panic_event, }; +static struct tunable_atomic_notifier_block panic_block = { + .nb = &panic_block_base +}; + static int __init reboot_setup(void) { int res; @@ -246,7 +250,8 @@ static int __init reboot_setup(void) init_timer(&blink_timer); blink_timer.function = blink_timeout; - atomic_notifier_chain_register(&panic_notifier_list, &panic_block); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &panic_block, "sgi-ip22", NULL); return 0; } diff -uprN linux-2.6.25-rc8-mm1.orig/arch/mips/sgi-ip32/ip32-reset.c linux-2.6.25-rc8-mm1/arch/mips/sgi-ip32/ip32-reset.c --- linux-2.6.25-rc8-mm1.orig/arch/mips/sgi-ip32/ip32-reset.c 2008-04-08 16:37:19.068000000 +0900 +++ linux-2.6.25-rc8-mm1/arch/mips/sgi-ip32/ip32-reset.c 2008-04-10 22:04:37.830470059 +0900 @@ -175,10 +175,14 @@ static int panic_event(struct notifier_b return NOTIFY_DONE; } -static struct notifier_block panic_block = { +static struct notifier_block panic_block_base = { .notifier_call = panic_event, }; +static struct tunable_atomic_notifier_block panic_block = { + .nb = &panic_block_base +}; + static __init int ip32_reboot_setup(void) { /* turn on the green led only */ @@ -193,7 +197,8 @@ static __init int ip32_reboot_setup(void init_timer(&blink_timer); blink_timer.function = blink_timeout; - atomic_notifier_chain_register(&panic_notifier_list, &panic_block); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &panic_block, "sgi-ip32", NULL); if (request_irq(MACEISA_RTC_IRQ, ip32_rtc_int, 0, "rtc", NULL)) panic("Can't allocate MACEISA RTC IRQ"); diff -uprN linux-2.6.25-rc8-mm1.orig/arch/parisc/kernel/pdc_chassis.c linux-2.6.25-rc8-mm1/arch/parisc/kernel/pdc_chassis.c --- linux-2.6.25-rc8-mm1.orig/arch/parisc/kernel/pdc_chassis.c 2008-04-02 04:44:26.000000000 +0900 +++ linux-2.6.25-rc8-mm1/arch/parisc/kernel/pdc_chassis.c 2008-04-10 21:28:22.068278645 +0900 @@ -101,11 +101,14 @@ static int pdc_chassis_panic_event(struc } -static struct notifier_block pdc_chassis_panic_block = { +static struct notifier_block pdc_chassis_panic_block_base = { .notifier_call = pdc_chassis_panic_event, .priority = INT_MAX, }; +static struct tunable_atomic_notifier_block pdc_chassis_panic_block = { + .nb = &pdc_chassis_panic_block_base +}; /** * parisc_reboot_event() - Called by the reboot handler. @@ -144,8 +147,8 @@ void __init parisc_pdc_chassis_init(void PDC_CHASSIS_VER); /* initialize panic notifier chain */ - atomic_notifier_chain_register(&panic_notifier_list, - &pdc_chassis_panic_block); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &pdc_chassis_panic_block, "pdc_chassis", NULL); /* initialize reboot notifier chain */ register_reboot_notifier(&pdc_chassis_reboot_block); diff -uprN linux-2.6.25-rc8-mm1.orig/arch/powerpc/kernel/setup-common.c linux-2.6.25-rc8-mm1/arch/powerpc/kernel/setup-common.c --- linux-2.6.25-rc8-mm1.orig/arch/powerpc/kernel/setup-common.c 2008-04-08 16:37:20.204000000 +0900 +++ linux-2.6.25-rc8-mm1/arch/powerpc/kernel/setup-common.c 2008-04-08 16:32:35.232000000 +0900 @@ -609,14 +609,19 @@ static int ppc_panic_event(struct notifi return NOTIFY_DONE; } -static struct notifier_block ppc_panic_block = { +static struct notifier_block ppc_panic_block_base = { .notifier_call = ppc_panic_event, .priority = INT_MIN /* may not return; must be done last */ }; +static struct tunable_atomic_notifier_block ppc_panic_block = { + .nb = &ppc_panic_block_base +}; + void __init setup_panic(void) { - atomic_notifier_chain_register(&panic_notifier_list, &ppc_panic_block); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &ppc_panic_block, "powerpc", NULL); } #ifdef CONFIG_CHECK_CACHE_COHERENCY diff -uprN linux-2.6.25-rc8-mm1.orig/arch/ppc/platforms/prep_setup.c linux-2.6.25-rc8-mm1/arch/ppc/platforms/prep_setup.c --- linux-2.6.25-rc8-mm1.orig/arch/ppc/platforms/prep_setup.c 2008-04-08 16:37:23.060000000 +0900 +++ linux-2.6.25-rc8-mm1/arch/ppc/platforms/prep_setup.c 2008-04-10 21:31:42.807004709 +0900 @@ -634,12 +634,16 @@ ibm_statusled_panic(struct notifier_bloc return NOTIFY_DONE; } -static struct notifier_block ibm_statusled_block = { +static struct notifier_block ibm_statusled_block_base = { ibm_statusled_panic, NULL, INT_MAX /* try to do it first */ }; +static struct tunable_atomic_notifier_block ibm_statusled_block = { + .nb = &ibm_statusled_block_base +}; + static void ibm_statusled_progress(char *s, unsigned short hex) { @@ -654,8 +658,9 @@ ibm_statusled_progress(char *s, unsigned hex = 0xfff; if (!notifier_installed) { ++notifier_installed; - atomic_notifier_chain_register(&panic_notifier_list, - &ibm_statusled_block); + tunable_atomic_notifier_chain_register( + &panic_notifier_list, &ibm_statusled_block, + "IBM_statusLED", NULL); } } else diff -uprN linux-2.6.25-rc8-mm1.orig/arch/s390/kernel/ipl.c linux-2.6.25-rc8-mm1/arch/s390/kernel/ipl.c --- linux-2.6.25-rc8-mm1.orig/arch/s390/kernel/ipl.c 2008-04-02 04:44:26.000000000 +0900 +++ linux-2.6.25-rc8-mm1/arch/s390/kernel/ipl.c 2008-04-08 16:32:35.232000000 +0900 @@ -1372,11 +1372,15 @@ static int on_panic_notify(struct notifi return NOTIFY_OK; } -static struct notifier_block on_panic_nb = { +static struct notifier_block on_panic_nb_base = { .notifier_call = on_panic_notify, .priority = 0, }; +static struct tunable_atomic_notifier_block on_panic_nb = { + .nb = &on_panic_nb_base +}; + void __init setup_ipl(void) { ipl_info.type = get_ipl_type(); @@ -1402,7 +1406,8 @@ void __init setup_ipl(void) /* We have no info to copy */ break; } - atomic_notifier_chain_register(&panic_notifier_list, &on_panic_nb); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &on_panic_nb, "s390_ipl", NULL); } void __init ipl_save_parameters(void) diff -uprN linux-2.6.25-rc8-mm1.orig/arch/sparc64/kernel/sstate.c linux-2.6.25-rc8-mm1/arch/sparc64/kernel/sstate.c --- linux-2.6.25-rc8-mm1.orig/arch/sparc64/kernel/sstate.c 2008-04-02 04:44:26.000000000 +0900 +++ linux-2.6.25-rc8-mm1/arch/sparc64/kernel/sstate.c 2008-04-10 21:32:20.798763557 +0900 @@ -82,11 +82,15 @@ static int sstate_panic_event(struct not return NOTIFY_DONE; } -static struct notifier_block sstate_panic_block = { +static struct notifier_block sstate_panic_block_base = { .notifier_call = sstate_panic_event, .priority = INT_MAX, }; +static struct tunable_atomic_notifier_block sstate_panic_block = { + .nb = &sstate_panic_block_base +}; + void __init sun4v_sstate_init(void) { unsigned long major, minor; @@ -99,6 +103,6 @@ void __init sun4v_sstate_init(void) hv_supports_soft_state = 1; prom_sun4v_guest_soft_state(); - atomic_notifier_chain_register(&panic_notifier_list, - &sstate_panic_block); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &sstate_panic_block, "sstate" ,NULL); } diff -uprN linux-2.6.25-rc8-mm1.orig/arch/um/drivers/mconsole_kern.c linux-2.6.25-rc8-mm1/arch/um/drivers/mconsole_kern.c --- linux-2.6.25-rc8-mm1.orig/arch/um/drivers/mconsole_kern.c 2008-04-02 04:44:26.000000000 +0900 +++ linux-2.6.25-rc8-mm1/arch/um/drivers/mconsole_kern.c 2008-04-08 16:32:35.236000000 +0900 @@ -920,16 +920,20 @@ static int notify_panic(struct notifier_ return 0; } -static struct notifier_block panic_exit_notifier = { +static struct notifier_block panic_exit_notifier_base = { .notifier_call = notify_panic, .next = NULL, .priority = 1 }; +static struct tunable_atomic_notifier_block panic_exit_notifier = { + .nb = &panic_exit_notifier_base +}; + static int add_notifier(void) { - atomic_notifier_chain_register(&panic_notifier_list, - &panic_exit_notifier); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &panic_exit_notifier, "mconsole", NULL); return 0; } diff -uprN linux-2.6.25-rc8-mm1.orig/arch/um/kernel/um_arch.c linux-2.6.25-rc8-mm1/arch/um/kernel/um_arch.c --- linux-2.6.25-rc8-mm1.orig/arch/um/kernel/um_arch.c 2008-04-08 16:37:25.004000000 +0900 +++ linux-2.6.25-rc8-mm1/arch/um/kernel/um_arch.c 2008-04-08 16:32:35.236000000 +0900 @@ -234,12 +234,16 @@ static int panic_exit(struct notifier_bl return 0; } -static struct notifier_block panic_exit_notifier = { +static struct notifier_block panic_exit_notifier_base = { .notifier_call = panic_exit, .next = NULL, .priority = 0 }; +static struct tunable_atomic_notifier_block panic_exit_notifier = { + .nb = &panic_exit_notifier_base +}; + /* Set during early boot */ unsigned long task_size; EXPORT_SYMBOL(task_size); @@ -357,8 +361,8 @@ int __init linux_main(int argc, char **a printf("Kernel virtual memory size shrunk to %lu bytes\n", virtmem_size); - atomic_notifier_chain_register(&panic_notifier_list, - &panic_exit_notifier); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &panic_exit_notifier, "um", NULL); uml_postsetup(); diff -uprN linux-2.6.25-rc8-mm1.orig/arch/x86/lguest/boot.c linux-2.6.25-rc8-mm1/arch/x86/lguest/boot.c --- linux-2.6.25-rc8-mm1.orig/arch/x86/lguest/boot.c 2008-04-02 04:44:26.000000000 +0900 +++ linux-2.6.25-rc8-mm1/arch/x86/lguest/boot.c 2008-04-08 16:32:35.236000000 +0900 @@ -820,17 +820,22 @@ static int lguest_panic(struct notifier_ return NOTIFY_DONE; } -static struct notifier_block paniced = { +static struct notifier_block paniced_base = { .notifier_call = lguest_panic }; +static struct tunable_atomic_notifier_block paniced = { + .nb = = &paniced_base +}; + /* Setting up memory is fairly easy. */ static __init char *lguest_memory_setup(void) { /* We do this here and not earlier because lockcheck used to barf if we * did it before start_kernel(). I think we fixed that, so it'd be * nice to move it back to lguest_init. Patch welcome... */ - atomic_notifier_chain_register(&panic_notifier_list, &paniced); + tunable_atomic_notifier_chain_register(&panic_notifier_list, &paniced, + "lguest", NULL); /* The Linux bootloader header contains an "e820" memory map: the * Launcher populated the first entry with our memory limit. */ diff -uprN linux-2.6.25-rc8-mm1.orig/arch/xtensa/platforms/iss/setup.c linux-2.6.25-rc8-mm1/arch/xtensa/platforms/iss/setup.c --- linux-2.6.25-rc8-mm1.orig/arch/xtensa/platforms/iss/setup.c 2008-04-02 04:44:26.000000000 +0900 +++ linux-2.6.25-rc8-mm1/arch/xtensa/platforms/iss/setup.c 2008-04-10 21:33:24.422359602 +0900 @@ -98,13 +98,18 @@ iss_panic_event(struct notifier_block *t return NOTIFY_DONE; } -static struct notifier_block iss_panic_block = { +static struct notifier_block iss_panic_block_base = { iss_panic_event, NULL, 0 }; +static struct tunable_atomic_notifier_block iss_panic_block = { + .nb = &iss_panic_block_base +}; + void __init platform_setup(char **p_cmdline) { - atomic_notifier_chain_register(&panic_notifier_list, &iss_panic_block); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &iss_panic_block, "iss_panic", NULL); } diff -uprN linux-2.6.25-rc8-mm1.orig/drivers/char/ipmi/ipmi_msghandler.c linux-2.6.25-rc8-mm1/drivers/char/ipmi/ipmi_msghandler.c --- linux-2.6.25-rc8-mm1.orig/drivers/char/ipmi/ipmi_msghandler.c 2008-04-08 16:37:33.228000000 +0900 +++ linux-2.6.25-rc8-mm1/drivers/char/ipmi/ipmi_msghandler.c 2008-04-08 16:32:35.240000000 +0900 @@ -4235,12 +4235,16 @@ static int panic_event(struct notifier_b return NOTIFY_DONE; } -static struct notifier_block panic_block = { +static struct notifier_block panic_block_base = { .notifier_call = panic_event, .next = NULL, .priority = 200 /* priority: INT_MAX >= x >= 0 */ }; +static struct tunable_atomic_notifier_block panic_block = { + .nb = &panic_block_base +}; + static int ipmi_init_msghandler(void) { int rv; @@ -4270,7 +4274,8 @@ static int ipmi_init_msghandler(void) setup_timer(&ipmi_timer, ipmi_timeout, 0); mod_timer(&ipmi_timer, jiffies + IPMI_TIMEOUT_JIFFIES); - atomic_notifier_chain_register(&panic_notifier_list, &panic_block); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &panic_block, "ipmi_msghandler", NULL); initialized = 1; @@ -4290,7 +4295,8 @@ static __exit void cleanup_ipmi(void) if (!initialized) return; - atomic_notifier_chain_unregister(&panic_notifier_list, &panic_block); + tunable_atomic_notifier_chain_unregister(&panic_notifier_list, + &panic_block); /* * This can't be called if any interfaces exist, so no worry diff -uprN linux-2.6.25-rc8-mm1.orig/drivers/char/ipmi/ipmi_watchdog.c linux-2.6.25-rc8-mm1/drivers/char/ipmi/ipmi_watchdog.c --- linux-2.6.25-rc8-mm1.orig/drivers/char/ipmi/ipmi_watchdog.c 2008-04-08 16:37:33.240000000 +0900 +++ linux-2.6.25-rc8-mm1/drivers/char/ipmi/ipmi_watchdog.c 2008-04-08 16:32:35.240000000 +0900 @@ -1157,12 +1157,15 @@ static int wdog_panic_handler(struct not return NOTIFY_OK; } -static struct notifier_block wdog_panic_notifier = { +static struct notifier_block wdog_panic_notifier_base = { .notifier_call = wdog_panic_handler, .next = NULL, .priority = 150 /* priority: INT_MAX >= x >= 0 */ }; +static struct tunable_atomic_notifier_block wdog_panic_notifier = { + .nb = &wdog_panic_notifier_base +}; static void ipmi_new_smi(int if_num, struct device *device) { @@ -1302,8 +1305,8 @@ static int __init ipmi_wdog_init(void) check_parms(); register_reboot_notifier(&wdog_reboot_notifier); - atomic_notifier_chain_register(&panic_notifier_list, - &wdog_panic_notifier); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &wdog_panic_notifier, "ipmi_wdog", NULL); rv = ipmi_smi_watcher_register(&smi_watcher); if (rv) { @@ -1311,8 +1314,8 @@ static int __init ipmi_wdog_init(void) if (nmi_handler_registered) unregister_die_notifier(&ipmi_nmi_handler); #endif - atomic_notifier_chain_unregister(&panic_notifier_list, - &wdog_panic_notifier); + tunable_atomic_notifier_chain_unregister(&panic_notifier_list, + &wdog_panic_notifier); unregister_reboot_notifier(&wdog_reboot_notifier); printk(KERN_WARNING PFX "can't register smi watcher\n"); return rv; @@ -1333,8 +1336,8 @@ static void __exit ipmi_wdog_exit(void) unregister_die_notifier(&ipmi_nmi_handler); #endif - atomic_notifier_chain_unregister(&panic_notifier_list, - &wdog_panic_notifier); + tunable_atomic_notifier_chain_unregister(&panic_notifier_list, + &wdog_panic_notifier); unregister_reboot_notifier(&wdog_reboot_notifier); } module_exit(ipmi_wdog_exit); diff -uprN linux-2.6.25-rc8-mm1.orig/drivers/misc/ibmasm/heartbeat.c linux-2.6.25-rc8-mm1/drivers/misc/ibmasm/heartbeat.c --- linux-2.6.25-rc8-mm1.orig/drivers/misc/ibmasm/heartbeat.c 2008-04-08 16:37:35.952000000 +0900 +++ linux-2.6.25-rc8-mm1/drivers/misc/ibmasm/heartbeat.c 2008-04-10 21:34:19.254011678 +0900 @@ -48,17 +48,22 @@ static int panic_happened(struct notifie return 0; } -static struct notifier_block panic_notifier = { panic_happened, NULL, 1 }; +static struct notifier_block panic_notifier_base = { panic_happened, NULL, 1 }; + +static struct tunable_atomic_notifier_block panic_notifier = { + .nb = &panic_notifier_base +}; void ibmasm_register_panic_notifier(void) { - atomic_notifier_chain_register(&panic_notifier_list, &panic_notifier); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &panic_notifier, "ibmasm", NULL); } void ibmasm_unregister_panic_notifier(void) { - atomic_notifier_chain_unregister(&panic_notifier_list, - &panic_notifier); + tunable_atomic_notifier_chain_unregister(&panic_notifier_list, + &panic_notifier); } diff -uprN linux-2.6.25-rc8-mm1.orig/drivers/parisc/power.c linux-2.6.25-rc8-mm1/drivers/parisc/power.c --- linux-2.6.25-rc8-mm1.orig/drivers/parisc/power.c 2008-04-02 04:44:26.000000000 +0900 +++ linux-2.6.25-rc8-mm1/drivers/parisc/power.c 2008-04-10 21:34:44.089854095 +0900 @@ -189,11 +189,14 @@ static int parisc_panic_event(struct not return NOTIFY_DONE; } -static struct notifier_block parisc_panic_block = { +static struct notifier_block parisc_panic_block_base = { .notifier_call = parisc_panic_event, .priority = INT_MAX, }; +static struct tunable_atomic_notifier_block parisc_panic_block = { + .nb = &parisc_panic_block_base +}; static int __init power_init(void) { @@ -231,8 +234,8 @@ static int __init power_init(void) } /* Register a call for panic conditions. */ - atomic_notifier_chain_register(&panic_notifier_list, - &parisc_panic_block); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &parisc_panic_block, "parisc_panic", NULL); return 0; } @@ -241,8 +244,8 @@ static void __exit power_exit(void) { kthread_stop(power_task); - atomic_notifier_chain_unregister(&panic_notifier_list, - &parisc_panic_block); + tunable_atomic_notifier_chain_unregister(&panic_notifier_list, + &parisc_panic_block); pdc_soft_power_button(0); } diff -uprN linux-2.6.25-rc8-mm1.orig/include/linux/kernel.h linux-2.6.25-rc8-mm1/include/linux/kernel.h --- linux-2.6.25-rc8-mm1.orig/include/linux/kernel.h 2008-04-08 16:37:43.508000000 +0900 +++ linux-2.6.25-rc8-mm1/include/linux/kernel.h 2008-04-08 16:32:35.244000000 +0900 @@ -129,7 +129,7 @@ extern int _cond_resched(void); (__x < 0) ? -__x : __x; \ }) -extern struct atomic_notifier_head panic_notifier_list; +extern struct tunable_atomic_notifier_head panic_notifier_list; extern long (*panic_blink)(long time); NORET_TYPE void panic(const char * fmt, ...) __attribute__ ((NORET_AND format (printf, 1, 2))) __cold; diff -uprN linux-2.6.25-rc8-mm1.orig/kernel/panic.c linux-2.6.25-rc8-mm1/kernel/panic.c --- linux-2.6.25-rc8-mm1.orig/kernel/panic.c 2008-04-08 16:37:44.916000000 +0900 +++ linux-2.6.25-rc8-mm1/kernel/panic.c 2008-04-08 16:32:35.248000000 +0900 @@ -30,7 +30,7 @@ static DEFINE_SPINLOCK(pause_on_oops_loc int panic_timeout; -ATOMIC_NOTIFIER_HEAD(panic_notifier_list); +TUNABLE_ATOMIC_NOTIFIER_HEAD(panic_notifier_list, "panic_notifier_list"); EXPORT_SYMBOL(panic_notifier_list); @@ -98,7 +98,7 @@ NORET_TYPE void panic(const char * fmt, smp_send_stop(); #endif - atomic_notifier_call_chain(&panic_notifier_list, 0, buf); + tunable_atomic_notifier_call_chain(&panic_notifier_list, 0, buf); if (!panic_blink) panic_blink = no_blink; diff -uprN linux-2.6.25-rc8-mm1.orig/kernel/softlockup.c linux-2.6.25-rc8-mm1/kernel/softlockup.c --- linux-2.6.25-rc8-mm1.orig/kernel/softlockup.c 2008-04-02 04:44:26.000000000 +0900 +++ linux-2.6.25-rc8-mm1/kernel/softlockup.c 2008-04-08 16:32:35.248000000 +0900 @@ -35,8 +35,12 @@ softlock_panic(struct notifier_block *th return NOTIFY_DONE; } -static struct notifier_block panic_block = { - .notifier_call = softlock_panic, +static struct notifier_block panic_block_base = { + .notifier_call = softlock_panic +}; + +static struct tunable_atomic_notifier_block panic_block = { + .nb = &panic_block_base }; /* @@ -310,5 +314,6 @@ __init void spawn_softlockup_task(void) cpu_callback(&cpu_nfb, CPU_ONLINE, cpu); register_cpu_notifier(&cpu_nfb); - atomic_notifier_chain_register(&panic_notifier_list, &panic_block); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &panic_block, "softlockup", NULL); } --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From t-nagano@ah.jp.nec.com Fri Apr 11 01:02:33 2008 Received: with ECARTIS (v1.0.0; list kdb); Fri, 11 Apr 2008 01:09:43 -0700 (PDT) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3B82Wll013674 for ; Fri, 11 Apr 2008 01:02:33 -0700 X-ASG-Debug-ID: 1207900990-560d025e0000-sLlkUa X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo200.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 549DC9B2C70 for ; Fri, 11 Apr 2008 01:03:10 -0700 (PDT) Received: from tyo200.gate.nec.co.jp (TYO200.gate.nec.co.jp [210.143.35.50]) by cuda.sgi.com with ESMTP id xfZmZqRiq6Yeqp32 for ; Fri, 11 Apr 2008 01:03:10 -0700 (PDT) Received: from tyo201.gate.nec.co.jp ([10.7.69.201]) by tyo200.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m3B8300x000347; Fri, 11 Apr 2008 17:03:06 +0900 (JST) Received: from mailgate3.nec.co.jp (mailgate54B.nec.co.jp [10.7.69.195]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m3B7rmjG014811; Fri, 11 Apr 2008 16:53:48 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m3B7rmM19351; Fri, 11 Apr 2008 16:53:48 +0900 (JST) Received: from mailsv.linux.bs1.fc.nec.co.jp (mailsv.linux.bs1.fc.nec.co.jp [10.34.125.2]) by mailsv4.nec.co.jp (8.13.8/8.13.4) with ESMTP id m3B7rlNo000718; Fri, 11 Apr 2008 16:53:47 +0900 (JST) Received: from [10.34.125.197] (T-NAGANO-AH1.linux.bs1.fc.nec.co.jp [10.34.125.197]) by mailsv.linux.bs1.fc.nec.co.jp (Postfix) with ESMTP id CD98CE4829A; Fri, 11 Apr 2008 16:53:47 +0900 (JST) Message-ID: <47FF190B.6030406@ah.jp.nec.com> Date: Fri, 11 Apr 2008 16:53:47 +0900 From: Takenori Nagano User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: linux-kernel@vger.kernel.org, Andrew Morton CC: kdb@oss.sgi.com, vgoyal@in.ibm.com, "Eric W. Biederman" , k-miyoshi@cb.jp.nec.com, kexec@lists.infradead.org, Bernhard Walle , Keith Owens , nickpiggin@yahoo.com.au, Randy Dunlap , greg@kroah.com X-ASG-Orig-Subj: [PATCH 0/2] add new notifier function ,take3 Subject: [PATCH 0/2] add new notifier function ,take3 Content-type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 8bit X-Barracuda-Connect: TYO200.gate.nec.co.jp[210.143.35.50] X-Barracuda-Start-Time: 1207900991 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.47461 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-archive-position: 1339 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: t-nagano@ah.jp.nec.com Precedence: bulk X-list: kdb Hi, A big thanks to everybody who read and replied to previous version. changelog take2 -> take3 - Rebased 2.6.25-rc8-mm1 - comment updated - renamed the notifiner name "tunable_notifier" to "tunable_atomic_notifier" - fixed typo - move control files debugfs to /sys/kernel These patches add new notifier function and implement it to panic_notifier_list. We used the hardcoded notifier chain so far, but it was not flexible. New notifier is very flexible, because user can change a list of order by control files. Example) # cd /sys/kernel/notifiers/ # ls panic_notifier_list # cd panic_notifier_list/ # ls ipmi_msghandler ipmi_wdog # insmod notifier_test.ko # ls ipmi_msghandler ipmi_wdog notifier_test1 notifier_test2 # cat */priority 200 150 500 1000 Kernel panic - not syncing: Panic by panic_module. __tunable_atomic_notifier_call_chain enter notifier_test: notifier_test_panic2() is called. notifier_test: notifier_test_panic() is called. msg_handler:panic_event was called. ipmi_wdog:wdog_panic_handler was called. .....(reboot) # cd /sys/kernel/notifiers/panic_notifier_list/ # ls ipmi_msghandler ipmi_wdog notifier_test1 notifier_test2 # cat */priority 200 150 500 1000 # echo 10000 > ipmi_msghandler/priority # echo 5000 > ipmi_wdog/priority # echo 3000 > notifier_test1/priority # echo 1500 > notifier_test2/priority # cat */priority 10000 5000 3000 1500 Kernel panic - not syncing: Panic by panic_module. __tunable_atomic_notifier_call_chain enter msg_handler:panic_event was called. ipmi_wdog:wdog_panic_handler was called. notifier_test: notifier_test_panic() is called. notifier_test: notifier_test_panic2() is called. -- Takenori Nagano --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From bwalle@suse.de Mon Apr 14 07:45:31 2008 Received: with ECARTIS (v1.0.0; list kdb); Mon, 14 Apr 2008 07:45:40 -0700 (PDT) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3EEjUIL028814 for ; Mon, 14 Apr 2008 07:45:31 -0700 X-ASG-Debug-ID: 1208184369-168d03be0000-sLlkUa X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.suse.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 56B8B9CC71A for ; Mon, 14 Apr 2008 07:46:09 -0700 (PDT) Received: from mx1.suse.de (ns1.suse.de [195.135.220.2]) by cuda.sgi.com with ESMTP id 13PYoYUetvMJGfvI for ; Mon, 14 Apr 2008 07:46:09 -0700 (PDT) X-ASG-Whitelist: Client Received: from Relay1.suse.de (relay-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 01850405D5; Mon, 14 Apr 2008 16:46:07 +0200 (CEST) Date: Mon, 14 Apr 2008 16:46:34 +0200 From: Bernhard Walle To: Neil Horman Cc: Vivek Goyal , Andrew Morton , nickpiggin@yahoo.com.au, k-miyoshi@cb.jp.nec.com, greg@kroah.com, kdb@oss.sgi.com, kexec@lists.infradead.org, Takenori Nagano , linux-kernel@vger.kernel.org, Randy Dunlap , "Eric W. Biederman" , Keith Owens X-ASG-Orig-Subj: Re: [PATCH 0/2] add new notifier function ,take3 Subject: Re: [PATCH 0/2] add new notifier function ,take3 Message-ID: <20080414164634.190e3e0e@strauss.suse.de> In-Reply-To: <20080414144228.GD1193@hmsendeavour.rdu.redhat.com> References: <47FF190B.6030406@ah.jp.nec.com> <20080411210751.e4a468b2.akpm@linux-foundation.org> <20080414134622.GB6941@redhat.com> <20080414144228.GD1193@hmsendeavour.rdu.redhat.com> Organization: SUSE Linux Products GmbH X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.9; x86_64-suse-linux-gnu) Mime-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit X-Barracuda-Connect: ns1.suse.de[195.135.220.2] X-Barracuda-Start-Time: 1208184370 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-archive-position: 1340 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: bwalle@suse.de Precedence: bulk X-list: kdb * Neil Horman [2008-04-14 10:42]: > > I know it doesn't particularly relate to this patch, but FWIW, for cases like > failover, I've inserted infrastrucutre in the userspace part of kdump for > Fedora/RHEL to support this sort of thing. We can run arbitrary scripts righte > before and after a capture so that notifications can be sent to remote nodes in > a much safer fashion than using the notifier chain after a panic. But that doesn't help if you want to use a debugger (KDB, KGDB). Bernhard --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From t-nagano@ah.jp.nec.com Wed Apr 16 22:31:37 2008 Received: with ECARTIS (v1.0.0; list kdb); Wed, 16 Apr 2008 22:32:06 -0700 (PDT) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3H5VZeY016289 for ; Wed, 16 Apr 2008 22:31:37 -0700 X-ASG-Debug-ID: 1208410327-778c00d00000-sLlkUa X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo202.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D233EA17FD9 for ; Wed, 16 Apr 2008 22:32:07 -0700 (PDT) Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by cuda.sgi.com with ESMTP id 1aUTkMTgsN4zMoXr for ; Wed, 16 Apr 2008 22:32:07 -0700 (PDT) Received: from mailgate3.nec.co.jp (mailgate54.nec.co.jp [10.7.69.197]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m3H5VcYj013263; Thu, 17 Apr 2008 14:31:38 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m3H5Vca01615; Thu, 17 Apr 2008 14:31:38 +0900 (JST) Received: from mailsv.linux.bs1.fc.nec.co.jp (mailsv.linux.bs1.fc.nec.co.jp [10.34.125.2]) by mailsv3.nec.co.jp (8.13.8/8.13.4) with ESMTP id m3H5Vc3s017248; Thu, 17 Apr 2008 14:31:38 +0900 (JST) Received: from [10.34.125.197] (T-NAGANO-AH1.linux.bs1.fc.nec.co.jp [10.34.125.197]) by mailsv.linux.bs1.fc.nec.co.jp (Postfix) with ESMTP id 62C97E480FD; Thu, 17 Apr 2008 14:31:38 +0900 (JST) Message-ID: <4806E0BA.3020209@ah.jp.nec.com> Date: Thu, 17 Apr 2008 14:31:38 +0900 From: Takenori Nagano User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: Andrew Morton , vgoyal@redhat.com CC: Neil Horman , nickpiggin@yahoo.com.au, k-miyoshi@cb.jp.nec.com, greg@kroah.com, bwalle@suse.de, kdb@oss.sgi.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, rdunlap@xenotime.net, ebiederm@xmission.com, kaos@ocs.com.au X-ASG-Orig-Subj: Re: [PATCH 0/2] add new notifier function ,take3 Subject: Re: [PATCH 0/2] add new notifier function ,take3 References: <47FF190B.6030406@ah.jp.nec.com> <20080411210751.e4a468b2.akpm@linux-foundation.org> <20080414134622.GB6941@redhat.com> <20080414144228.GD1193@hmsendeavour.rdu.redhat.com> <20080414145323.GE6941@redhat.com> <20080414160146.GE1193@hmsendeavour.rdu.redhat.com> <20080414123311.01d537b4.akpm@linux-foundation.org> In-Reply-To: <20080414123311.01d537b4.akpm@linux-foundation.org> Content-type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 8bit X-Barracuda-Connect: TYO202.gate.nec.co.jp[202.32.8.206] X-Barracuda-Start-Time: 1208410335 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.48008 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-archive-position: 1341 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: t-nagano@ah.jp.nec.com Precedence: bulk X-list: kdb Andrew Morton wrote: > On Mon, 14 Apr 2008 12:01:46 -0400 > Neil Horman wrote: > >> On Mon, Apr 14, 2008 at 10:53:23AM -0400, Vivek Goyal wrote: >>> On Mon, Apr 14, 2008 at 10:42:28AM -0400, Neil Horman wrote: >>>> On Mon, Apr 14, 2008 at 09:46:22AM -0400, Vivek Goyal wrote: >>>>> On Fri, Apr 11, 2008 at 09:07:51PM -0700, Andrew Morton wrote: >>>>> >>>>> [..] >>>>>>> Kernel panic - not syncing: Panic by panic_module. >>>>>>> __tunable_atomic_notifier_call_chain enter >>>>>>> msg_handler:panic_event was called. >>>>>>> ipmi_wdog:wdog_panic_handler was called. >>>>>>> notifier_test: notifier_test_panic() is called. >>>>>>> notifier_test: notifier_test_panic2() is called. >>>>>> OK. But I don't see anywhere in here the most important piece of >>>>>> information: why do we need this feature in Linux? >>>>>> >>>>>> What are the use-cases? What is the value? etc. >>>>>> >>>>>> Often I can guess (but I like the originator to remove the guesswork). In >>>>>> this case I'm stumped - I can't see any reason why anyone would want this. >>>>>> >>>>> Hi Andrew, >>>>> >>>>> To begin with, he wants kdb, kgdb etc to co-exist with kdump. He wants >>>>> to put all the RAS tools (who are interested in panic event) on a list >>>>> and export it to user space and let user decide in what order do the tool get >>>>> executed at panic time (based on priority). >>>>> >>>>> This brings in little bit reliability concerns for kdump due to notifier >>>>> code being run after panic. >>>>> >>>>> I think people want to use this infrastrutucure beyond RAS tools. I >>>>> remember somebody wanting to send a message to remote node after a >>>>> panic (before kdump kicks in) so that remote node can initiate failover >>>>> etc. >>>>> >>>> I know it doesn't particularly relate to this patch, but FWIW, for cases like >>>> failover, I've inserted infrastrucutre in the userspace part of kdump for >>>> Fedora/RHEL to support this sort of thing. We can run arbitrary scripts righte >>>> before and after a capture so that notifications can be sent to remote nodes in >>>> a much safer fashion than using the notifier chain after a panic. >>>> Neil >>>> >>> That's great. I did not know about these. So user can write custom >>> scripts/binaries which can be packed into kdump initrd and executed either >>> before or after dump capture? Any idea, if somebody has started using it >>> already? >>> >> Thats exactly right. I'm not sure if there is any serious use as of yet, but >> I've had some interrogatories about it. Specific cases that I recall include: >> >> 1) A set of users in japan that are using the pre-dump script to block execution >> until a scsi controller detects all its drives (it apparently takes up to three >> minues to scan its bus) >> >> 2) I think some people using clustering services were using the pre-script to >> notify cluster peers of the failure to avoid power fencing while a node >> completed the crash dump >> >> 3) A national lab had an interest in using the pre script to send an email to an >> administrative address to log the failure in a cluster >> > > OK, thanks. > > I think I'll duck the patch for now as it seems that a littlee more thought > and coordination is neeed. > > Plus it appears that the only users of this infrastructure are provided via > presently-out-of-tree patches, so people who are already patching and > building their own kernels can easily add this other patch as well, for now. > > Hi, The one of the reason why I want this functionality is managing RAS tool behavior for postmotem actions, initially from kdb invocation. (I used kdb for debugging and crash analysis very useful in lkcd days, but it is "want" and it is not "must" today ;-)) The other postmotem action is disabling hardware watchdog. Watch dog handler would stop keepalive heartbeat when system panics and we must disable hardware watchdog as soon as possible, since 2nd kernel startup takes some time (10 or 100? secs) and there may be miss-firing window. But currently we have no chance to do anything before crash_exec(). And thinking about a clustering software. If the system encounter the panic, system must notify standby node. But... :-( I am interested in pre-dump scripts Neil mentioned. I think it can resolve some of our requirements. I will try it. For quick invocation of kdump, I partially agree with the idea of "kdump should be invoked as soon as system panic, since we can not trust broken kernels", but we would like to have some choise what to do on panic (and if notifier is controllable by my patch, you can still call kdump first) Anyway, completely broken kernel can not call kdump or any other mechanism ;-P and I feel it is somewhat matter of degree. Thanks, Takenori --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From t-nagano@ah.jp.nec.com Wed Apr 23 04:11:28 2008 Received: with ECARTIS (v1.0.0; list kdb); Wed, 23 Apr 2008 04:12:00 -0700 (PDT) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3NBBQBS016117 for ; Wed, 23 Apr 2008 04:11:28 -0700 X-ASG-Debug-ID: 1208949126-188602e00000-sLlkUa X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo202.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B22AF10A8B66 for ; Wed, 23 Apr 2008 04:12:06 -0700 (PDT) Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by cuda.sgi.com with ESMTP id 71EWGV48ciaS9tq5 for ; Wed, 23 Apr 2008 04:12:06 -0700 (PDT) Received: from mailgate3.nec.co.jp (mailgate54.nec.co.jp [10.7.69.197]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m3NBBKAY006247; Wed, 23 Apr 2008 20:11:20 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m3NBBKC17720; Wed, 23 Apr 2008 20:11:20 +0900 (JST) Received: from mailsv.linux.bs1.fc.nec.co.jp (mailsv.linux.bs1.fc.nec.co.jp [10.34.125.2]) by mailsv4.nec.co.jp (8.13.8/8.13.4) with ESMTP id m3NBBJOc011329; Wed, 23 Apr 2008 20:11:19 +0900 (JST) Received: from [10.34.125.197] (T-NAGANO-AH1.linux.bs1.fc.nec.co.jp [10.34.125.197]) by mailsv.linux.bs1.fc.nec.co.jp (Postfix) with ESMTP id D27E9E48245; Wed, 23 Apr 2008 20:11:19 +0900 (JST) Message-ID: <480F1957.2070609@ah.jp.nec.com> Date: Wed, 23 Apr 2008 20:11:19 +0900 From: Takenori Nagano User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: linux-kernel@vger.kernel.org, Andrew Morton CC: kdb@oss.sgi.com, vgoyal@redhat.com, "Eric W. Biederman" , kexec@lists.infradead.org, Keith Owens , Nick Piggin , Randy Dunlap , greg@kroah.com, bwalle@suse.de, k-miyoshi@cb.jp.nec.com X-ASG-Orig-Subj: [PATCH 0/3] add new notifier function ,take4 Subject: [PATCH 0/3] add new notifier function ,take4 Content-type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 8bit X-Barracuda-Connect: TYO202.gate.nec.co.jp[202.32.8.206] X-Barracuda-Start-Time: 1208949128 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.48597 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-archive-position: 1342 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: t-nagano@ah.jp.nec.com Precedence: bulk X-list: kdb Hi, changelog take3 -> take4 - Rebased 2.6.25-mm1 - Add a document - Add kdump on panic_notifier These patches add new notifier function and implement it to panic_notifier_list. We used the hardcoded notifier chain so far, but it was not flexible. New notifier is very flexible, because user can change a list of order by control files. And, third patch moves crash_kexec() to panic_notifier. It helps us to do something before taking a crash dump. It's useful for some RAS tools developer. If you want to use it, you have to set config option DUMP_ON_PANIC_NOTIFIER to Y. Default value of DUMP_ON_PANIC_NOTIFIER is N. If you set DUMP_ON_PANIC_NOTIFIER to N, kdump has no difference before. ------ Example) # cd /sys/kernel/notifiers/ # ls panic_notifier_list # cd panic_notifier_list/ # ls ipmi_msghandler ipmi_wdog # insmod notifier_test.ko # ls ipmi_msghandler ipmi_wdog notifier_test1 notifier_test2 # cat */priority 200 150 500 1000 Kernel panic - not syncing: Panic by panic_module. __tunable_atomic_notifier_call_chain enter notifier_test: notifier_test_panic2() is called. notifier_test: notifier_test_panic() is called. msg_handler:panic_event was called. ipmi_wdog:wdog_panic_handler was called. .....(reboot) # cd /sys/kernel/notifiers/panic_notifier_list/ # ls ipmi_msghandler ipmi_wdog notifier_test1 notifier_test2 # cat */priority 200 150 500 1000 # echo 10000 > ipmi_msghandler/priority # echo 5000 > ipmi_wdog/priority # echo 3000 > notifier_test1/priority # echo 1500 > notifier_test2/priority # cat */priority 10000 5000 3000 1500 Kernel panic - not syncing: Panic by panic_module. __tunable_atomic_notifier_call_chain enter msg_handler:panic_event was called. ipmi_wdog:wdog_panic_handler was called. notifier_test: notifier_test_panic() is called. notifier_test: notifier_test_panic2() is called. -- Takenori Nagano --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From t-nagano@ah.jp.nec.com Wed Apr 23 04:11:32 2008 Received: with ECARTIS (v1.0.0; list kdb); Wed, 23 Apr 2008 04:12:00 -0700 (PDT) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3NBBU3k016123 for ; Wed, 23 Apr 2008 04:11:32 -0700 X-ASG-Debug-ID: 1208949130-195f02fe0000-sLlkUa X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo202.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 408DC10A8B66 for ; Wed, 23 Apr 2008 04:12:10 -0700 (PDT) Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by cuda.sgi.com with ESMTP id DWrJSYUXxfxRC2kR for ; Wed, 23 Apr 2008 04:12:10 -0700 (PDT) Received: from mailgate3.nec.co.jp (mailgate53.nec.co.jp [10.7.69.160]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m3NBBZtr008265; Wed, 23 Apr 2008 20:11:35 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m3NBBZ323684; Wed, 23 Apr 2008 20:11:35 +0900 (JST) Received: from mailsv.linux.bs1.fc.nec.co.jp (mailsv.linux.bs1.fc.nec.co.jp [10.34.125.2]) by mailsv4.nec.co.jp (8.13.8/8.13.4) with ESMTP id m3NBBYPn011480; Wed, 23 Apr 2008 20:11:34 +0900 (JST) Received: from [10.34.125.197] (T-NAGANO-AH1.linux.bs1.fc.nec.co.jp [10.34.125.197]) by mailsv.linux.bs1.fc.nec.co.jp (Postfix) with ESMTP id A7C89E48245; Wed, 23 Apr 2008 20:11:34 +0900 (JST) Message-ID: <480F1966.707@ah.jp.nec.com> Date: Wed, 23 Apr 2008 20:11:34 +0900 From: Takenori Nagano User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: linux-kernel@vger.kernel.org, Andrew Morton CC: kdb@oss.sgi.com, vgoyal@redhat.com, "Eric W. Biederman" , kexec@lists.infradead.org, Keith Owens , Nick Piggin , Randy Dunlap , greg@kroah.com, bwalle@suse.de, k-miyoshi@cb.jp.nec.com X-ASG-Orig-Subj: [PATCH 1/2] add tunable_notifier function ,take4 Subject: [PATCH 1/2] add tunable_notifier function ,take4 References: <480DD85C.7060200@ah.jp.nec.com> In-Reply-To: <480DD85C.7060200@ah.jp.nec.com> Content-type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 8bit X-Barracuda-Connect: TYO202.gate.nec.co.jp[202.32.8.206] X-Barracuda-Start-Time: 1208949131 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.82 X-Barracuda-Spam-Status: No, SCORE=-1.82 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615 X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.48597 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-archive-position: 1343 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: t-nagano@ah.jp.nec.com Precedence: bulk X-list: kdb This patch adds new notifier function tunable_notifier_chain. Its base is atomic_notifier_chain. Thanks, --- Signed-off-by: Takenori Nagano --- diff -uprN linux-2.6.25.orig/Documentation/ABI/testing/sysfs-notifiers linux-2.6.25/Documentation/ABI/testing/sysfs-notifiers --- linux-2.6.25.orig/Documentation/ABI/testing/sysfs-notifiers 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.25/Documentation/ABI/testing/sysfs-notifiers 2008-04-22 17:55:39.142310091 +0900 @@ -0,0 +1,15 @@ +What: /sys/kernel/notifiers///priority +Date: April 2008 +Contact: Takenori Nagano +Description: + The /sys/kernel/notifiers///priority + file controls notifier_block order on notifier. Writing to this + file will insert the notifier_block to appropriate place that is + pointed by new priority. + +What: /sys/kernel/notifiers///description +Date: April 2008 +Contact: Takenori Nagano +Description: + This file shows the description of the notifier_block that + belongs to. It helps to decide the priority value. diff -uprN linux-2.6.25.orig/include/linux/kernel.h linux-2.6.25/include/linux/kernel.h --- linux-2.6.25.orig/include/linux/kernel.h 2008-04-22 20:35:01.239466758 +0900 +++ linux-2.6.25/include/linux/kernel.h 2008-04-21 17:15:59.072648972 +0900 @@ -129,7 +129,7 @@ extern int _cond_resched(void); (__x < 0) ? -__x : __x; \ }) -extern struct atomic_notifier_head panic_notifier_list; +extern struct tunable_atomic_notifier_head panic_notifier_list; extern long (*panic_blink)(long time); NORET_TYPE void panic(const char * fmt, ...) __attribute__ ((NORET_AND format (printf, 1, 2))) __cold; diff -uprN linux-2.6.25.orig/include/linux/notifier.h linux-2.6.25/include/linux/notifier.h --- linux-2.6.25.orig/include/linux/notifier.h 2008-04-22 20:35:01.543464904 +0900 +++ linux-2.6.25/include/linux/notifier.h 2008-04-21 17:15:59.112641471 +0900 @@ -13,6 +13,7 @@ #include #include #include +#include /* * Notifier chains are of four types: @@ -53,6 +54,13 @@ struct notifier_block { int priority; }; +struct tunable_atomic_notifier_block { + struct notifier_block *nb; + struct tunable_atomic_notifier_head *head; + struct kobject kobj; + char *desc; +}; + struct atomic_notifier_head { spinlock_t lock; struct notifier_block *head; @@ -63,6 +71,13 @@ struct blocking_notifier_head { struct notifier_block *head; }; +struct tunable_atomic_notifier_head { + spinlock_t lock; + struct notifier_block *head; + char *name; + struct kset *notifier_sub_kset; +}; + struct raw_notifier_head { struct notifier_block *head; }; @@ -73,6 +88,13 @@ struct srcu_notifier_head { struct notifier_block *head; }; +struct control_file_info { + struct tunable_atomic_notifier_head *nh; + struct tunable_atomic_notifier_block *n; + char *name; + struct control_file_info *next; +}; + #define ATOMIC_INIT_NOTIFIER_HEAD(name) do { \ spin_lock_init(&(name)->lock); \ (name)->head = NULL; \ @@ -81,6 +103,12 @@ struct srcu_notifier_head { init_rwsem(&(name)->rwsem); \ (name)->head = NULL; \ } while (0) +#define TUNABLE_ATOMIC_INIT_NOTIFIER(val1, val2) do { \ + spin_lock_init(&(val1)->lock); \ + (val1)->head = NULL; \ + (val1)->name = val2; \ + (val1)->notifier_sub_kset = NULL; \ + } while (0) #define RAW_INIT_NOTIFIER_HEAD(name) do { \ (name)->head = NULL; \ } while (0) @@ -96,6 +124,11 @@ extern void srcu_init_notifier_head(stru #define BLOCKING_NOTIFIER_INIT(name) { \ .rwsem = __RWSEM_INITIALIZER((name).rwsem), \ .head = NULL } +#define TUNABLE_ATOMIC_NOTIFIER_INIT(val1, val2) { \ + .lock =__SPIN_LOCK_UNLOCKED(val1.lock), \ + .head = NULL, \ + .name = val2, \ + .notifier_sub_kset = NULL } #define RAW_NOTIFIER_INIT(name) { \ .head = NULL } /* srcu_notifier_heads cannot be initialized statically */ @@ -106,6 +139,9 @@ extern void srcu_init_notifier_head(stru #define BLOCKING_NOTIFIER_HEAD(name) \ struct blocking_notifier_head name = \ BLOCKING_NOTIFIER_INIT(name) +#define TUNABLE_ATOMIC_NOTIFIER_HEAD(name, val) \ + struct tunable_atomic_notifier_head name = \ + TUNABLE_ATOMIC_NOTIFIER_INIT(name, val) #define RAW_NOTIFIER_HEAD(name) \ struct raw_notifier_head name = \ RAW_NOTIFIER_INIT(name) @@ -116,6 +152,10 @@ extern int atomic_notifier_chain_registe struct notifier_block *nb); extern int blocking_notifier_chain_register(struct blocking_notifier_head *nh, struct notifier_block *nb); +extern int tunable_atomic_notifier_chain_register( + struct tunable_atomic_notifier_head *nh, + struct tunable_atomic_notifier_block *nb, + char *name, char *desc); extern int raw_notifier_chain_register(struct raw_notifier_head *nh, struct notifier_block *nb); extern int srcu_notifier_chain_register(struct srcu_notifier_head *nh, @@ -129,6 +169,9 @@ extern int atomic_notifier_chain_unregis struct notifier_block *nb); extern int blocking_notifier_chain_unregister(struct blocking_notifier_head *nh, struct notifier_block *nb); +extern int tunable_atomic_notifier_chain_unregister( + struct tunable_atomic_notifier_head *nh, + struct tunable_atomic_notifier_block *nb); extern int raw_notifier_chain_unregister(struct raw_notifier_head *nh, struct notifier_block *nb); extern int srcu_notifier_chain_unregister(struct srcu_notifier_head *nh, @@ -142,6 +185,14 @@ extern int blocking_notifier_call_chain( unsigned long val, void *v); extern int __blocking_notifier_call_chain(struct blocking_notifier_head *nh, unsigned long val, void *v, int nr_to_call, int *nr_calls); +extern int tunable_atomic_notifier_call_chain( + struct tunable_atomic_notifier_head *nh, + unsigned long val, void *v); +extern int __tunable_atomic_notifier_call_chain( + struct tunable_atomic_notifier_head *nh, + unsigned long val, void *v, + int nr_to_call, int *nr_calls); +extern int tunable_atomic_notifier_init(void); extern int raw_notifier_call_chain(struct raw_notifier_head *nh, unsigned long val, void *v); extern int __raw_notifier_call_chain(struct raw_notifier_head *nh, diff -uprN linux-2.6.25.orig/kernel/ksysfs.c linux-2.6.25/kernel/ksysfs.c --- linux-2.6.25.orig/kernel/ksysfs.c 2008-04-17 11:49:44.000000000 +0900 +++ linux-2.6.25/kernel/ksysfs.c 2008-04-21 17:15:59.136648497 +0900 @@ -15,6 +15,7 @@ #include #include #include +#include #define KERNEL_ATTR_RO(_name) \ static struct kobj_attribute _name##_attr = __ATTR_RO(_name) @@ -146,7 +147,10 @@ static int __init ksysfs_init(void) if (error) goto notes_exit; - return 0; + /* create the /sys/kernel/notifiers directory */ + error = tunable_atomic_notifier_init(); + + return error; notes_exit: if (notes_size > 0) diff -uprN linux-2.6.25.orig/kernel/notifier.c linux-2.6.25/kernel/notifier.c --- linux-2.6.25.orig/kernel/notifier.c 2008-04-22 20:35:03.131455216 +0900 +++ linux-2.6.25/kernel/notifier.c 2008-04-21 17:15:59.172648342 +0900 @@ -319,6 +319,261 @@ int blocking_notifier_call_chain(struct EXPORT_SYMBOL_GPL(blocking_notifier_call_chain); /* + * Tunable atomic notifier chain routines. Registration and unregistration + * use a spinlock, and call_chain is synchronized by RCU (no locks). + * User can change the list order to use /sys/kernel/notifiers/list-name/. + */ + +static ssize_t priority_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +{ + struct tunable_atomic_notifier_block *n = container_of(kobj, + struct tunable_atomic_notifier_block, kobj); + + return sprintf(buf, "%d\n", n->nb->priority); +} + +static ssize_t priority_store(struct kobject *kobj, + struct kobj_attribute *attr, const char *buf, size_t size) +{ + struct tunable_atomic_notifier_block *n = container_of(kobj, + struct tunable_atomic_notifier_block, kobj); + struct tunable_atomic_notifier_head *nh = n->head; + unsigned long flags; + int priority, ret; + + sscanf(buf, "%d", &priority); + n->nb->priority = priority; + + spin_lock_irqsave(&nh->lock, flags); + ret = notifier_chain_unregister(&nh->head, n->nb); + if (ret) + goto out_unlock; + ret = notifier_chain_register(&nh->head, n->nb); + +out_unlock: + spin_unlock_irqrestore(&nh->lock, flags); + + return (ret ? ret : size); + +} + +static ssize_t description_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +{ + struct tunable_atomic_notifier_block *n = container_of(kobj, + struct tunable_atomic_notifier_block, kobj); + + if (n->desc) + return sprintf(buf, "%s\n", n->desc); + + return sprintf(buf, "Description is not available\n"); +} + +static struct kobj_attribute priority_attr = + __ATTR(priority, 0644, priority_show, priority_store); +static struct kobj_attribute description_attr = + __ATTR_RO(description); + +static struct attribute *notifiers_attributes[] = { + &priority_attr.attr, &description_attr.attr, NULL +}; + +static struct kobj_type notifiers_ktype = { + .sysfs_ops = &kobj_sysfs_ops, + .default_attrs = notifiers_attributes, +}; + +static struct kobject *notifiers_kobj; +struct control_file_info *base; + +int notifiers_kobject_create(struct tunable_atomic_notifier_head *nh, + struct tunable_atomic_notifier_block *n, char *name) +{ + int error = -ENOMEM; + struct kobject *kobj = &n->kobj; + + if (!nh->notifier_sub_kset) { + nh->notifier_sub_kset = kset_create_and_add(nh->name, NULL, + notifiers_kobj); + if (!nh->notifier_sub_kset) + goto out; + } + + memset(kobj, 0, sizeof(struct kobject)); + kobj->kset = nh->notifier_sub_kset; + error = kobject_init_and_add(kobj, ¬ifiers_ktype, NULL, "%s", name); + if (error) + kobject_put(kobj); + +out: + return error; +} + +/** + * tunable_atomic_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. + * This function must be called after kmem_cache_init(). + * + * Returns zero on success or %-ENODEV on failure. + */ + +int tunable_atomic_notifier_chain_register( + struct tunable_atomic_notifier_head *nh, + struct tunable_atomic_notifier_block *n, char *name, char *desc) +{ + unsigned long flags; + int ret; + + if (!name) + return -EINVAL; + if (desc) + n->desc = desc; + + if (!notifiers_kobj) { + struct control_file_info *temp, *new; + + temp = kmalloc(sizeof(struct control_file_info), GFP_ATOMIC); + if (!temp) + return -ENOMEM; + temp->nh = nh; + temp->n = n; + temp->name = name; + temp->next = NULL; + if (!base) + base = temp; + else { + new = base; + while (new->next) { + new = new->next; + } + new->next = temp; + } + goto regist; + } + + ret = notifiers_kobject_create(nh, n, name); + if (ret) + return ret; + +regist: + spin_lock_irqsave(&nh->lock, flags); + ret = notifier_chain_register(&nh->head, n->nb); + spin_unlock_irqrestore(&nh->lock, flags); + n->head = nh; + + return ret; +} +EXPORT_SYMBOL_GPL(tunable_atomic_notifier_chain_register); + +/** + * tunable_atomic_notifier_chain_unregister - Remove notifier from a tunable notifier chain + * @nh: Pointer to head of the tunable notifier chain + * @n: Entry to remove from notifier chain + * + * Removes a notifier from a tunable notifier chain. + * + * Retunrns zero on success or %-ENOENT on failure. + */ + +int tunable_atomic_notifier_chain_unregister( + struct tunable_atomic_notifier_head *nh, + struct tunable_atomic_notifier_block *n) +{ + unsigned long flags; + int ret; + + spin_lock_irqsave(&nh->lock, flags); + ret = notifier_chain_unregister(&nh->head, n->nb); + spin_unlock_irqrestore(&nh->lock, flags); + synchronize_rcu(); + + if (ret) + return ret; + + kobject_del(&n->kobj); + kobject_put(&n->kobj); + + return 0; +} +EXPORT_SYMBOL_GPL(tunable_atomic_notifier_chain_unregister); + +/** + * __tunable_atomic_notifier_call_chain - Call functions in a tunable notifier chain + * @nh: Pointer to head of the tunable notifier chain + * @val: Value passed unmodified to notifier function + * @v: Pointer passed unmodified to notifier function + * @nr_to_call: See the comment for notifier_call_chain + * @nr_calls: See the comment for notifier_call_chain + * + * Calls each function in a notifier chain in turn. The functions + * run in an atomic context, so they must not block. + * This routine uses RCU to synchronize with changes to the chain. + * + * If the return value of the notifier can be and'ed + * with %NOTIFY_STOP_MASK then tunable_atomic_notifier_call_chain() + * will return immediately, with the return value of + * the notifier function which halted execution. + * Otherwise the return value is the return value + * of the last notifier function called. + */ + +int __kprobes __tunable_atomic_notifier_call_chain( + struct tunable_atomic_notifier_head *nh, + unsigned long val, void *v, + int nr_to_call, int *nr_calls) +{ + int ret; + + rcu_read_lock(); + ret = notifier_call_chain(&nh->head, val, v, nr_to_call, nr_calls); + rcu_read_unlock(); + return ret; +} +EXPORT_SYMBOL_GPL(__tunable_atomic_notifier_call_chain); + +int __kprobes tunable_atomic_notifier_call_chain( + struct tunable_atomic_notifier_head *nh, + unsigned long val, void *v) +{ + return __tunable_atomic_notifier_call_chain(nh, val, v, -1, NULL); +} +EXPORT_SYMBOL_GPL(tunable_atomic_notifier_call_chain); + +int __init tunable_atomic_notifier_init(void) { + struct control_file_info *prev, *temp = base; + struct tunable_atomic_notifier_head *nh; + struct tunable_atomic_notifier_block *n; + char *name; + int error; + + notifiers_kobj = kobject_create_and_add("notifiers", kernel_kobj); + + if (!notifiers_kobj) + return -ENOMEM; + + while (temp) { + nh = temp->nh; + n = temp->n; + name = temp->name; + + error = notifiers_kobject_create(nh, n, name); + if (error) + printk("%s: %s is failed to create. err = %d\n", + nh->name, name, error); + prev = temp; + temp = temp->next; + kfree(prev); + } + return 0; +} + +/* * Raw notifier chain routines. There is no protection; * the caller must provide it. Use at your own risk! */ diff -uprN linux-2.6.25.orig/kernel/panic.c linux-2.6.25/kernel/panic.c --- linux-2.6.25.orig/kernel/panic.c 2008-04-22 20:35:03.147454771 +0900 +++ linux-2.6.25/kernel/panic.c 2008-04-21 17:15:59.208648222 +0900 @@ -30,7 +30,7 @@ static DEFINE_SPINLOCK(pause_on_oops_loc int panic_timeout; -ATOMIC_NOTIFIER_HEAD(panic_notifier_list); +TUNABLE_ATOMIC_NOTIFIER_HEAD(panic_notifier_list, "panic_notifier_list"); EXPORT_SYMBOL(panic_notifier_list); @@ -101,7 +101,7 @@ NORET_TYPE void panic(const char * fmt, smp_send_stop(); #endif - atomic_notifier_call_chain(&panic_notifier_list, 0, buf); + tunable_atomic_notifier_call_chain(&panic_notifier_list, 0, buf); if (!panic_blink) panic_blink = no_blink; --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From t-nagano@ah.jp.nec.com Wed Apr 23 04:12:03 2008 Received: with ECARTIS (v1.0.0; list kdb); Wed, 23 Apr 2008 04:12:15 -0700 (PDT) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3NBC2qJ016189 for ; Wed, 23 Apr 2008 04:12:03 -0700 X-ASG-Debug-ID: 1208949163-1968030d0000-sLlkUa X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo201.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B8C5210A8B7C for ; Wed, 23 Apr 2008 04:12:44 -0700 (PDT) Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by cuda.sgi.com with ESMTP id feIoP8kx2XsTwQVL for ; Wed, 23 Apr 2008 04:12:44 -0700 (PDT) Received: from mailgate3.nec.co.jp (mailgate53F.nec.co.jp [10.7.69.162]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m3NBC9np017928; Wed, 23 Apr 2008 20:12:09 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m3NBC9719556; Wed, 23 Apr 2008 20:12:09 +0900 (JST) Received: from mailsv.linux.bs1.fc.nec.co.jp (mailsv.linux.bs1.fc.nec.co.jp [10.34.125.2]) by mailsv4.nec.co.jp (8.13.8/8.13.4) with ESMTP id m3NBC8Lk011802; Wed, 23 Apr 2008 20:12:08 +0900 (JST) Received: from [10.34.125.197] (T-NAGANO-AH1.linux.bs1.fc.nec.co.jp [10.34.125.197]) by mailsv.linux.bs1.fc.nec.co.jp (Postfix) with ESMTP id 1C432E48245; Wed, 23 Apr 2008 20:12:08 +0900 (JST) Message-ID: <480F1987.9010501@ah.jp.nec.com> Date: Wed, 23 Apr 2008 20:12:07 +0900 From: Takenori Nagano User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: linux-kernel@vger.kernel.org, Andrew Morton CC: kdb@oss.sgi.com, vgoyal@redhat.com, "Eric W. Biederman" , kexec@lists.infradead.org, Keith Owens , Nick Piggin , Randy Dunlap , greg@kroah.com, bwalle@suse.de, k-miyoshi@cb.jp.nec.com X-ASG-Orig-Subj: [PATCH 3/3] Move crash_kexec() into panic_notifier, take4 Subject: [PATCH 3/3] Move crash_kexec() into panic_notifier, take4 References: <480DD85C.7060200@ah.jp.nec.com> In-Reply-To: <480DD85C.7060200@ah.jp.nec.com> Content-type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 8bit X-Barracuda-Connect: TYO201.gate.nec.co.jp[202.32.8.193] X-Barracuda-Start-Time: 1208949164 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.48597 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-archive-position: 1345 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: t-nagano@ah.jp.nec.com Precedence: bulk X-list: kdb This patch moves crash_kexec() into panic_notifier. If you want to use it, you have to set config option DUMP_ON_PANIC_NOTIFIER to Y. Its default value is N. If you set DUMP_ON_PANIC_NOTIFIER to N, kdump has no difference before. Thanks, --- Signed-off-by: Takenori Nagano --- diff -uprN linux-2.6.25.orig/arch/ia64/Kconfig linux-2.6.25/arch/ia64/Kconfig --- linux-2.6.25.orig/arch/ia64/Kconfig 2008-04-22 20:34:42.567581801 +0900 +++ linux-2.6.25/arch/ia64/Kconfig 2008-04-22 18:54:05.168734196 +0900 @@ -541,6 +541,14 @@ config CRASH_DUMP help Generate crash dump after being started by kexec. +config DUMP_ON_PANIC_NOTIFIER + bool "Call crash dump function from panic notifier" + depends on CRASH_DUMP + default n + help + Say Y here to be able to call crash dump function from panic_notifier. + It makes a chance to do something before taking crash dump. + source "drivers/firmware/Kconfig" source "fs/Kconfig.binfmt" diff -uprN linux-2.6.25.orig/arch/powerpc/Kconfig linux-2.6.25/arch/powerpc/Kconfig --- linux-2.6.25.orig/arch/powerpc/Kconfig 2008-04-22 20:34:43.115578199 +0900 +++ linux-2.6.25/arch/powerpc/Kconfig 2008-04-22 18:51:03.085855052 +0900 @@ -304,6 +304,14 @@ config CRASH_DUMP Don't change this unless you know what you are doing. +config DUMP_ON_PANIC_NOTIFIER + bool "Call crash dump function from panic notifier (EXPERIMENTAL)" + depends on CRASH_DUMP + default n + help + Say Y here to be able to call crash dump function from panic_notifier. + It makes a chance to do something before taking crash dump. + config PHYP_DUMP bool "Hypervisor-assisted dump (EXPERIMENTAL)" depends on PPC_PSERIES && EXPERIMENTAL diff -uprN linux-2.6.25.orig/arch/sh/Kconfig linux-2.6.25/arch/sh/Kconfig --- linux-2.6.25.orig/arch/sh/Kconfig 2008-04-22 20:34:44.167571856 +0900 +++ linux-2.6.25/arch/sh/Kconfig 2008-04-22 18:53:51.152813154 +0900 @@ -695,6 +695,14 @@ config CRASH_DUMP For more details see Documentation/kdump/kdump.txt +config DUMP_ON_PANIC_NOTIFIER + bool "Call crash dump function from panic notifier" + depends on CRASH_DUMP + default n + help + Say Y here to be able to call crash dump function from panic_notifier. + It makes a chance to do something before taking crash dump. + config SMP bool "Symmetric multi-processing support" depends on SYS_SUPPORTS_SMP diff -uprN linux-2.6.25.orig/arch/x86/Kconfig linux-2.6.25/arch/x86/Kconfig --- linux-2.6.25.orig/arch/x86/Kconfig 2008-04-22 20:34:44.367570179 +0900 +++ linux-2.6.25/arch/x86/Kconfig 2008-04-22 18:55:42.372136199 +0900 @@ -1159,6 +1159,14 @@ config CRASH_DUMP (CONFIG_RELOCATABLE=y). For more details see Documentation/kdump/kdump.txt +config DUMP_ON_PANIC_NOTIFIER + bool "Call crash dump function from panic notifier" + depends on CRASH_DUMP + default n + help + Say Y here to be able to call crash dump function from panic_notifier. + It makes a chance to do something before taking crash dump. + config PHYSICAL_START hex "Physical address where the kernel is loaded" if (EMBEDDED || CRASH_DUMP) default "0x1000000" if X86_NUMAQ diff -uprN linux-2.6.25.orig/kernel/kexec.c linux-2.6.25/kernel/kexec.c --- linux-2.6.25.orig/kernel/kexec.c 2008-04-22 20:35:03.099455119 +0900 +++ linux-2.6.25/kernel/kexec.c 2008-04-22 20:54:37.324228945 +0900 @@ -1133,6 +1133,25 @@ void crash_save_cpu(struct pt_regs *regs final_note(buf); } +#ifdef CONFIG_DUMP_ON_PANIC_NOTIFIER +static int panic_kexec(struct notifier_block *nb, unsigned long e, void *ptr) +{ + crash_kexec(NULL); + + return NOTIFY_DONE; +} + +static struct notifier_block panic_block_base = { + .notifier_call = panic_kexec, + .next = NULL, + .priority = INT_MAX +}; + +static struct tunable_atomic_notifier_block panic_block = { + .nb = &panic_block_base, +}; +#endif + static int __init crash_notes_memory_init(void) { /* Allocate memory for saving cpu registers. */ @@ -1142,6 +1161,11 @@ static int __init crash_notes_memory_ini " states failed\n"); return -ENOMEM; } +#ifdef CONFIG_DUMP_ON_PANIC_NOTIFIER + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &panic_block, + "kdump", "Generate crash dump after being started by kexec."); +#endif return 0; } module_init(crash_notes_memory_init) --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From t-nagano@ah.jp.nec.com Wed Apr 23 04:11:55 2008 Received: with ECARTIS (v1.0.0; list kdb); Wed, 23 Apr 2008 04:12:10 -0700 (PDT) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3NBBsh4016159 for ; Wed, 23 Apr 2008 04:11:55 -0700 X-ASG-Debug-ID: 1208949150-3942038f0000-sLlkUa X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo201.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 16C1015BE2F8 for ; Wed, 23 Apr 2008 04:12:30 -0700 (PDT) Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by cuda.sgi.com with ESMTP id 4GjHdaLX9kJPLoH6 for ; Wed, 23 Apr 2008 04:12:30 -0700 (PDT) Received: from mailgate4.nec.co.jp ([10.7.69.184]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m3NBBgR4017575; Wed, 23 Apr 2008 20:11:42 +0900 (JST) Received: (from root@localhost) by mailgate4.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m3NBBgn12322; Wed, 23 Apr 2008 20:11:42 +0900 (JST) Received: from mailsv.linux.bs1.fc.nec.co.jp (mailsv.linux.bs1.fc.nec.co.jp [10.34.125.2]) by mailsv3.nec.co.jp (8.13.8/8.13.4) with ESMTP id m3NBBf3b000429; Wed, 23 Apr 2008 20:11:41 +0900 (JST) Received: from [10.34.125.197] (T-NAGANO-AH1.linux.bs1.fc.nec.co.jp [10.34.125.197]) by mailsv.linux.bs1.fc.nec.co.jp (Postfix) with ESMTP id A4624E48245; Wed, 23 Apr 2008 20:11:41 +0900 (JST) Message-ID: <480F196D.6080206@ah.jp.nec.com> Date: Wed, 23 Apr 2008 20:11:41 +0900 From: Takenori Nagano User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: linux-kernel@vger.kernel.org, Andrew Morton CC: kdb@oss.sgi.com, vgoyal@redhat.com, "Eric W. Biederman" , kexec@lists.infradead.org, Keith Owens , Nick Piggin , Randy Dunlap , greg@kroah.com, bwalle@suse.de, k-miyoshi@cb.jp.nec.com X-ASG-Orig-Subj: [PATCH 2/2] implement new notifier function to panic_notifier_list ,take4 Subject: [PATCH 2/2] implement new notifier function to panic_notifier_list ,take4 References: <480DD85C.7060200@ah.jp.nec.com> In-Reply-To: <480DD85C.7060200@ah.jp.nec.com> Content-type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 8bit X-Barracuda-Connect: TYO201.gate.nec.co.jp[202.32.8.193] X-Barracuda-Start-Time: 1208949155 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.82 X-Barracuda-Spam-Status: No, SCORE=-1.82 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615 X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.48596 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-archive-position: 1344 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: t-nagano@ah.jp.nec.com Precedence: bulk X-list: kdb 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 --- diff -uprN linux-2.6.25.orig/arch/alpha/kernel/setup.c linux-2.6.25/arch/alpha/kernel/setup.c --- linux-2.6.25.orig/arch/alpha/kernel/setup.c 2008-04-17 11:49:44.000000000 +0900 +++ linux-2.6.25/arch/alpha/kernel/setup.c 2008-04-21 17:15:58.208654286 +0900 @@ -44,14 +44,18 @@ #include #include -extern struct atomic_notifier_head panic_notifier_list; +extern struct tunable_atomic_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_atomic_notifier_block alpha_panic_block = { + .nb = &alpha_panic_block_base +}; + #include #include #include @@ -521,8 +525,8 @@ setup_arch(char **cmdline_p) } /* Register a call for panic conditions. */ - atomic_notifier_chain_register(&panic_notifier_list, - &alpha_panic_block); + tunable_atomic_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.25.orig/arch/arm/mach-omap1/board-voiceblue.c linux-2.6.25/arch/arm/mach-omap1/board-voiceblue.c --- linux-2.6.25.orig/arch/arm/mach-omap1/board-voiceblue.c 2008-04-17 11:49:44.000000000 +0900 +++ linux-2.6.25/arch/arm/mach-omap1/board-voiceblue.c 2008-04-21 17:15:58.252653690 +0900 @@ -226,14 +226,19 @@ static int panic_event(struct notifier_b return NOTIFY_DONE; } -static struct notifier_block panic_block = { +static struct notifier_block panic_block_base = { .notifier_call = panic_event, }; +static struct tunable_atomic_notifier_block panic_block = { + .nb = &panic_block_base +}; + static int __init voiceblue_setup(void) { /* Setup panic notifier */ - atomic_notifier_chain_register(&panic_notifier_list, &panic_block); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &panic_block, "VoiceBlue", NULL); return 0; } diff -uprN linux-2.6.25.orig/arch/mips/lasat/setup.c linux-2.6.25/arch/mips/lasat/setup.c --- linux-2.6.25.orig/arch/mips/lasat/setup.c 2008-04-17 11:49:44.000000000 +0900 +++ linux-2.6.25/arch/mips/lasat/setup.c 2008-04-21 17:15:58.288653222 +0900 @@ -106,7 +106,7 @@ static int lasat_panic_prom_monitor(stru return NOTIFY_DONE; } -static struct notifier_block lasat_panic_block[] = +static struct notifier_block lasat_panic_block_base[] = { { .notifier_call = lasat_panic_display, @@ -117,6 +117,18 @@ static struct notifier_block lasat_panic } }; +static struct tunable_atomic_notifier_block lasat_panic_block[] = { + { + .nb = &lasat_panic_block_base[0] + }, { + .nb = &lasat_panic_block_base[1] + } +}; + +static char* notifier_name[] = { + "lasat_panic_display", "lasat_panic_prom_monitor" +}; + void __init plat_time_init(void) { mips_hpt_frequency = lasat_board_info.li_cpu_hz / 2; @@ -134,8 +146,8 @@ void __init plat_mem_setup(void) /* Set up panic notifier */ for (i = 0; i < ARRAY_SIZE(lasat_panic_block); i++) - atomic_notifier_chain_register(&panic_notifier_list, - &lasat_panic_block[i]); + tunable_notifier_chain_register(&panic_notifier_list, + &lasat_panic_block[i], notifier_name[i], NULL); lasat_reboot_setup(); diff -uprN linux-2.6.25.orig/arch/mips/sgi-ip22/ip22-reset.c linux-2.6.25/arch/mips/sgi-ip22/ip22-reset.c --- linux-2.6.25.orig/arch/mips/sgi-ip22/ip22-reset.c 2008-04-17 11:49:44.000000000 +0900 +++ linux-2.6.25/arch/mips/sgi-ip22/ip22-reset.c 2008-04-21 17:15:58.324653254 +0900 @@ -226,10 +226,14 @@ static int panic_event(struct notifier_b return NOTIFY_DONE; } -static struct notifier_block panic_block = { +static struct notifier_block panic_block_base = { .notifier_call = panic_event, }; +static struct tunable_atomic_notifier_block panic_block = { + .nb = &panic_block_base +}; + static int __init reboot_setup(void) { int res; @@ -246,7 +250,8 @@ static int __init reboot_setup(void) init_timer(&blink_timer); blink_timer.function = blink_timeout; - atomic_notifier_chain_register(&panic_notifier_list, &panic_block); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &panic_block, "sgi-ip22", NULL); return 0; } diff -uprN linux-2.6.25.orig/arch/mips/sgi-ip32/ip32-reset.c linux-2.6.25/arch/mips/sgi-ip32/ip32-reset.c --- linux-2.6.25.orig/arch/mips/sgi-ip32/ip32-reset.c 2008-04-22 20:34:43.035578599 +0900 +++ linux-2.6.25/arch/mips/sgi-ip32/ip32-reset.c 2008-04-21 17:15:58.588651552 +0900 @@ -175,10 +175,14 @@ static int panic_event(struct notifier_b return NOTIFY_DONE; } -static struct notifier_block panic_block = { +static struct notifier_block panic_block_base = { .notifier_call = panic_event, }; +static struct tunable_atomic_notifier_block panic_block = { + .nb = &panic_block_base +}; + static __init int ip32_reboot_setup(void) { /* turn on the green led only */ @@ -193,7 +197,8 @@ static __init int ip32_reboot_setup(void init_timer(&blink_timer); blink_timer.function = blink_timeout; - atomic_notifier_chain_register(&panic_notifier_list, &panic_block); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &panic_block, "sgi-ip32", NULL); if (request_irq(MACEISA_RTC_IRQ, ip32_rtc_int, 0, "rtc", NULL)) panic("Can't allocate MACEISA RTC IRQ"); diff -uprN linux-2.6.25.orig/arch/parisc/kernel/pdc_chassis.c linux-2.6.25/arch/parisc/kernel/pdc_chassis.c --- linux-2.6.25.orig/arch/parisc/kernel/pdc_chassis.c 2008-04-17 11:49:44.000000000 +0900 +++ linux-2.6.25/arch/parisc/kernel/pdc_chassis.c 2008-04-21 17:15:58.604651614 +0900 @@ -101,11 +101,14 @@ static int pdc_chassis_panic_event(struc } -static struct notifier_block pdc_chassis_panic_block = { +static struct notifier_block pdc_chassis_panic_block_base = { .notifier_call = pdc_chassis_panic_event, .priority = INT_MAX, }; +static struct tunable_atomic_notifier_block pdc_chassis_panic_block = { + .nb = &pdc_chassis_panic_block_base +}; /** * parisc_reboot_event() - Called by the reboot handler. @@ -144,8 +147,8 @@ void __init parisc_pdc_chassis_init(void PDC_CHASSIS_VER); /* initialize panic notifier chain */ - atomic_notifier_chain_register(&panic_notifier_list, - &pdc_chassis_panic_block); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &pdc_chassis_panic_block, "pdc_chassis", NULL); /* initialize reboot notifier chain */ register_reboot_notifier(&pdc_chassis_reboot_block); diff -uprN linux-2.6.25.orig/arch/powerpc/kernel/setup-common.c linux-2.6.25/arch/powerpc/kernel/setup-common.c --- linux-2.6.25.orig/arch/powerpc/kernel/setup-common.c 2008-04-22 20:34:43.439575752 +0900 +++ linux-2.6.25/arch/powerpc/kernel/setup-common.c 2008-04-21 17:15:58.628651402 +0900 @@ -609,14 +609,19 @@ static int ppc_panic_event(struct notifi return NOTIFY_DONE; } -static struct notifier_block ppc_panic_block = { +static struct notifier_block ppc_panic_block_base = { .notifier_call = ppc_panic_event, .priority = INT_MIN /* may not return; must be done last */ }; +static struct tunable_atomic_notifier_block ppc_panic_block = { + .nb = &ppc_panic_block_base +}; + void __init setup_panic(void) { - atomic_notifier_chain_register(&panic_notifier_list, &ppc_panic_block); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &ppc_panic_block, "powerpc", NULL); } #ifdef CONFIG_CHECK_CACHE_COHERENCY diff -uprN linux-2.6.25.orig/arch/ppc/platforms/prep_setup.c linux-2.6.25/arch/ppc/platforms/prep_setup.c --- linux-2.6.25.orig/arch/ppc/platforms/prep_setup.c 2008-04-22 20:34:44.015572781 +0900 +++ linux-2.6.25/arch/ppc/platforms/prep_setup.c 2008-04-21 17:15:58.772650588 +0900 @@ -634,12 +634,16 @@ ibm_statusled_panic(struct notifier_bloc return NOTIFY_DONE; } -static struct notifier_block ibm_statusled_block = { +static struct notifier_block ibm_statusled_block_base = { ibm_statusled_panic, NULL, INT_MAX /* try to do it first */ }; +static struct tunable_atomic_notifier_block ibm_statusled_block = { + .nb = &ibm_statusled_block_base +}; + static void ibm_statusled_progress(char *s, unsigned short hex) { @@ -654,8 +658,9 @@ ibm_statusled_progress(char *s, unsigned hex = 0xfff; if (!notifier_installed) { ++notifier_installed; - atomic_notifier_chain_register(&panic_notifier_list, - &ibm_statusled_block); + tunable_atomic_notifier_chain_register( + &panic_notifier_list, &ibm_statusled_block, + "IBM_statusLED", NULL); } } else diff -uprN linux-2.6.25.orig/arch/s390/kernel/ipl.c linux-2.6.25/arch/s390/kernel/ipl.c --- linux-2.6.25.orig/arch/s390/kernel/ipl.c 2008-04-22 20:34:44.103572199 +0900 +++ linux-2.6.25/arch/s390/kernel/ipl.c 2008-04-21 17:15:58.772650588 +0900 @@ -1372,11 +1372,15 @@ static int on_panic_notify(struct notifi return NOTIFY_OK; } -static struct notifier_block on_panic_nb = { +static struct notifier_block on_panic_nb_base = { .notifier_call = on_panic_notify, .priority = 0, }; +static struct tunable_atomic_notifier_block on_panic_nb = { + .nb = &on_panic_nb_base +}; + void __init setup_ipl(void) { ipl_info.type = get_ipl_type(); @@ -1402,7 +1406,8 @@ void __init setup_ipl(void) /* We have no info to copy */ break; } - atomic_notifier_chain_register(&panic_notifier_list, &on_panic_nb); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &on_panic_nb, "s390_ipl", NULL); } void __init ipl_save_parameters(void) diff -uprN linux-2.6.25.orig/arch/sparc64/kernel/sstate.c linux-2.6.25/arch/sparc64/kernel/sstate.c --- linux-2.6.25.orig/arch/sparc64/kernel/sstate.c 2008-04-17 11:49:44.000000000 +0900 +++ linux-2.6.25/arch/sparc64/kernel/sstate.c 2008-04-21 17:15:58.772650588 +0900 @@ -82,11 +82,15 @@ static int sstate_panic_event(struct not return NOTIFY_DONE; } -static struct notifier_block sstate_panic_block = { +static struct notifier_block sstate_panic_block_base = { .notifier_call = sstate_panic_event, .priority = INT_MAX, }; +static struct tunable_atomic_notifier_block sstate_panic_block = { + .nb = &sstate_panic_block_base +}; + void __init sun4v_sstate_init(void) { unsigned long major, minor; @@ -99,6 +103,6 @@ void __init sun4v_sstate_init(void) hv_supports_soft_state = 1; prom_sun4v_guest_soft_state(); - atomic_notifier_chain_register(&panic_notifier_list, - &sstate_panic_block); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &sstate_panic_block, "sstate" ,NULL); } diff -uprN linux-2.6.25.orig/arch/um/drivers/mconsole_kern.c linux-2.6.25/arch/um/drivers/mconsole_kern.c --- linux-2.6.25.orig/arch/um/drivers/mconsole_kern.c 2008-04-17 11:49:44.000000000 +0900 +++ linux-2.6.25/arch/um/drivers/mconsole_kern.c 2008-04-21 17:15:58.848643538 +0900 @@ -920,16 +920,20 @@ static int notify_panic(struct notifier_ return 0; } -static struct notifier_block panic_exit_notifier = { +static struct notifier_block panic_exit_notifier_base = { .notifier_call = notify_panic, .next = NULL, .priority = 1 }; +static struct tunable_atomic_notifier_block panic_exit_notifier = { + .nb = &panic_exit_notifier_base +}; + static int add_notifier(void) { - atomic_notifier_chain_register(&panic_notifier_list, - &panic_exit_notifier); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &panic_exit_notifier, "mconsole", NULL); return 0; } diff -uprN linux-2.6.25.orig/arch/um/kernel/um_arch.c linux-2.6.25/arch/um/kernel/um_arch.c --- linux-2.6.25.orig/arch/um/kernel/um_arch.c 2008-04-22 20:34:44.335563438 +0900 +++ linux-2.6.25/arch/um/kernel/um_arch.c 2008-04-21 17:15:58.848643538 +0900 @@ -234,12 +234,16 @@ static int panic_exit(struct notifier_bl return 0; } -static struct notifier_block panic_exit_notifier = { +static struct notifier_block panic_exit_notifier_base = { .notifier_call = panic_exit, .next = NULL, .priority = 0 }; +static struct tunable_atomic_notifier_block panic_exit_notifier = { + .nb = &panic_exit_notifier_base +}; + /* Set during early boot */ unsigned long task_size; EXPORT_SYMBOL(task_size); @@ -357,8 +361,8 @@ int __init linux_main(int argc, char **a printf("Kernel virtual memory size shrunk to %lu bytes\n", virtmem_size); - atomic_notifier_chain_register(&panic_notifier_list, - &panic_exit_notifier); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &panic_exit_notifier, "um", NULL); uml_postsetup(); diff -uprN linux-2.6.25.orig/arch/x86/lguest/boot.c linux-2.6.25/arch/x86/lguest/boot.c --- linux-2.6.25.orig/arch/x86/lguest/boot.c 2008-04-22 20:34:44.807567744 +0900 +++ linux-2.6.25/arch/x86/lguest/boot.c 2008-04-21 17:15:58.848643538 +0900 @@ -820,17 +820,22 @@ static int lguest_panic(struct notifier_ return NOTIFY_DONE; } -static struct notifier_block paniced = { +static struct notifier_block paniced_base = { .notifier_call = lguest_panic }; +static struct tunable_atomic_notifier_block paniced = { + .nb = = &paniced_base +}; + /* Setting up memory is fairly easy. */ static __init char *lguest_memory_setup(void) { /* We do this here and not earlier because lockcheck used to barf if we * did it before start_kernel(). I think we fixed that, so it'd be * nice to move it back to lguest_init. Patch welcome... */ - atomic_notifier_chain_register(&panic_notifier_list, &paniced); + tunable_atomic_notifier_chain_register(&panic_notifier_list, &paniced, + "lguest", NULL); /* The Linux bootloader header contains an "e820" memory map: the * Launcher populated the first entry with our memory limit. */ diff -uprN linux-2.6.25.orig/arch/xtensa/platforms/iss/setup.c linux-2.6.25/arch/xtensa/platforms/iss/setup.c --- linux-2.6.25.orig/arch/xtensa/platforms/iss/setup.c 2008-04-17 11:49:44.000000000 +0900 +++ linux-2.6.25/arch/xtensa/platforms/iss/setup.c 2008-04-21 17:15:58.848643538 +0900 @@ -98,13 +98,18 @@ iss_panic_event(struct notifier_block *t return NOTIFY_DONE; } -static struct notifier_block iss_panic_block = { +static struct notifier_block iss_panic_block_base = { iss_panic_event, NULL, 0 }; +static struct tunable_atomic_notifier_block iss_panic_block = { + .nb = &iss_panic_block_base +}; + void __init platform_setup(char **p_cmdline) { - atomic_notifier_chain_register(&panic_notifier_list, &iss_panic_block); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &iss_panic_block, "iss_panic", NULL); } diff -uprN linux-2.6.25.orig/drivers/char/ipmi/ipmi_msghandler.c linux-2.6.25/drivers/char/ipmi/ipmi_msghandler.c --- linux-2.6.25.orig/drivers/char/ipmi/ipmi_msghandler.c 2008-04-22 20:34:46.675556380 +0900 +++ linux-2.6.25/drivers/char/ipmi/ipmi_msghandler.c 2008-04-21 17:15:58.972642550 +0900 @@ -4234,12 +4234,16 @@ static int panic_event(struct notifier_b return NOTIFY_DONE; } -static struct notifier_block panic_block = { +static struct notifier_block panic_block_base = { .notifier_call = panic_event, .next = NULL, .priority = 200 /* priority: INT_MAX >= x >= 0 */ }; +static struct tunable_atomic_notifier_block panic_block = { + .nb = &panic_block_base +}; + static int ipmi_init_msghandler(void) { int rv; @@ -4269,7 +4273,8 @@ static int ipmi_init_msghandler(void) setup_timer(&ipmi_timer, ipmi_timeout, 0); mod_timer(&ipmi_timer, jiffies + IPMI_TIMEOUT_JIFFIES); - atomic_notifier_chain_register(&panic_notifier_list, &panic_block); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &panic_block, "ipmi_msghandler", NULL); initialized = 1; @@ -4289,7 +4294,8 @@ static __exit void cleanup_ipmi(void) if (!initialized) return; - atomic_notifier_chain_unregister(&panic_notifier_list, &panic_block); + tunable_atomic_notifier_chain_unregister(&panic_notifier_list, + &panic_block); /* * This can't be called if any interfaces exist, so no worry diff -uprN linux-2.6.25.orig/drivers/char/ipmi/ipmi_watchdog.c linux-2.6.25/drivers/char/ipmi/ipmi_watchdog.c --- linux-2.6.25.orig/drivers/char/ipmi/ipmi_watchdog.c 2008-04-22 20:34:46.691555965 +0900 +++ linux-2.6.25/drivers/char/ipmi/ipmi_watchdog.c 2008-04-21 17:15:58.988649720 +0900 @@ -1157,12 +1157,15 @@ static int wdog_panic_handler(struct not return NOTIFY_OK; } -static struct notifier_block wdog_panic_notifier = { +static struct notifier_block wdog_panic_notifier_base = { .notifier_call = wdog_panic_handler, .next = NULL, .priority = 150 /* priority: INT_MAX >= x >= 0 */ }; +static struct tunable_atomic_notifier_block wdog_panic_notifier = { + .nb = &wdog_panic_notifier_base +}; static void ipmi_new_smi(int if_num, struct device *device) { @@ -1302,8 +1305,8 @@ static int __init ipmi_wdog_init(void) check_parms(); register_reboot_notifier(&wdog_reboot_notifier); - atomic_notifier_chain_register(&panic_notifier_list, - &wdog_panic_notifier); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &wdog_panic_notifier, "ipmi_wdog", NULL); rv = ipmi_smi_watcher_register(&smi_watcher); if (rv) { @@ -1311,8 +1314,8 @@ static int __init ipmi_wdog_init(void) if (nmi_handler_registered) unregister_die_notifier(&ipmi_nmi_handler); #endif - atomic_notifier_chain_unregister(&panic_notifier_list, - &wdog_panic_notifier); + tunable_atomic_notifier_chain_unregister(&panic_notifier_list, + &wdog_panic_notifier); unregister_reboot_notifier(&wdog_reboot_notifier); printk(KERN_WARNING PFX "can't register smi watcher\n"); return rv; @@ -1333,8 +1336,8 @@ static void __exit ipmi_wdog_exit(void) unregister_die_notifier(&ipmi_nmi_handler); #endif - atomic_notifier_chain_unregister(&panic_notifier_list, - &wdog_panic_notifier); + tunable_atomic_notifier_chain_unregister(&panic_notifier_list, + &wdog_panic_notifier); unregister_reboot_notifier(&wdog_reboot_notifier); } module_exit(ipmi_wdog_exit); diff -uprN linux-2.6.25.orig/drivers/misc/ibmasm/heartbeat.c linux-2.6.25/drivers/misc/ibmasm/heartbeat.c --- linux-2.6.25.orig/drivers/misc/ibmasm/heartbeat.c 2008-04-22 20:34:50.719536142 +0900 +++ linux-2.6.25/drivers/misc/ibmasm/heartbeat.c 2008-04-21 17:15:59.024649246 +0900 @@ -48,17 +48,22 @@ static int panic_happened(struct notifie return 0; } -static struct notifier_block panic_notifier = { panic_happened, NULL, 1 }; +static struct notifier_block panic_notifier_base = { panic_happened, NULL, 1 }; + +static struct tunable_atomic_notifier_block panic_notifier = { + .nb = &panic_notifier_base +}; void ibmasm_register_panic_notifier(void) { - atomic_notifier_chain_register(&panic_notifier_list, &panic_notifier); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &panic_notifier, "ibmasm", NULL); } void ibmasm_unregister_panic_notifier(void) { - atomic_notifier_chain_unregister(&panic_notifier_list, - &panic_notifier); + tunable_atomic_notifier_chain_unregister(&panic_notifier_list, + &panic_notifier); } diff -uprN linux-2.6.25.orig/drivers/parisc/power.c linux-2.6.25/drivers/parisc/power.c --- linux-2.6.25.orig/drivers/parisc/power.c 2008-04-17 11:49:44.000000000 +0900 +++ linux-2.6.25/drivers/parisc/power.c 2008-04-21 17:15:59.036649566 +0900 @@ -189,11 +189,14 @@ static int parisc_panic_event(struct not return NOTIFY_DONE; } -static struct notifier_block parisc_panic_block = { +static struct notifier_block parisc_panic_block_base = { .notifier_call = parisc_panic_event, .priority = INT_MAX, }; +static struct tunable_atomic_notifier_block parisc_panic_block = { + .nb = &parisc_panic_block_base +}; static int __init power_init(void) { @@ -231,8 +234,8 @@ static int __init power_init(void) } /* Register a call for panic conditions. */ - atomic_notifier_chain_register(&panic_notifier_list, - &parisc_panic_block); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &parisc_panic_block, "parisc_panic", NULL); return 0; } @@ -241,8 +244,8 @@ static void __exit power_exit(void) { kthread_stop(power_task); - atomic_notifier_chain_unregister(&panic_notifier_list, - &parisc_panic_block); + tunable_atomic_notifier_chain_unregister(&panic_notifier_list, + &parisc_panic_block); pdc_soft_power_button(0); } diff -uprN linux-2.6.25.orig/kernel/softlockup.c linux-2.6.25/kernel/softlockup.c --- linux-2.6.25.orig/kernel/softlockup.c 2008-04-22 20:35:03.247453824 +0900 +++ linux-2.6.25/kernel/softlockup.c 2008-04-21 17:15:59.240648254 +0900 @@ -35,8 +35,12 @@ softlock_panic(struct notifier_block *th return NOTIFY_DONE; } -static struct notifier_block panic_block = { - .notifier_call = softlock_panic, +static struct notifier_block panic_block_base = { + .notifier_call = softlock_panic +}; + +static struct tunable_atomic_notifier_block panic_block = { + .nb = &panic_block_base }; /* @@ -310,5 +314,6 @@ __init void spawn_softlockup_task(void) cpu_callback(&cpu_nfb, CPU_ONLINE, cpu); register_cpu_notifier(&cpu_nfb); - atomic_notifier_chain_register(&panic_notifier_list, &panic_block); + tunable_atomic_notifier_chain_register(&panic_notifier_list, + &panic_block, "softlockup", NULL); } --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From t-nagano@ah.jp.nec.com Wed Apr 23 04:13:56 2008 Received: with ECARTIS (v1.0.0; list kdb); Wed, 23 Apr 2008 04:14:09 -0700 (PDT) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3NBDsEj016335 for ; Wed, 23 Apr 2008 04:13:56 -0700 X-ASG-Debug-ID: 1208949274-195f030c0000-sLlkUa X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo202.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 499AA10A8BC1 for ; Wed, 23 Apr 2008 04:14:34 -0700 (PDT) Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by cuda.sgi.com with ESMTP id d9WcJvG2l4k5xDDc for ; Wed, 23 Apr 2008 04:14:34 -0700 (PDT) Received: from mailgate3.nec.co.jp (mailgate54.nec.co.jp [10.7.69.195]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m3NBDvXv010288; Wed, 23 Apr 2008 20:13:57 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m3NBDv023429; Wed, 23 Apr 2008 20:13:57 +0900 (JST) Received: from mailsv.linux.bs1.fc.nec.co.jp (mailsv.linux.bs1.fc.nec.co.jp [10.34.125.2]) by mailsv3.nec.co.jp (8.13.8/8.13.4) with ESMTP id m3NBDueu001760; Wed, 23 Apr 2008 20:13:56 +0900 (JST) Received: from [10.34.125.197] (T-NAGANO-AH1.linux.bs1.fc.nec.co.jp [10.34.125.197]) by mailsv.linux.bs1.fc.nec.co.jp (Postfix) with ESMTP id 925FDE48245; Wed, 23 Apr 2008 20:13:56 +0900 (JST) Message-ID: <480F19F4.80506@ah.jp.nec.com> Date: Wed, 23 Apr 2008 20:13:56 +0900 From: Takenori Nagano User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: linux-kernel@vger.kernel.org, Andrew Morton CC: kdb@oss.sgi.com, vgoyal@redhat.com, "Eric W. Biederman" , kexec@lists.infradead.org, Keith Owens , Nick Piggin , Randy Dunlap , greg@kroah.com, bwalle@suse.de, k-miyoshi@cb.jp.nec.com X-ASG-Orig-Subj: Re: [PATCH 2/2] implement new notifier function to panic_notifier_list ,take4 Subject: Re: [PATCH 2/2] implement new notifier function to panic_notifier_list ,take4 References: <480DD85C.7060200@ah.jp.nec.com> <480F196D.6080206@ah.jp.nec.com> In-Reply-To: <480F196D.6080206@ah.jp.nec.com> Content-type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 8bit X-Barracuda-Connect: TYO202.gate.nec.co.jp[202.32.8.206] X-Barracuda-Start-Time: 1208949275 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.48597 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-archive-position: 1346 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: t-nagano@ah.jp.nec.com Precedence: bulk X-list: kdb Takenori Nagano wrote: > This patch implements new notifier function to panic_notifier_list. We can > change the list of order by debugfs. Ahh, sorry. debugfs -> /sys/kernel/notifiers/panic_notifier_list/* entry > > Thanks, > > --- > > Signed-off-by: Takenori Nagano > > --- > diff -uprN linux-2.6.25.orig/arch/alpha/kernel/setup.c linux-2.6.25/arch/alpha/kernel/setup.c > --- linux-2.6.25.orig/arch/alpha/kernel/setup.c 2008-04-17 11:49:44.000000000 +0900 > +++ linux-2.6.25/arch/alpha/kernel/setup.c 2008-04-21 17:15:58.208654286 +0900 > @@ -44,14 +44,18 @@ > #include > #include > > -extern struct atomic_notifier_head panic_notifier_list; > +extern struct tunable_atomic_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_atomic_notifier_block alpha_panic_block = { > + .nb = &alpha_panic_block_base > +}; > + > #include > #include > #include > @@ -521,8 +525,8 @@ setup_arch(char **cmdline_p) > } > > /* Register a call for panic conditions. */ > - atomic_notifier_chain_register(&panic_notifier_list, > - &alpha_panic_block); > + tunable_atomic_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.25.orig/arch/arm/mach-omap1/board-voiceblue.c linux-2.6.25/arch/arm/mach-omap1/board-voiceblue.c > --- linux-2.6.25.orig/arch/arm/mach-omap1/board-voiceblue.c 2008-04-17 11:49:44.000000000 +0900 > +++ linux-2.6.25/arch/arm/mach-omap1/board-voiceblue.c 2008-04-21 17:15:58.252653690 +0900 > @@ -226,14 +226,19 @@ static int panic_event(struct notifier_b > return NOTIFY_DONE; > } > > -static struct notifier_block panic_block = { > +static struct notifier_block panic_block_base = { > .notifier_call = panic_event, > }; > > +static struct tunable_atomic_notifier_block panic_block = { > + .nb = &panic_block_base > +}; > + > static int __init voiceblue_setup(void) > { > /* Setup panic notifier */ > - atomic_notifier_chain_register(&panic_notifier_list, &panic_block); > + tunable_atomic_notifier_chain_register(&panic_notifier_list, > + &panic_block, "VoiceBlue", NULL); > > return 0; > } > diff -uprN linux-2.6.25.orig/arch/mips/lasat/setup.c linux-2.6.25/arch/mips/lasat/setup.c > --- linux-2.6.25.orig/arch/mips/lasat/setup.c 2008-04-17 11:49:44.000000000 +0900 > +++ linux-2.6.25/arch/mips/lasat/setup.c 2008-04-21 17:15:58.288653222 +0900 > @@ -106,7 +106,7 @@ static int lasat_panic_prom_monitor(stru > return NOTIFY_DONE; > } > > -static struct notifier_block lasat_panic_block[] = > +static struct notifier_block lasat_panic_block_base[] = > { > { > .notifier_call = lasat_panic_display, > @@ -117,6 +117,18 @@ static struct notifier_block lasat_panic > } > }; > > +static struct tunable_atomic_notifier_block lasat_panic_block[] = { > + { > + .nb = &lasat_panic_block_base[0] > + }, { > + .nb = &lasat_panic_block_base[1] > + } > +}; > + > +static char* notifier_name[] = { > + "lasat_panic_display", "lasat_panic_prom_monitor" > +}; > + > void __init plat_time_init(void) > { > mips_hpt_frequency = lasat_board_info.li_cpu_hz / 2; > @@ -134,8 +146,8 @@ void __init plat_mem_setup(void) > > /* Set up panic notifier */ > for (i = 0; i < ARRAY_SIZE(lasat_panic_block); i++) > - atomic_notifier_chain_register(&panic_notifier_list, > - &lasat_panic_block[i]); > + tunable_notifier_chain_register(&panic_notifier_list, > + &lasat_panic_block[i], notifier_name[i], NULL); > > lasat_reboot_setup(); > > diff -uprN linux-2.6.25.orig/arch/mips/sgi-ip22/ip22-reset.c linux-2.6.25/arch/mips/sgi-ip22/ip22-reset.c > --- linux-2.6.25.orig/arch/mips/sgi-ip22/ip22-reset.c 2008-04-17 11:49:44.000000000 +0900 > +++ linux-2.6.25/arch/mips/sgi-ip22/ip22-reset.c 2008-04-21 17:15:58.324653254 +0900 > @@ -226,10 +226,14 @@ static int panic_event(struct notifier_b > return NOTIFY_DONE; > } > > -static struct notifier_block panic_block = { > +static struct notifier_block panic_block_base = { > .notifier_call = panic_event, > }; > > +static struct tunable_atomic_notifier_block panic_block = { > + .nb = &panic_block_base > +}; > + > static int __init reboot_setup(void) > { > int res; > @@ -246,7 +250,8 @@ static int __init reboot_setup(void) > > init_timer(&blink_timer); > blink_timer.function = blink_timeout; > - atomic_notifier_chain_register(&panic_notifier_list, &panic_block); > + tunable_atomic_notifier_chain_register(&panic_notifier_list, > + &panic_block, "sgi-ip22", NULL); > > return 0; > } > diff -uprN linux-2.6.25.orig/arch/mips/sgi-ip32/ip32-reset.c linux-2.6.25/arch/mips/sgi-ip32/ip32-reset.c > --- linux-2.6.25.orig/arch/mips/sgi-ip32/ip32-reset.c 2008-04-22 20:34:43.035578599 +0900 > +++ linux-2.6.25/arch/mips/sgi-ip32/ip32-reset.c 2008-04-21 17:15:58.588651552 +0900 > @@ -175,10 +175,14 @@ static int panic_event(struct notifier_b > return NOTIFY_DONE; > } > > -static struct notifier_block panic_block = { > +static struct notifier_block panic_block_base = { > .notifier_call = panic_event, > }; > > +static struct tunable_atomic_notifier_block panic_block = { > + .nb = &panic_block_base > +}; > + > static __init int ip32_reboot_setup(void) > { > /* turn on the green led only */ > @@ -193,7 +197,8 @@ static __init int ip32_reboot_setup(void > > init_timer(&blink_timer); > blink_timer.function = blink_timeout; > - atomic_notifier_chain_register(&panic_notifier_list, &panic_block); > + tunable_atomic_notifier_chain_register(&panic_notifier_list, > + &panic_block, "sgi-ip32", NULL); > > if (request_irq(MACEISA_RTC_IRQ, ip32_rtc_int, 0, "rtc", NULL)) > panic("Can't allocate MACEISA RTC IRQ"); > diff -uprN linux-2.6.25.orig/arch/parisc/kernel/pdc_chassis.c linux-2.6.25/arch/parisc/kernel/pdc_chassis.c > --- linux-2.6.25.orig/arch/parisc/kernel/pdc_chassis.c 2008-04-17 11:49:44.000000000 +0900 > +++ linux-2.6.25/arch/parisc/kernel/pdc_chassis.c 2008-04-21 17:15:58.604651614 +0900 > @@ -101,11 +101,14 @@ static int pdc_chassis_panic_event(struc > } > > > -static struct notifier_block pdc_chassis_panic_block = { > +static struct notifier_block pdc_chassis_panic_block_base = { > .notifier_call = pdc_chassis_panic_event, > .priority = INT_MAX, > }; > > +static struct tunable_atomic_notifier_block pdc_chassis_panic_block = { > + .nb = &pdc_chassis_panic_block_base > +}; > > /** > * parisc_reboot_event() - Called by the reboot handler. > @@ -144,8 +147,8 @@ void __init parisc_pdc_chassis_init(void > PDC_CHASSIS_VER); > > /* initialize panic notifier chain */ > - atomic_notifier_chain_register(&panic_notifier_list, > - &pdc_chassis_panic_block); > + tunable_atomic_notifier_chain_register(&panic_notifier_list, > + &pdc_chassis_panic_block, "pdc_chassis", NULL); > > /* initialize reboot notifier chain */ > register_reboot_notifier(&pdc_chassis_reboot_block); > diff -uprN linux-2.6.25.orig/arch/powerpc/kernel/setup-common.c linux-2.6.25/arch/powerpc/kernel/setup-common.c > --- linux-2.6.25.orig/arch/powerpc/kernel/setup-common.c 2008-04-22 20:34:43.439575752 +0900 > +++ linux-2.6.25/arch/powerpc/kernel/setup-common.c 2008-04-21 17:15:58.628651402 +0900 > @@ -609,14 +609,19 @@ static int ppc_panic_event(struct notifi > return NOTIFY_DONE; > } > > -static struct notifier_block ppc_panic_block = { > +static struct notifier_block ppc_panic_block_base = { > .notifier_call = ppc_panic_event, > .priority = INT_MIN /* may not return; must be done last */ > }; > > +static struct tunable_atomic_notifier_block ppc_panic_block = { > + .nb = &ppc_panic_block_base > +}; > + > void __init setup_panic(void) > { > - atomic_notifier_chain_register(&panic_notifier_list, &ppc_panic_block); > + tunable_atomic_notifier_chain_register(&panic_notifier_list, > + &ppc_panic_block, "powerpc", NULL); > } > > #ifdef CONFIG_CHECK_CACHE_COHERENCY > diff -uprN linux-2.6.25.orig/arch/ppc/platforms/prep_setup.c linux-2.6.25/arch/ppc/platforms/prep_setup.c > --- linux-2.6.25.orig/arch/ppc/platforms/prep_setup.c 2008-04-22 20:34:44.015572781 +0900 > +++ linux-2.6.25/arch/ppc/platforms/prep_setup.c 2008-04-21 17:15:58.772650588 +0900 > @@ -634,12 +634,16 @@ ibm_statusled_panic(struct notifier_bloc > return NOTIFY_DONE; > } > > -static struct notifier_block ibm_statusled_block = { > +static struct notifier_block ibm_statusled_block_base = { > ibm_statusled_panic, > NULL, > INT_MAX /* try to do it first */ > }; > > +static struct tunable_atomic_notifier_block ibm_statusled_block = { > + .nb = &ibm_statusled_block_base > +}; > + > static void > ibm_statusled_progress(char *s, unsigned short hex) > { > @@ -654,8 +658,9 @@ ibm_statusled_progress(char *s, unsigned > hex = 0xfff; > if (!notifier_installed) { > ++notifier_installed; > - atomic_notifier_chain_register(&panic_notifier_list, > - &ibm_statusled_block); > + tunable_atomic_notifier_chain_register( > + &panic_notifier_list, &ibm_statusled_block, > + "IBM_statusLED", NULL); > } > } > else > diff -uprN linux-2.6.25.orig/arch/s390/kernel/ipl.c linux-2.6.25/arch/s390/kernel/ipl.c > --- linux-2.6.25.orig/arch/s390/kernel/ipl.c 2008-04-22 20:34:44.103572199 +0900 > +++ linux-2.6.25/arch/s390/kernel/ipl.c 2008-04-21 17:15:58.772650588 +0900 > @@ -1372,11 +1372,15 @@ static int on_panic_notify(struct notifi > return NOTIFY_OK; > } > > -static struct notifier_block on_panic_nb = { > +static struct notifier_block on_panic_nb_base = { > .notifier_call = on_panic_notify, > .priority = 0, > }; > > +static struct tunable_atomic_notifier_block on_panic_nb = { > + .nb = &on_panic_nb_base > +}; > + > void __init setup_ipl(void) > { > ipl_info.type = get_ipl_type(); > @@ -1402,7 +1406,8 @@ void __init setup_ipl(void) > /* We have no info to copy */ > break; > } > - atomic_notifier_chain_register(&panic_notifier_list, &on_panic_nb); > + tunable_atomic_notifier_chain_register(&panic_notifier_list, > + &on_panic_nb, "s390_ipl", NULL); > } > > void __init ipl_save_parameters(void) > diff -uprN linux-2.6.25.orig/arch/sparc64/kernel/sstate.c linux-2.6.25/arch/sparc64/kernel/sstate.c > --- linux-2.6.25.orig/arch/sparc64/kernel/sstate.c 2008-04-17 11:49:44.000000000 +0900 > +++ linux-2.6.25/arch/sparc64/kernel/sstate.c 2008-04-21 17:15:58.772650588 +0900 > @@ -82,11 +82,15 @@ static int sstate_panic_event(struct not > return NOTIFY_DONE; > } > > -static struct notifier_block sstate_panic_block = { > +static struct notifier_block sstate_panic_block_base = { > .notifier_call = sstate_panic_event, > .priority = INT_MAX, > }; > > +static struct tunable_atomic_notifier_block sstate_panic_block = { > + .nb = &sstate_panic_block_base > +}; > + > void __init sun4v_sstate_init(void) > { > unsigned long major, minor; > @@ -99,6 +103,6 @@ void __init sun4v_sstate_init(void) > hv_supports_soft_state = 1; > > prom_sun4v_guest_soft_state(); > - atomic_notifier_chain_register(&panic_notifier_list, > - &sstate_panic_block); > + tunable_atomic_notifier_chain_register(&panic_notifier_list, > + &sstate_panic_block, "sstate" ,NULL); > } > diff -uprN linux-2.6.25.orig/arch/um/drivers/mconsole_kern.c linux-2.6.25/arch/um/drivers/mconsole_kern.c > --- linux-2.6.25.orig/arch/um/drivers/mconsole_kern.c 2008-04-17 11:49:44.000000000 +0900 > +++ linux-2.6.25/arch/um/drivers/mconsole_kern.c 2008-04-21 17:15:58.848643538 +0900 > @@ -920,16 +920,20 @@ static int notify_panic(struct notifier_ > return 0; > } > > -static struct notifier_block panic_exit_notifier = { > +static struct notifier_block panic_exit_notifier_base = { > .notifier_call = notify_panic, > .next = NULL, > .priority = 1 > }; > > +static struct tunable_atomic_notifier_block panic_exit_notifier = { > + .nb = &panic_exit_notifier_base > +}; > + > static int add_notifier(void) > { > - atomic_notifier_chain_register(&panic_notifier_list, > - &panic_exit_notifier); > + tunable_atomic_notifier_chain_register(&panic_notifier_list, > + &panic_exit_notifier, "mconsole", NULL); > return 0; > } > > diff -uprN linux-2.6.25.orig/arch/um/kernel/um_arch.c linux-2.6.25/arch/um/kernel/um_arch.c > --- linux-2.6.25.orig/arch/um/kernel/um_arch.c 2008-04-22 20:34:44.335563438 +0900 > +++ linux-2.6.25/arch/um/kernel/um_arch.c 2008-04-21 17:15:58.848643538 +0900 > @@ -234,12 +234,16 @@ static int panic_exit(struct notifier_bl > return 0; > } > > -static struct notifier_block panic_exit_notifier = { > +static struct notifier_block panic_exit_notifier_base = { > .notifier_call = panic_exit, > .next = NULL, > .priority = 0 > }; > > +static struct tunable_atomic_notifier_block panic_exit_notifier = { > + .nb = &panic_exit_notifier_base > +}; > + > /* Set during early boot */ > unsigned long task_size; > EXPORT_SYMBOL(task_size); > @@ -357,8 +361,8 @@ int __init linux_main(int argc, char **a > printf("Kernel virtual memory size shrunk to %lu bytes\n", > virtmem_size); > > - atomic_notifier_chain_register(&panic_notifier_list, > - &panic_exit_notifier); > + tunable_atomic_notifier_chain_register(&panic_notifier_list, > + &panic_exit_notifier, "um", NULL); > > uml_postsetup(); > > diff -uprN linux-2.6.25.orig/arch/x86/lguest/boot.c linux-2.6.25/arch/x86/lguest/boot.c > --- linux-2.6.25.orig/arch/x86/lguest/boot.c 2008-04-22 20:34:44.807567744 +0900 > +++ linux-2.6.25/arch/x86/lguest/boot.c 2008-04-21 17:15:58.848643538 +0900 > @@ -820,17 +820,22 @@ static int lguest_panic(struct notifier_ > return NOTIFY_DONE; > } > > -static struct notifier_block paniced = { > +static struct notifier_block paniced_base = { > .notifier_call = lguest_panic > }; > > +static struct tunable_atomic_notifier_block paniced = { > + .nb = = &paniced_base > +}; > + > /* Setting up memory is fairly easy. */ > static __init char *lguest_memory_setup(void) > { > /* We do this here and not earlier because lockcheck used to barf if we > * did it before start_kernel(). I think we fixed that, so it'd be > * nice to move it back to lguest_init. Patch welcome... */ > - atomic_notifier_chain_register(&panic_notifier_list, &paniced); > + tunable_atomic_notifier_chain_register(&panic_notifier_list, &paniced, > + "lguest", NULL); > > /* The Linux bootloader header contains an "e820" memory map: the > * Launcher populated the first entry with our memory limit. */ > diff -uprN linux-2.6.25.orig/arch/xtensa/platforms/iss/setup.c linux-2.6.25/arch/xtensa/platforms/iss/setup.c > --- linux-2.6.25.orig/arch/xtensa/platforms/iss/setup.c 2008-04-17 11:49:44.000000000 +0900 > +++ linux-2.6.25/arch/xtensa/platforms/iss/setup.c 2008-04-21 17:15:58.848643538 +0900 > @@ -98,13 +98,18 @@ iss_panic_event(struct notifier_block *t > return NOTIFY_DONE; > } > > -static struct notifier_block iss_panic_block = { > +static struct notifier_block iss_panic_block_base = { > iss_panic_event, > NULL, > 0 > }; > > +static struct tunable_atomic_notifier_block iss_panic_block = { > + .nb = &iss_panic_block_base > +}; > + > void __init platform_setup(char **p_cmdline) > { > - atomic_notifier_chain_register(&panic_notifier_list, &iss_panic_block); > + tunable_atomic_notifier_chain_register(&panic_notifier_list, > + &iss_panic_block, "iss_panic", NULL); > } > diff -uprN linux-2.6.25.orig/drivers/char/ipmi/ipmi_msghandler.c linux-2.6.25/drivers/char/ipmi/ipmi_msghandler.c > --- linux-2.6.25.orig/drivers/char/ipmi/ipmi_msghandler.c 2008-04-22 20:34:46.675556380 +0900 > +++ linux-2.6.25/drivers/char/ipmi/ipmi_msghandler.c 2008-04-21 17:15:58.972642550 +0900 > @@ -4234,12 +4234,16 @@ static int panic_event(struct notifier_b > return NOTIFY_DONE; > } > > -static struct notifier_block panic_block = { > +static struct notifier_block panic_block_base = { > .notifier_call = panic_event, > .next = NULL, > .priority = 200 /* priority: INT_MAX >= x >= 0 */ > }; > > +static struct tunable_atomic_notifier_block panic_block = { > + .nb = &panic_block_base > +}; > + > static int ipmi_init_msghandler(void) > { > int rv; > @@ -4269,7 +4273,8 @@ static int ipmi_init_msghandler(void) > setup_timer(&ipmi_timer, ipmi_timeout, 0); > mod_timer(&ipmi_timer, jiffies + IPMI_TIMEOUT_JIFFIES); > > - atomic_notifier_chain_register(&panic_notifier_list, &panic_block); > + tunable_atomic_notifier_chain_register(&panic_notifier_list, > + &panic_block, "ipmi_msghandler", NULL); > > initialized = 1; > > @@ -4289,7 +4294,8 @@ static __exit void cleanup_ipmi(void) > if (!initialized) > return; > > - atomic_notifier_chain_unregister(&panic_notifier_list, &panic_block); > + tunable_atomic_notifier_chain_unregister(&panic_notifier_list, > + &panic_block); > > /* > * This can't be called if any interfaces exist, so no worry > diff -uprN linux-2.6.25.orig/drivers/char/ipmi/ipmi_watchdog.c linux-2.6.25/drivers/char/ipmi/ipmi_watchdog.c > --- linux-2.6.25.orig/drivers/char/ipmi/ipmi_watchdog.c 2008-04-22 20:34:46.691555965 +0900 > +++ linux-2.6.25/drivers/char/ipmi/ipmi_watchdog.c 2008-04-21 17:15:58.988649720 +0900 > @@ -1157,12 +1157,15 @@ static int wdog_panic_handler(struct not > return NOTIFY_OK; > } > > -static struct notifier_block wdog_panic_notifier = { > +static struct notifier_block wdog_panic_notifier_base = { > .notifier_call = wdog_panic_handler, > .next = NULL, > .priority = 150 /* priority: INT_MAX >= x >= 0 */ > }; > > +static struct tunable_atomic_notifier_block wdog_panic_notifier = { > + .nb = &wdog_panic_notifier_base > +}; > > static void ipmi_new_smi(int if_num, struct device *device) > { > @@ -1302,8 +1305,8 @@ static int __init ipmi_wdog_init(void) > check_parms(); > > register_reboot_notifier(&wdog_reboot_notifier); > - atomic_notifier_chain_register(&panic_notifier_list, > - &wdog_panic_notifier); > + tunable_atomic_notifier_chain_register(&panic_notifier_list, > + &wdog_panic_notifier, "ipmi_wdog", NULL); > > rv = ipmi_smi_watcher_register(&smi_watcher); > if (rv) { > @@ -1311,8 +1314,8 @@ static int __init ipmi_wdog_init(void) > if (nmi_handler_registered) > unregister_die_notifier(&ipmi_nmi_handler); > #endif > - atomic_notifier_chain_unregister(&panic_notifier_list, > - &wdog_panic_notifier); > + tunable_atomic_notifier_chain_unregister(&panic_notifier_list, > + &wdog_panic_notifier); > unregister_reboot_notifier(&wdog_reboot_notifier); > printk(KERN_WARNING PFX "can't register smi watcher\n"); > return rv; > @@ -1333,8 +1336,8 @@ static void __exit ipmi_wdog_exit(void) > unregister_die_notifier(&ipmi_nmi_handler); > #endif > > - atomic_notifier_chain_unregister(&panic_notifier_list, > - &wdog_panic_notifier); > + tunable_atomic_notifier_chain_unregister(&panic_notifier_list, > + &wdog_panic_notifier); > unregister_reboot_notifier(&wdog_reboot_notifier); > } > module_exit(ipmi_wdog_exit); > diff -uprN linux-2.6.25.orig/drivers/misc/ibmasm/heartbeat.c linux-2.6.25/drivers/misc/ibmasm/heartbeat.c > --- linux-2.6.25.orig/drivers/misc/ibmasm/heartbeat.c 2008-04-22 20:34:50.719536142 +0900 > +++ linux-2.6.25/drivers/misc/ibmasm/heartbeat.c 2008-04-21 17:15:59.024649246 +0900 > @@ -48,17 +48,22 @@ static int panic_happened(struct notifie > return 0; > } > > -static struct notifier_block panic_notifier = { panic_happened, NULL, 1 }; > +static struct notifier_block panic_notifier_base = { panic_happened, NULL, 1 }; > + > +static struct tunable_atomic_notifier_block panic_notifier = { > + .nb = &panic_notifier_base > +}; > > void ibmasm_register_panic_notifier(void) > { > - atomic_notifier_chain_register(&panic_notifier_list, &panic_notifier); > + tunable_atomic_notifier_chain_register(&panic_notifier_list, > + &panic_notifier, "ibmasm", NULL); > } > > void ibmasm_unregister_panic_notifier(void) > { > - atomic_notifier_chain_unregister(&panic_notifier_list, > - &panic_notifier); > + tunable_atomic_notifier_chain_unregister(&panic_notifier_list, > + &panic_notifier); > } > > > diff -uprN linux-2.6.25.orig/drivers/parisc/power.c linux-2.6.25/drivers/parisc/power.c > --- linux-2.6.25.orig/drivers/parisc/power.c 2008-04-17 11:49:44.000000000 +0900 > +++ linux-2.6.25/drivers/parisc/power.c 2008-04-21 17:15:59.036649566 +0900 > @@ -189,11 +189,14 @@ static int parisc_panic_event(struct not > return NOTIFY_DONE; > } > > -static struct notifier_block parisc_panic_block = { > +static struct notifier_block parisc_panic_block_base = { > .notifier_call = parisc_panic_event, > .priority = INT_MAX, > }; > > +static struct tunable_atomic_notifier_block parisc_panic_block = { > + .nb = &parisc_panic_block_base > +}; > > static int __init power_init(void) > { > @@ -231,8 +234,8 @@ static int __init power_init(void) > } > > /* Register a call for panic conditions. */ > - atomic_notifier_chain_register(&panic_notifier_list, > - &parisc_panic_block); > + tunable_atomic_notifier_chain_register(&panic_notifier_list, > + &parisc_panic_block, "parisc_panic", NULL); > > return 0; > } > @@ -241,8 +244,8 @@ static void __exit power_exit(void) > { > kthread_stop(power_task); > > - atomic_notifier_chain_unregister(&panic_notifier_list, > - &parisc_panic_block); > + tunable_atomic_notifier_chain_unregister(&panic_notifier_list, > + &parisc_panic_block); > > pdc_soft_power_button(0); > } > diff -uprN linux-2.6.25.orig/kernel/softlockup.c linux-2.6.25/kernel/softlockup.c > --- linux-2.6.25.orig/kernel/softlockup.c 2008-04-22 20:35:03.247453824 +0900 > +++ linux-2.6.25/kernel/softlockup.c 2008-04-21 17:15:59.240648254 +0900 > @@ -35,8 +35,12 @@ softlock_panic(struct notifier_block *th > return NOTIFY_DONE; > } > > -static struct notifier_block panic_block = { > - .notifier_call = softlock_panic, > +static struct notifier_block panic_block_base = { > + .notifier_call = softlock_panic > +}; > + > +static struct tunable_atomic_notifier_block panic_block = { > + .nb = &panic_block_base > }; > > /* > @@ -310,5 +314,6 @@ __init void spawn_softlockup_task(void) > cpu_callback(&cpu_nfb, CPU_ONLINE, cpu); > register_cpu_notifier(&cpu_nfb); > > - atomic_notifier_chain_register(&panic_notifier_list, &panic_block); > + tunable_atomic_notifier_chain_register(&panic_notifier_list, > + &panic_block, "softlockup", NULL); > } > > -- +=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+ NEC コンピュータソフトウェア事業本部 OSSプラットフォーム開発本部 永野 武則 (Takenori Nagano) TEL:8-23-57969(MyLine) 042-333-5383(外線) e-mail:t-nagano@ah.jp.nec.com +=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+ --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe.