lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100820123459.GD4879@redhat.com>
Date:	Fri, 20 Aug 2010 08:34:59 -0400
From:	Don Zickus <dzickus@...hat.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Frederic Weisbecker <fweisbec@...il.com>,
	Len Brown <len.brown@...el.com>,
	Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
	Yong Zhang <yong.zhang0@...il.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org,
	linux-acpi@...r.kernel.org, Andy Grover <andy.grover@...cle.com>,
	"H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH] fix BUG using smp_processor_id() in touch_nmi_watchdog
 and touch_softlockup_watchdog

On Thu, Aug 19, 2010 at 08:42:56PM -0700, Andrew Morton wrote:
> On Thu, 19 Aug 2010 22:57:49 -0400 Don Zickus <dzickus@...hat.com> wrote:
> 
> > On Wed, Aug 18, 2010 at 01:01:56PM -0700, Andrew Morton wrote:
> > @@ -430,6 +437,9 @@ static int watchdog_enable(int cpu)
> >  		wake_up_process(p);
> >  	}
> >  
> > +	/* if any cpu succeeds, watchdog is considered enabled for the system */
> > +	watchdog_enabled = 1;
> > +
> >  	return 0;
> >  }
> >  
> > @@ -452,9 +462,6 @@ static void watchdog_disable(int cpu)
> >  		per_cpu(softlockup_watchdog, cpu) = NULL;
> >  		kthread_stop(p);
> >  	}
> > -
> > -	/* if any cpu succeeds, watchdog is considered enabled for the system */
> > -	watchdog_enabled = 1;
> >  }
> >  
> >  static void watchdog_enable_all_cpus(void)
> 
> hm, the code seems a bit screwy.  Maybe it was always thus.

No, watchdog_enabled was something newly created for the lockup dectector.

> 
> watchdog_enabled gets set in the per-cpu function but it gets cleared
> in the all-cpus function.  Asymmetric.

Yes it is by design.  I was using watchdog_enabled as a global state
variable.  As soon as one cpu was enabled, I would set the bit.  But only
if all the cpus disabled the watchdog would I clear the bit.

> 
> Also afacit the action of cpu-hotunplug+cpu-hotplug will reenable the
> watchdog on a CPU which was supposed to have it disabled.  Perhaps you
> could recheck that and make sure it all makes sense - perhaps we need a
> separate state variable which is purely "current setting of
> /proc/sys/kernel/nmi_watchdog" and doesn't get altered internally.

I wasn't tracking it on a per cpu basis.  I didn't see a need to.  The
watchdog should globally be on/off across the system.  If a system comes
up and one of the cpus could not bring the watchdog online for some
reason, then that is a problem.  If a cpu-hotunplug+cpu-hotplug fixes it,
all the better. :-)

Also, if I wanted to track it per cpu, there is a bunch of status bits in
per-cpu variables that could let the code know whether a particular cpu
watchdog is on/off for either hardlockup or softlockup.

Cheers,
Don
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ