Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 11 Mar 2001 10:06:15 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 11 Mar 2001 10:06:06 -0500 Received: from chiara.elte.hu ([157.181.150.200]:24589 "HELO chiara.elte.hu") by vger.kernel.org with SMTP id ; Sun, 11 Mar 2001 10:05:52 -0500 Date: Sun, 11 Mar 2001 16:04:12 +0100 (CET) From: Ingo Molnar Reply-To: To: Andrew Morton Cc: Keith Owens , Alan Cox , lkml Subject: [patch] nmi-watchdog-2.4.2-A2 In-Reply-To: <3AAB4EB4.4569908A@uow.edu.au> Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="655616-980161917-984323052=:803" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --655616-980161917-984323052=:803 Content-Type: TEXT/PLAIN; charset=US-ASCII On Sun, 11 Mar 2001, Andrew Morton wrote: > Sorry, this doesn't look right. Are you sure you booted with > `nmi_watchdog=1'? It was turned off by default in -ac18. of course i did ... > Two things: > > - CPU A could be doing the SYSRQ printing, while > CPU B is spinning on a lock which CPU A holds. The > NMI watchdog will then whack CPU B. So touch_nmi_watchdog() > needs to touch *all* CPUs. (kbd_controller_lock, for example). yep, agreed. > - We need to touch the NMI more than once during the > SYSRQ-T output - five seconds isn't enough. > > The correctest way is, I think, to touch_nmi() in > rs285_console_write(), lp_console_write() and > serial_console_write(). nope: > We _could_ just touch it in show_state(), but that means > we still get whacked if we do a lot of printk()s with interrupts > disabled from some random place in the kernel. exactly, and that is a feature. We want to find all those places, because disabling IRQs for too long can cause problems in unrelated kernel code. SysRq-T is a special case so touch_nmi() is justified in that and only that case. The NMI watchdog is something that gives security, and we want to be very conservative disabling its effect. [i've attached nmi-watchdog-2.4.2-A2 (against -ac18) which adds your fix to clear all alert counters in touch_nmi_watchdog().] Ingo --655616-980161917-984323052=:803 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="nmi-watchdog-2.4.2-A2" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="nmi-watchdog-2.4.2-A2" LS0tIGxpbnV4L2tlcm5lbC9zY2hlZC5jLm9yaWcJU3VuIE1hciAxMSAxMTo0 OTowMCAyMDAxDQorKysgbGludXgva2VybmVsL3NjaGVkLmMJU3VuIE1hciAx MSAxMTo1MTozNyAyMDAxDQpAQCAtMTE4Myw4ICsxMTgzLDE0IEBADQogCXBy aW50aygiICB0YXNrICAgICAgICAgICAgICAgICBQQyAgICAgICAgc3RhY2sg ICBwaWQgZmF0aGVyIGNoaWxkIHlvdW5nZXIgb2xkZXJcbiIpOw0KICNlbmRp Zg0KIAlyZWFkX2xvY2soJnRhc2tsaXN0X2xvY2spOw0KLQlmb3JfZWFjaF90 YXNrKHApDQorCWZvcl9lYWNoX3Rhc2socCkgew0KKwkJLyoNCisJCSAqIHJl c2V0IHRoZSBOTUktdGltZW91dCwgbGlzdGluZyBhbGwgZmlsZXMgb24gYSBz bG93DQorCQkgKiBjb25zb2xlIG1pZ2h0IHRha2UgYWxvdCBvZiB0aW1lOg0K KwkJICovDQorCQl0b3VjaF9ubWlfd2F0Y2hkb2coKTsNCiAJCXNob3dfdGFz ayhwKTsNCisJfQ0KIAlyZWFkX3VubG9jaygmdGFza2xpc3RfbG9jayk7DQog fQ0KIA0KLS0tIGxpbnV4L2luY2x1ZGUvbGludXgvaXJxLmgub3JpZwlTdW4g TWFyIDExIDExOjIwOjIxIDIwMDENCisrKyBsaW51eC9pbmNsdWRlL2xpbnV4 L2lycS5oCVN1biBNYXIgMTEgMTI6MDI6MjMgMjAwMQ0KQEAgLTU3LDE4ICs1 NywxNiBAQA0KICNpbmNsdWRlIDxhc20vaHdfaXJxLmg+IC8qIHRoZSBhcmNo IGRlcGVuZGVudCBzdHVmZiAqLw0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1IHNl Y29uZHMpIGJlZm9yZSBkb2luZyB0aGUgb29wcyAuLi4NCg== --655616-980161917-984323052=:803-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/