From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicholas Piggin Subject: Re: [RFC PATCH 12/23] kernel/watchdog: Introduce a struct for NMI watchdog operations Date: Wed, 13 Jun 2018 21:52:25 +1000 Message-ID: <20180613215225.2a938abc@roar.ozlabs.ibm.com> References: <1528851463-21140-1-git-send-email-ricardo.neri-calderon@linux.intel.com> <1528851463-21140-13-git-send-email-ricardo.neri-calderon@linux.intel.com> <20180613174141.539fc6c1@roar.ozlabs.ibm.com> <20180613084219.GT12258@hirez.programming.kicks-ass.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Thomas Gleixner Cc: Peter Zijlstra , Benjamin Herrenschmidt , Paul Mackerras , "H. Peter Anvin" , sparclinux-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Ingo Molnar , Ashok Raj , Michael Ellerman , x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, Andi Kleen , Borislav Petkov , Masami Hiramatsu , Don Zickus , "Ravi V. Shankar" , Ricardo Neri , Frederic Weisbecker , Mathieu Desnoyers , Tony Luck , Babu Moger , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, "Luis R. Rodriguez" , Jacob Pan , Philippe Ombredanne List-Id: iommu@lists.linux-foundation.org On Wed, 13 Jun 2018 11:26:49 +0200 (CEST) Thomas Gleixner wrote: > On Wed, 13 Jun 2018, Peter Zijlstra wrote: > > On Wed, Jun 13, 2018 at 05:41:41PM +1000, Nicholas Piggin wrote: > > > On Tue, 12 Jun 2018 17:57:32 -0700 > > > Ricardo Neri wrote: > > > > > > > Instead of exposing individual functions for the operations of the NMI > > > > watchdog, define a common interface that can be used across multiple > > > > implementations. > > > > > > > > The struct nmi_watchdog_ops is defined for such operations. These initial > > > > definitions include the enable, disable, start, stop, and cleanup > > > > operations. > > > > > > > > Only a single NMI watchdog can be used in the system. The operations of > > > > this NMI watchdog are accessed via the new variable nmi_wd_ops. This > > > > variable is set to point the operations of the first NMI watchdog that > > > > initializes successfully. Even though at this moment, the only available > > > > NMI watchdog is the perf-based hardlockup detector. More implementations > > > > can be added in the future. > > > > > > Cool, this looks pretty nice at a quick glance. sparc and powerpc at > > > least have their own NMI watchdogs, it would be good to have those > > > converted as well. > > > > Yeah, agreed, this looks like half a patch. > > Though I'm not seeing the advantage of it. That kind of NMI watchdogs are > low level architecture details so having yet another 'ops' data structure > with a gazillion of callbacks, checks and indirections does not provide > value over the currently available weak stubs. The other way to go of course is librify the perf watchdog and make an x86 watchdog that selects between perf and hpet... I also probably prefer that for code such as this, but I wouldn't strongly object to ops struct if I'm not writing the code. It's not that bad is it? Thanks, Nick