Skip to contentSkip to conversation

x86: nmi - add sensible names to nmi_watchdog boot param

RFC In review Cyrill Gorcunov 3 participants 5 messages Oct 30, 2008 x86

lore
Share & tools
lore
#0 lore raw

RFC 1/1 x86: nmi - add sensible names to nmi_watchdog boot param

Add sensible names as "lapic" and "ioapic" to nmi_watchdog boot parameter. Sometimes it is not that easy to recall what exactly nmi_watchdog=1 does mean so we allow the using of symbolic names here.

Old numeric values remain valid.

---

 arch/x86/kernel/nmi.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
arch/x86/kernel/nmi.c +10 -5
Index: linux-2.6.git/arch/x86/kernel/nmi.c
===================================================================
@@ -208,12 +208,17 @@ static int __init setup_nmi_watchdog(cha
 		++str;
 	}
 
-	get_option(&str, &nmi);
-
-	if (nmi >= NMI_INVALID)
-		return 0;
+	if (!strncmp(str, "lapic", 5))
+		nmi_watchdog = NMI_LOCAL_APIC;
+	else if (!strncmp(str, "ioapic", 6))
+		nmi_watchdog = NMI_IO_APIC;
+	else {
+		get_option(&str, &nmi);
+		if (nmi >= NMI_INVALID)
+			return 0;
+		nmi_watchdog = nmi;
+	}
 
-	nmi_watchdog = nmi;
 	return 1;
 }
 __setup("nmi_watchdog=", setup_nmi_watchdog);
#1 lore raw
Quoted 6 lines

Add sensible names as "lapic" and "ioapic" to nmi_watchdog boot parameter. Sometimes it is not that easy to recall what exactly nmi_watchdog=1 does mean so we allow the using of symbolic names here.

Old numeric values remain valid.

looks good to me, but you need to update the documentation as well.

Signature · 1 line
Aristeu
#2 lore raw

[Aristeu Rozanski - Thu, Oct 30, 2008 at 01:10:53PM -0400]

| > Add sensible names as "lapic" and "ioapic" to
| > nmi_watchdog boot parameter. Sometimes it is not
| > that easy to recall what exactly nmi_watchdog=1
| > does mean so we allow the using of symbolic names here.
| > 
| > Old numeric values remain valid.
| looks good to me, but you need to update the documentation as well.
| 
| -- 
| Aristeu
| 

Aristeu, maybe you could do it for me -- English is quite weak side of me :)

- Cyrill -

#3 lore raw

[Cyrill Gorcunov - Thu, Oct 30, 2008 at 08:14:26PM +0300]

| [Aristeu Rozanski - Thu, Oct 30, 2008 at 01:10:53PM -0400]
| | > Add sensible names as "lapic" and "ioapic" to
| | > nmi_watchdog boot parameter. Sometimes it is not
| | > that easy to recall what exactly nmi_watchdog=1
| | > does mean so we allow the using of symbolic names here.
| | > 
| | > Old numeric values remain valid.
| | looks good to me, but you need to update the documentation as well.
| | 
| | -- 
| | Aristeu
| | 
| 
| Aristeu, maybe you could do it for me -- English is quite weak
| side of me :)
| 
| 		- Cyrill -

I think I'd better wait 'till your patch (for nmi_watchdog.txt) applied. It allows me to just write a few words so it would be pushed on top of _all_ nmi related changes these days (without interdiff).

- Cyrill -

#4 lore raw
In reply to Cyrill Gorcunov
Quoted 5 lines · Cyrill Gorcunov

Add sensible names as "lapic" and "ioapic" to nmi_watchdog boot parameter. Sometimes it is not that easy to recall what exactly nmi_watchdog=1 does mean so we allow the using of symbolic names here.

Quoted 7 lines

Old numeric values remain valid.

---

 arch/x86/kernel/nmi.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

ok, that makes quite a bit of sense. Peter, any objections?

Ingo