mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH 1/2] Always probe the NMI watchdog
@ 2007-06-26  8:04 Mikael Pettersson
  2007-06-26  9:57 ` Stephane Eranian
  0 siblings, 1 reply; 10+ messages in thread
From: Mikael Pettersson @ 2007-06-26  8:04 UTC (permalink / raw)
  To: B.Steinbrink, eranian
  Cc: ak, ingo, levon, linux-kernel, oprofile-list, perfmon, wcohen

On Mon, 25 Jun 2007 23:04:25 +0200, B.Steinbrink@gmx.de wrote:
> > I think the tricky part is that we do want to reserve perfctr1 even
> > though the NMI watchdog is not active. This comes from the fact that
> > the NMI watchdog knows about only one counter and if it can't get that
> > one, it probably fails.  By reserving it from the start, we ensure NMI
> > watchdog will work when eventually activated.
> 
> Can you enable it later on at all? It failed for me when I tried,
> because it didn't know which hardware to use. Had to pass the kernel
> parameter to make the proc files do anything. Seems like it has to be
> enable at boot to work at all.
> 
> And AFAICT we never unconditionally reserved a perfctr for the watchdog.

Yes you can dynamically enable/disable the NMI watchdog,
at least if you booted with it enabled.

> In 2.6.21 the nmi watchdog, if enabled, just reserved its perfctrs and
> everything else had to deal with it. Since the cleanup, the watchdog
> will release its perfctr when disabled, so another subsystem can grab
> it. But that also means that that other subsystem must release it again
> before you can reenable the watchdog.

Which is the obvious and correct way to handle a shared resource.

Keeping parts of the PMU HW permanently reserved whether or not
the watchdog is enabled would be a BUG.

/Mikael

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] Always probe the NMI watchdog
@ 2007-06-26 10:35 Mikael Pettersson
  0 siblings, 0 replies; 10+ messages in thread
From: Mikael Pettersson @ 2007-06-26 10:35 UTC (permalink / raw)
  To: eranian, mikpe
  Cc: B.Steinbrink, ak, ingo, levon, linux-kernel, oprofile-list,
	perfmon, wcohen

On Tue, 26 Jun 2007 02:57:55 -0700, Mikael Pettersson wrote:
> > Keeping parts of the PMU HW permanently reserved whether or not
> > the watchdog is enabled would be a BUG.
> > 
> True. But the upside is that you guarantee the activation of the NMI
> watchdog will always succeed which may be a valuable property given the
> goal of the NMI watchdog. Otherwise, if Oprofile or perfmon are active,
> the NMI will fail to grab a single counter.

That relates more to policy than mechanism. I for one don't
consider the watchdog "sacred".

I think it's entirely reasonable that if the watchdog is disabled
(echo 0 > /proc/sys/kernel/nmi_watchdog) in order to give the
_full_ PMU HW to something else, then that something else needs
to be disabled (or otherwise instructed to give up the HW) before
the watchdog can be reenabled. If you don't want to risk not
being able to restart the watchdog, don't disable it.

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [PATCH] Separate performance counter reservation from nmi watchdog
@ 2007-06-18 10:32 Björn Steinbrink
  2007-06-20 12:31 ` [PATCH 1/2] Separate the performance counter allocation from the LAPIC NMI watchdog Andi Kleen
  0 siblings, 1 reply; 10+ messages in thread
From: Björn Steinbrink @ 2007-06-18 10:32 UTC (permalink / raw)
  To: Stephane Eranian
  Cc: oprofile-list, wcohen, ak, perfmon, linux-kernel, levon, akpm

On 2007.06.18 02:52:38 -0700, Stephane Eranian wrote:
> Hello Bjorn,
> 
> Sorry for the delay in my reponse.
> 
> > > From: Björn Steinbrink <B.Steinbrink@gmx.de>
> > > 
> > > Separate the performance counter reservation system from the nmi
> > > watchdog to allow usage of all performance counters even if the nmi
> > > watchdog is not used.
> > > 
> 
> I think it is a good idea to separate the counter allocator from NMI
> becuase as you said they are/will be use used by more than the NMI
> watchdog. Thus, I think you should drop the stirng nmi from the
> routines. I would also povide a separate header file for this allocator.

Rationale for both: This was already a (IMHO) rather huge patch for such
a bugfix so I didn't want to change even more code for the sake of
cleanup. I had planned to send a second patch for 2.6.23 that would do
the clean up, should have mentioned that (or included the second patch).

Will resend the patch later today, together with the cleanup patch.
Whoever applies it can then decide if the cleanup should go into 2.6.22
or 2.6.23.

Thanks,
Björn

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-06-26 10:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-26  8:04 [PATCH 1/2] Always probe the NMI watchdog Mikael Pettersson
2007-06-26  9:57 ` Stephane Eranian
  -- strict thread matches above, loose matches on Subject: below --
2007-06-26 10:35 Mikael Pettersson
2007-06-18 10:32 [PATCH] Separate performance counter reservation from nmi watchdog Björn Steinbrink
2007-06-20 12:31 ` [PATCH 1/2] Separate the performance counter allocation from the LAPIC NMI watchdog Andi Kleen
2007-06-20 12:49   ` [perfmon] " Stephane Eranian
2007-06-20 13:01     ` Andi Kleen
2007-06-20 18:33       ` Björn Steinbrink
2007-06-20 18:34         ` [PATCH 1/2] Always probe the " Björn Steinbrink
2007-06-25 19:09           ` Andrew Morton
2007-06-25 19:36             ` Andi Kleen
2007-06-25 20:01               ` Stephane Eranian
2007-06-25 20:36                 ` Andi Kleen
2007-06-25 21:04                 ` Björn Steinbrink
2007-06-25 21:06               ` Björn Steinbrink

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®