From owner-freebsd-arch@freebsd.org Tue Dec 26 14:48:50 2017 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD3E0E9398F for ; Tue, 26 Dec 2017 14:48:50 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from mail.karels.net (mail.karels.net [216.160.39.52]) by mx1.freebsd.org (Postfix) with ESMTP id A9A7E781F9 for ; Tue, 26 Dec 2017 14:48:50 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from mail.karels.net (localhost [127.0.0.1]) by mail.karels.net (8.15.2/8.15.2) with ESMTP id vBQEPMmQ007578 for ; Tue, 26 Dec 2017 08:25:22 -0600 (CST) (envelope-from karels@FreeBSD.org) Message-Id: <201712261425.vBQEPMmQ007578@mail.karels.net> To: freebsd-arch@freebsd.org From: Mike Karels Reply-to: karels@FreeBSD.org Subject: making SW_WATCHDOG dynamic MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7576.1514298322.1@mail.karels.net> Date: Tue, 26 Dec 2017 08:25:22 -0600 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 14:48:51 -0000 There is a kernel option, SW_WATCHDOG, which adds a low-level software watchdog in hardclock. By default, the kernel and watchdogd support only hardware-based watchdogs. There is also a callout-based software watchdog that can be enabled by watchdogd with an ioctl if --softwatchdog is specified, but watchdogd doesn't switch on its own. The SW_WATCHDOG option adds a lower-level software watchdog to the hardware-based mechanism, but it adds it unconditionally. I propose to include the SW_WATCHDOG facility by default, but enable it only if there is no hardware watchdog. I'm interested in any comments, suggestions, or background; feel free to mail me off the list. If there are multiple people interested, I'll forward messages to that group. I want to make the change because I have found SW_WATCHDOG quite useful at $JOB, and it's annoying to have to build a custom kernel just for this (not just once, but every time there is a kernel patch). Also, I'm curious why we have two software watchdog facilities. The --softwatchdog facility has various options on expiration, such as printf/log/panic; I don't know why anything other than panic/reboot would be desirable, though. I already contacted some of the people who have left fingerprints on watchdog. Also, if anyone wants to review the code, let me know. Thanks, Mike