mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: dzickus <dzickus@redhat.com>
Cc: linux-kernel@vger.kernel.org, oprofile-list@lists.sourceforge.net
Subject: Re: [patch 8/8] Add abilty to enable/disable nmi watchdog from sysfs
Date: Tue, 9 May 2006 23:37:53 +0200	[thread overview]
Message-ID: <200605092337.53416.ak@suse.de> (raw)
In-Reply-To: <20060509205958.578466000@drseuss.boston.redhat.com>

On Tuesday 09 May 2006 22:50, dzickus wrote:
> 
> Adds a new /proc/sys/kernel/nmi call that will enable/disable the nmi
> watchdog.

The subject is wrong i think - sysctl != sysfs.

And shouldn't that be called nmi_watchdog? 

> 
> Signed-off-by:  Don Zickus <dzickus@redhat.com>
> 
> Index: linux-don/arch/i386/kernel/nmi.c
> ===================================================================
> --- linux-don.orig/arch/i386/kernel/nmi.c
> +++ linux-don/arch/i386/kernel/nmi.c
> @@ -845,6 +845,56 @@ static int unknown_nmi_panic_callback(st
>  	return 0;
>  }
>  
> +/*
> + * proc handler for /proc/sys/kernel/nmi
> + */
> +int proc_nmi_enabled(struct ctl_table *table, int write, struct file *file,
> +			void __user *buffer, size_t *length, loff_t *ppos)
> +{
> +	int old_state;
> +
> +	nmi_watchdog_enabled = (atomic_read(&nmi_active) > 0) ? 1 : 0;
> +	old_state = nmi_watchdog_enabled;
> +	proc_dointvec(table, write, file, buffer, length, ppos);
> +	if (!!old_state == !!nmi_watchdog_enabled)
> +		return 0;
> +
> +	if (atomic_read(&nmi_active) < 0) {
> +		printk( KERN_WARNING "NMI watchdog is permanently disabled\n");
> +		return 0;
> +	}

The returns should be probably -EIO or similar. Same further down.

> +
> +	if (nmi_watchdog == NMI_DEFAULT) {
> +		if (nmi_known_cpu() > 0)
> +			nmi_watchdog = NMI_LOCAL_APIC;
> +		else
> +			nmi_watchdog = NMI_IO_APIC;
> +	}
> +
> +	if (nmi_watchdog == NMI_LOCAL_APIC)
> +	{

Move the { up

Anyways I fixed these up myself, no need to resubmit.

-Andi

  reply	other threads:[~2006-05-09 21:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-09 20:50 [patch 0/8] [RFC PATCH] nmi watchdog: x86 32/64 cleanup dzickus
2006-05-09 20:50 ` [patch 1/8] nmi watchdog header cleanup dzickus
2006-05-09 20:50 ` [patch 2/8] Add performance counter reservation framework for UP kernels dzickus
2006-05-09 20:50 ` [patch 3/8] Utilize performance counter reservation framework in oprofile dzickus
2006-05-09 20:50 ` [patch 4/8] Add SMP support on x86_64 to reservation framework dzickus
2006-05-09 21:42   ` Andi Kleen
2006-05-09 20:50 ` [patch 5/8] Add SMP support on i386 " dzickus
2006-05-22 17:31   ` Markus Armbruster
2006-05-22 17:55     ` Don Zickus
2006-05-09 20:50 ` [patch 6/8] Cleanup NMI interrupt path dzickus
2006-05-09 20:50 ` [patch 7/8] Remove un/set_nmi_callback and reserve/release_lapic_nmi functions dzickus
2006-05-09 20:50 ` [patch 8/8] Add abilty to enable/disable nmi watchdog from sysfs dzickus
2006-05-09 21:37   ` Andi Kleen [this message]
2006-05-10  9:10   ` Stephane Eranian
2006-05-10  9:28     ` Andi Kleen
2006-05-10 14:59     ` Don Zickus
2006-05-10 15:03       ` Stephane Eranian
2006-05-10 19:06         ` Don Zickus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200605092337.53416.ak@suse.de \
    --to=ak@suse.de \
    --cc=dzickus@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oprofile-list@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome