🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: muc.lists.freebsd.hackers
Article #64

Re: watchdogd rc ordering

#64
From: Warner Losh
Date: Mon, 26 Oct 2026 23:59
107 lines
10755 bytes
--0000000000006688ad065ec71e99
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Oct 26, 2026 at 5:19=E2=80=AFPM Adrian Chadd <adrian@freebsd.org> w=
rote:

>
>
> On Mon, 26 Oct 2026 at 03:20, Dave Cottlehuber <dch@freebsd.org> wrote:
>
> > IIRC when working on this stuff for MIPS platforms you'll want a couple
>> > of things:
>> >
>> > * the driver self pats the watchdog until userland says "i'm ready to
>> > pat the watchdog again"
>>
>> Ok that=E2=80=99s good to know, I wondered if this is ok, because if som=
ething
>> happens during boot we could be wedged indefinitely and not trigger.
>>
>
> That's always a risk, but you get to decide whether you want that or to
> initialise it to some
> longer time that'll allow a boot to happen. You can't say how long that's
> going to be
> as it really depends upon the system config.  You may want to default it =
to
> program in some longer alarm value and have a device hint control the
> initial
> behaviour (kernel pat or not pat, watchdog alarm fire time) before userla=
nd
> can come configure it.
>
> (And then we should document that as a requirement somewhere....)
>

Yes. What does the watchdog cover, and how do you cope with the mildly
unexpected?

Sometimes when the network is not available, I want it to be patient.
Comcast internet can be flaky, and I don't want to watchdog my machine
because of that.
Sometimes I want it to reboot since the driver on a different machine might
not be quite reliable at coming up the first time and the watchdog and
reboot is the only way to fix it.

I've often thought an early start watchdog would be better, and other times
like the later start. On the whole, though I'm inclined to do an earlier
start since it gives people a better chance to cope with $WEIRD_STUFF using
the watchdog health script.

Warner

--0000000000006688ad065ec71e99
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote g=
mail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Mon, Oct 26,=
 2026 at 5:19=E2=80=AFPM Adrian Chadd &lt;<a href=3D"mailto:adrian@freebsd.=
org">adrian@freebsd.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_=
quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,=
204);padding-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div=
 class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Mon, 26 Oct=
 2026 at 03:20, Dave Cottlehuber &lt;<a href=3D"mailto:dch@freebsd.org" tar=
get=3D"_blank">dch@freebsd.org</a>&gt; wrote:</div><div dir=3D"ltr" class=
=3D"gmail_attr"><br></div><blockquote class=3D"gmail_quote" style=3D"margin=
:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"=
>
&gt; IIRC when working on this stuff for MIPS platforms you&#39;ll want a c=
ouple<br>
&gt; of things:<br>
&gt;<br>
&gt; * the driver self pats the watchdog until userland says &quot;i&#39;m =
ready to <br>
&gt; pat the watchdog again&quot;<br>
<br>
Ok that=E2=80=99s good to know, I wondered if this is ok, because if someth=
ing happens during boot we could be wedged indefinitely and not trigger.<br=
></blockquote><div><br></div><div>That&#39;s always a risk, but you get to =
decide whether you want that or to initialise it to some</div><div>longer t=
ime that&#39;ll allow a boot to happen. You can&#39;t say how long that&#39=
;s going to be</div><div>as it really depends upon the system config.=C2=A0=
 You=C2=A0may want to default it to</div><div>program in some longer alarm =
value and have a device hint control the initial</div><div>behaviour (kerne=
l pat or not pat, watchdog=C2=A0alarm fire time) before userland</div><div>=
can come configure it.</div><div><br></div><div>(And then we should=C2=A0do=
cument that as a requirement somewhere....)</div></div></div></blockquote><=
div><br></div><div>Yes. What does the watchdog cover, and how do you cope w=
ith the mildly unexpected?</div><div><br></div><div>Sometimes when the netw=
ork is not available, I want it to be patient. Comcast internet can be flak=
y, and I don&#39;t want to watchdog my machine because of that.=C2=A0</div>=
<div>Sometimes I want it to reboot since the driver on a different machine =
might not be quite reliable at coming up the first time and the watchdog an=
d reboot is the only way to fix it.</div><div><br></div><div>I&#39;ve often=
 thought an early start watchdog would be better, and other times like the =
later start. On the whole, though I&#39;m inclined to do an earlier start s=
ince it gives people a better chance to cope with $WEIRD_STUFF using the wa=
tchdog health script.</div><div><br></div><div>Warner</div></div></div>

--0000000000006688ad065ec71e99--


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Technical Details
Message-ID: <CANCZdfo51UAqLmBUWSe5D343+8Nt3dkNbh4MXyV5ePymqd5kpw@mail.gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail
References: <> <CAJ-Vmo=FMvda00Cxakvzkgj_FYTWf2Fi57bSfJnVyZf9RFdyAw@mail.gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail
From: Warner Losh <imp@bsdimp.com>
Newsgroups: muc.lists.freebsd.hackers
Subject: Re: watchdogd rc ordering
Date: Mon, 26 Oct 2026 17:59:09 -0600
Organization: Newsgate at muc.de e.V.
Sender: owner-freebsd-hackers@FreeBSD.org
Approved: news-admin@muc.de
Distribution: world
Message-ID: <CANCZdfo51UAqLmBUWSe5D343+8Nt3dkNbh4MXyV5ePymqd5kpw@mail.gmail.com>
References: <> <CAJ-Vmo=FMvda00Cxakvzkgj_FYTWf2Fi57bSfJnVyZf9RFdyAw@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="0000000000006688ad065ec71e99"
Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2";
	logging-data="75492"; mail-complaints-to="news-admin@muc.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1793059166; h=from:from:sender:sender:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to:cc:cc:mime-version:mime-version:
	 content-type:content-type:in-reply-to:in-reply-to:
	 references:references:list-id:list-help:list-owner:list-unsubscribe:
	 list-subscribe:list-post; bh=U/tuzVHMqczthXg+6QAUsO2hWEeUXaGlOR4/8wAybPE=;
	b=kYTZ8LLfm/OL7cd2fDdEQ8eY1YRjapxpXrMYaqcdafOCxDYzL8lbYj5xDbZ9lwyLgdj7bm
	9LDgylH7yuJyqH74w5Id8vtfODWJ8gxO0rj2CBIKAe6eHGmv7uqaGcarsh9+ksMRQGinn5
	NOiyBPE5JXOTaEneOE37g/AaZF17Sf2AuLKE01bFge2dFuR5asFFCypFuuBi6eVkT5HsRH
	LyJkxuC31YsgQlsct+KjiQin+qRjWed6C9uoxvFiS7CIgT0jdSQCbHTpsrmcvh3H5o0p0V
	4fCfMhF5no27Be6zhI7P0iJsSmkDXCsj+kwlUaXxpzTXXQAgW2sgt0u1nWzbRg==
X-Original-To: hackers@mlmmj.nyi.freebsd.org
Authentication-Results: mx1.freebsd.org;
	dkim=pass header.d=bsdimp-com.20251104.gappssmtp.com header.s=20251104 header.b=qBMu6S3r;
	arc=pass ("google.com:s=arc-20260327:i=1");
	spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::42f) smtp.mailfrom=wlosh@bsdimp.com;
	dmarc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bsdimp-com.20251104.gappssmtp.com; s=20251104; t=1793059162; x=1793663962; darn=freebsd.org;
        h=content-type:cc:to:subject:message-id:date:from:in-reply-to
         :references:mime-version:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=U/tuzVHMqczthXg+6QAUsO2hWEeUXaGlOR4/8wAybPE=;
        b=qBMu6S3rBF4J6TH2B+eTB9iNU9tn9GmECRzeRed57+3DxeZkA3d0vygzuJVPh2bgAh
         gEoLCn/nnmfdImfMV42Lz/hgUNIQi8N3eQ9Vd5MFRrT74Kro2eW7axlnh2Ta2LOfC81s
         2vlPplOKShmsA+G/gswpXtPnhxs81wrexwKIG65Ps973OkC5GI1KT9DAl81CJBf+FkV+
         f6++za+g9D12vxaYLhsSmy4nvYFE0/yg9MlAK+L4uRcO4eH2Zspu4iX0ZswdFQwR6OP/
         /lJSPzShV6iYaJ8nmb7KAxddkSwThdM0FcI1g0TkhFqbP4wB3WeX7f5Lgcr04s/o5yOn
         b+vA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1793059162; x=1793663962;
        h=content-type:cc:to:subject:message-id:date:from:in-reply-to
         :references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=U/tuzVHMqczthXg+6QAUsO2hWEeUXaGlOR4/8wAybPE=;
        b=VJ9dnFARqUOlsfDf7jscaqbUEBfV0QvceZopz1QY2Qs4fiWg4g6GxvtfKpfKg/5yVu
         AK2VC6M7oIPKPe1qZvj5aueFtxiX/7iu7VB3OgWulYQMO1GEw+3nxIeLMSt2A/V8vToL
         Ca5DnykNsqlXPyCXnPr+WXwphmIW3YStlVjZhr+cyq+YNoDpXXk4j0CYKgtL+QzynL73
         F6qADVZVyvtCrWks+LMRI3Ae8lkGgLH0c8rpJOwxKTWRYU1MgnVhniDbUXKSYr89r7Cf
         wcY14UZ47yIu4L4YE8/EiH/c3+hoQGL5NDgDLuRbe+jnBIfYy8nZpYsLBb9ighiJ7Nqa
         C0wg==
X-Forwarded-Encrypted: i=1; AKwUvBy32GWSTZ+bht8AKATZsSmuzaQg9L08VgoFqNVbsSIOgXGyPYMJm3MrKYaYc4JM+tt/VesFRUs+@freebsd.org
X-Gm-Message-State: AFq9FYJ63wkpM7YKFxhpQZZhBJ+/n0nkG8Mi55uvUy8IXrcoQa8ZdaS7
	MNvzO5baYwGHrWBFToEPfCgpNqYOOOLWSNUPIoCJMKsREhUMTYvDhtLD8gTOMOPmhyge6ReuyzL
	dKpXb0+G3ciWrpgN7HKQRyP/NU45iSCVzTuDlQMid+A==
X-Gm-Gg: AYBFou2dMtEF1ZNBc/rgsi102V5JADSJZoOiM37RlgihOFTbHaKZvchP16kszJwMXxl
	H3bnW+OMA7iY1Ezm3Dia7+HDkeSQAXMUP1hr/O4AQojm/Xob2O90kE8J1j41KDx/8LNU22+7ZHj
	HI7V4Bq79RrAe8hqVEab8nCqOH2xtYWlIBSsluhp/5GErh/d/tuIxnxrN0Ic9iFAn+X5+r/ggr4
	UbUB3FOlfc6/yarhY//hZCyxwtcqVTqQ7aO42ukOArS6W5yF1CaEIfF8rFnEfmbY2+x5Rzn3WBr
	Ey4NFiPAg6hM70MhXz/N/Cx8AEzlbIYrr1iUTEJkeVKiYcyzO4tHQ8yqECdNMRXXtmb+J4cqhbs
	GhZD3GF+kwbZbF4m2nXlGARlTZS1HTCpaSSfBd70/92HfRC57ISdgYeL/eV85PTtk8Dk=
Precedence: list
In-Reply-To: <CAJ-Vmo=FMvda00Cxakvzkgj_FYTWf2Fi57bSfJnVyZf9RFdyAw@mail.gmail.com>
X-Gm-Features: AclHuK-89OIo6lbycIF7s2Zrn5t3MfXmTpg1dNkwtsZG40kAeLKBHMHEpqTYfz8
X-Spamd-Bar: -
X-Spamd-Result: default: False [-1.00 / 15.00];
	ARC_ALLOW(-1.00)[google.com:s=arc-20260327:i=1];
	FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com];
	R_DKIM_ALLOW(-0.20)[bsdimp-com.20251104.gappssmtp.com:s=20251104];
	MIME_GOOD(-0.10)[multipart/alternative,text/plain];
	ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US];
	R_SPF_NA(0.00)[no SPF record];
	RCVD_COUNT_ONE(0.00)[1];
	MISSING_XM_UA(0.00)[];
	MIME_TRACE(0.00)[0:+,1:+,2:~];
	RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::42f:from];
	RCVD_TLS_LAST(0.00)[];
	MLMMJ_DEST(0.00)[hackers@freebsd.org];
	DMARC_NA(0.00)[bsdimp.com];
	FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com];
	FROM_HAS_DN(0.00)[];
	RCPT_COUNT_THREE(0.00)[3];
	TO_MATCH_ENVRCPT_SOME(0.00)[];
	TO_DN_ALL(0.00)[];
	PREVIOUSLY_DELIVERED(0.00)[hackers@freebsd.org];
	DKIM_TRACE(0.00)[bsdimp-com.20251104.gappssmtp.com:+]
X-Rspamd-Queue-Id: 4jD9Zz5sNcz4nPK
X-Newsgate-Id: f02c70b8849f+
X-No-Archive: Yes