From owner-freebsd-bugs@FreeBSD.ORG Wed Oct 14 15:20:01 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0E231065672 for ; Wed, 14 Oct 2009 15:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id CE0418FC28 for ; Wed, 14 Oct 2009 15:20:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n9EFK1Ar022085 for ; Wed, 14 Oct 2009 15:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n9EFK1Ol022084; Wed, 14 Oct 2009 15:20:01 GMT (envelope-from gnats) Resent-Date: Wed, 14 Oct 2009 15:20:01 GMT Resent-Message-Id: <200910141520.n9EFK1Ol022084@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dmitrij Tejblum Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B64E51065676 for ; Wed, 14 Oct 2009 15:15:24 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id A50778FC1C for ; Wed, 14 Oct 2009 15:15:24 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n9EFFNYD049545 for ; Wed, 14 Oct 2009 15:15:23 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n9EFFNaf049544; Wed, 14 Oct 2009 15:15:23 GMT (envelope-from nobody) Message-Id: <200910141515.n9EFFNaf049544@www.freebsd.org> Date: Wed, 14 Oct 2009 15:15:23 GMT From: Dmitrij Tejblum To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/139604: [patch] ichwd watchdog sometimes does not enable X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2009 15:20:02 -0000 >Number: 139604 >Category: kern >Synopsis: [patch] ichwd watchdog sometimes does not enable >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Oct 14 15:20:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Dmitrij Tejblum >Release: 7.2-STABLE >Organization: OOO Yandex >Environment: >Description: ichwd process watchdog commands with the following code snippet: if (timeout != sc->timeout) { if (!sc->active) ichwd_tmr_enable(sc); ichwd_tmr_set(sc, timeout); } ichwd_tmr_reload(sc); I.e., ichwd is not enabled when timeout == sc->timeout >How-To-Repeat: Suppose you have ichwd configured and watchdogd running. If you stop watchdogd (/etc/rc.d/watchdogd stop) and then start it back (/etc/rc.d/watchdogd start), ichwd will not be enabled. Do it with sysctl debug.bootverbose=1, then ichwd print debug messages. >Fix: Patch attached with submission follows: --- sys/dev/ichwd/ichwd.c 2009-06-11 22:10:17.000000000 +0400 +++ sys/dev/ichwd/ichwd.c 2009-10-14 16:39:46.000000000 +0400 @@ -316,11 +316,10 @@ cmd &= WD_INTERVAL; timeout = ((uint64_t)1 << cmd) / ICHWD_TICK; if (cmd) { - if (timeout != sc->timeout) { - if (!sc->active) - ichwd_tmr_enable(sc); + if (!sc->active) + ichwd_tmr_enable(sc); + if (timeout != sc->timeout) ichwd_tmr_set(sc, timeout); - } ichwd_tmr_reload(sc); *error = 0; } else { >Release-Note: >Audit-Trail: >Unformatted: