From owner-svn-src-all@FreeBSD.ORG Mon Dec 19 19:19:21 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE1C0106566B; Mon, 19 Dec 2011 19:19:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 27C7F8FC15; Mon, 19 Dec 2011 19:19:19 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id VAA12381; Mon, 19 Dec 2011 21:19:18 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Rcik2-000GGM-9q; Mon, 19 Dec 2011 21:19:18 +0200 Message-ID: <4EEF8E34.7010100@FreeBSD.org> Date: Mon, 19 Dec 2011 21:19:16 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111206 Thunderbird/8.0 MIME-Version: 1.0 To: Attilio Rao References: <201104281602.p3SG265H030096@svn.freebsd.org> In-Reply-To: <201104281602.p3SG265H030096@svn.freebsd.org> X-Enigmail-Version: undefined Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r221173 - in head/sys: amd64/amd64 arm/arm i386/i386 ia64/ia64 kern mips/mips powerpc/powerpc x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2011 19:19:21 -0000 on 28/04/2011 19:02 Attilio Rao said the following: > Author: attilio > Date: Thu Apr 28 16:02:05 2011 > New Revision: 221173 > URL: http://svn.freebsd.org/changeset/base/221173 > > Log: > Add the watchdogs patting during the (shutdown time) disk syncing and > disk dumping. > With the option SW_WATCHDOG on, these operations are doomed to let > watchdog fire, fi they take too long. > > I implemented the stubs this way because I really want wdog_kern_* > KPI to not be dependant by SW_WATCHDOG being on (and really, the option > only enables watchdog activation in hardclock) and also avoid to > call them when not necessary (avoiding not-volountary watchdog > activations). > > Sponsored by: Sandvine Incorporated > Discussed with: emaste, des > MFC after: 2 weeks Attilio, I wonder what was the reason to put all this patting under SW_WATCHDOG. I think that the code that you added can also be useful without SW_WATCHDOG with hardware watchdog drivers. SW_WATCHDOG is good for debugging, but is not as reliable as hardware watchdogs. Thank you. > Modified: > head/sys/amd64/amd64/minidump_machdep.c > head/sys/arm/arm/dump_machdep.c > head/sys/arm/arm/minidump_machdep.c > head/sys/i386/i386/minidump_machdep.c > head/sys/ia64/ia64/dump_machdep.c > head/sys/kern/kern_shutdown.c > head/sys/kern/vfs_subr.c > head/sys/mips/mips/dump_machdep.c > head/sys/powerpc/powerpc/dump_machdep.c > head/sys/x86/x86/dump_machdep.c > > Modified: head/sys/amd64/amd64/minidump_machdep.c > ============================================================================== > --- head/sys/amd64/amd64/minidump_machdep.c Thu Apr 28 14:55:41 2011 (r221172) > +++ head/sys/amd64/amd64/minidump_machdep.c Thu Apr 28 16:02:05 2011 (r221173) > @@ -27,6 +27,8 @@ > #include > __FBSDID("$FreeBSD$"); > > +#include "opt_watchdog.h" > + > #include > #include > #include > @@ -34,6 +36,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#ifdef SW_WATCHDOG > +#include > +#endif > #include > #include > #include > @@ -167,6 +172,9 @@ blk_write(struct dumperinfo *di, char *p > report_progress(progress, dumpsize); > counter &= (1<<24) - 1; > } > +#ifdef SW_WATCHDOG > + wdog_kern_pat(WD_LASTVAL); > +#endif > if (ptr) { > error = dump_write(di, ptr, 0, dumplo, len); > if (error) > > Modified: head/sys/arm/arm/dump_machdep.c > ============================================================================== > --- head/sys/arm/arm/dump_machdep.c Thu Apr 28 14:55:41 2011 (r221172) > +++ head/sys/arm/arm/dump_machdep.c Thu Apr 28 16:02:05 2011 (r221173) > @@ -27,6 +27,8 @@ > #include > __FBSDID("$FreeBSD$"); > > +#include "opt_watchdog.h" > + > #include > #include > #include > @@ -35,6 +37,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#ifdef SW_WATCHDOG > +#include > +#endif > #include > #include > #include > @@ -189,6 +194,9 @@ cb_dumpdata(struct md_pa *mdp, int seqnr > cpu_tlb_flushID_SE(0); > cpu_cpwait(); > } > +#ifdef SW_WATCHDOG > + wdog_kern_pat(WD_LASTVAL); > +#endif > error = dump_write(di, > (void *)(pa - (pa & L1_ADDR_BITS)),0, dumplo, sz); > if (error) > > Modified: head/sys/arm/arm/minidump_machdep.c > ============================================================================== > --- head/sys/arm/arm/minidump_machdep.c Thu Apr 28 14:55:41 2011 (r221172) > +++ head/sys/arm/arm/minidump_machdep.c Thu Apr 28 16:02:05 2011 (r221173) > @@ -29,6 +29,8 @@ > #include > __FBSDID("$FreeBSD$"); > > +#include "opt_watchdog.h" > + > #include > #include > #include > @@ -36,6 +38,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#ifdef SW_WATCHDOG > +#include > +#endif > #include > #include > #include > @@ -138,6 +143,9 @@ blk_write(struct dumperinfo *di, char *p > counter &= (1<<22) - 1; > } > > +#ifdef SW_WATCHDOG > + wdog_kern_pat(WD_LASTVAL); > +#endif > if (ptr) { > error = dump_write(di, ptr, 0, dumplo, len); > if (error) > > Modified: head/sys/i386/i386/minidump_machdep.c > ============================================================================== > --- head/sys/i386/i386/minidump_machdep.c Thu Apr 28 14:55:41 2011 (r221172) > +++ head/sys/i386/i386/minidump_machdep.c Thu Apr 28 16:02:05 2011 (r221173) > @@ -27,6 +27,8 @@ > #include > __FBSDID("$FreeBSD$"); > > +#include "opt_watchdog.h" > + > #include > #include > #include > @@ -34,6 +36,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#ifdef SW_WATCHDOG > +#include > +#endif > #include > #include > #include > @@ -138,6 +143,9 @@ blk_write(struct dumperinfo *di, char *p > printf(" %lld", PG2MB(progress >> PAGE_SHIFT)); > counter &= (1<<24) - 1; > } > +#ifdef SW_WATCHDOG > + wdog_kern_pat(WD_LASTVAL); > +#endif > if (ptr) { > error = dump_write(di, ptr, 0, dumplo, len); > if (error) > > Modified: head/sys/ia64/ia64/dump_machdep.c > ============================================================================== > --- head/sys/ia64/ia64/dump_machdep.c Thu Apr 28 14:55:41 2011 (r221172) > +++ head/sys/ia64/ia64/dump_machdep.c Thu Apr 28 16:02:05 2011 (r221173) > @@ -27,12 +27,17 @@ > #include > __FBSDID("$FreeBSD$"); > > +#include "opt_watchdog.h" > + > #include > #include > #include > #include > #include > #include > +#ifdef SW_WATCHDOG > +#include > +#endif > #include > #include > #include > @@ -125,6 +130,9 @@ cb_dumpdata(struct efi_md *mdp, int seqn > printf("%c\b", "|/-\\"[twiddle++ & 3]); > counter &= (1<<24) - 1; > } > +#ifdef SW_WATCHDOG > + wdog_kern_pat(WD_LASTVAL); > +#endif > error = dump_write(di, (void*)pa, 0, dumplo, sz); > if (error) > break; > > Modified: head/sys/kern/kern_shutdown.c > ============================================================================== > --- head/sys/kern/kern_shutdown.c Thu Apr 28 14:55:41 2011 (r221172) > +++ head/sys/kern/kern_shutdown.c Thu Apr 28 16:02:05 2011 (r221173) > @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); > #include "opt_panic.h" > #include "opt_show_busybufs.h" > #include "opt_sched.h" > +#include "opt_watchdog.h" > > #include > #include > @@ -65,6 +66,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#ifdef SW_WATCHDOG > +#include > +#endif > > #include > > @@ -310,6 +314,9 @@ kern_reboot(int howto) > > waittime = 0; > > +#ifdef SW_WATCHDOG > + wdog_kern_pat(WD_LASTVAL); > +#endif > sync(curthread, NULL); > > /* > @@ -335,6 +342,9 @@ kern_reboot(int howto) > if (nbusy < pbusy) > iter = 0; > pbusy = nbusy; > +#ifdef SW_WATCHDOG > + wdog_kern_pat(WD_LASTVAL); > +#endif > sync(curthread, NULL); > > #ifdef PREEMPTION > > Modified: head/sys/kern/vfs_subr.c > ============================================================================== > --- head/sys/kern/vfs_subr.c Thu Apr 28 14:55:41 2011 (r221172) > +++ head/sys/kern/vfs_subr.c Thu Apr 28 16:02:05 2011 (r221173) > @@ -42,6 +42,7 @@ > __FBSDID("$FreeBSD$"); > > #include "opt_ddb.h" > +#include "opt_watchdog.h" > > #include > #include > @@ -72,6 +73,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#ifdef SW_WATCHDOG > +#include > +#endif > > #include > > @@ -1839,6 +1843,10 @@ sched_sync(void) > LIST_INSERT_HEAD(next, bo, bo_synclist); > continue; > } > +#ifdef SW_WATCHDOG > + if (first_printf == 0) > + wdog_kern_pat(WD_LASTVAL); > +#endif > } > if (!LIST_EMPTY(gslp)) { > mtx_unlock(&sync_mtx); > > Modified: head/sys/mips/mips/dump_machdep.c > ============================================================================== > --- head/sys/mips/mips/dump_machdep.c Thu Apr 28 14:55:41 2011 (r221172) > +++ head/sys/mips/mips/dump_machdep.c Thu Apr 28 16:02:05 2011 (r221173) > @@ -27,6 +27,8 @@ > #include > __FBSDID("$FreeBSD$"); > > +#include "opt_watchdog.h" > + > #include > #include > #include > @@ -35,6 +37,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#ifdef SW_WATCHDOG > +#include > +#endif > #include > #include > #include > @@ -182,6 +187,9 @@ cb_dumpdata(struct md_pa *mdp, int seqnr > counter &= (1<<24) - 1; > } > > +#ifdef SW_WATCHDOG > + wdog_kern_path(WD_LASTVAL); > +#endif > error = dump_write(di, (void *)(intptr_t)(pa),0, dumplo, sz); /* XXX fix PA */ > if (error) > break; > > Modified: head/sys/powerpc/powerpc/dump_machdep.c > ============================================================================== > --- head/sys/powerpc/powerpc/dump_machdep.c Thu Apr 28 14:55:41 2011 (r221172) > +++ head/sys/powerpc/powerpc/dump_machdep.c Thu Apr 28 16:02:05 2011 (r221173) > @@ -27,6 +27,8 @@ > #include > __FBSDID("$FreeBSD$"); > > +#include "opt_watchdog.h" > + > #include > #include > #include > @@ -34,6 +36,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#ifdef SW_WATCHDOG > +#include > +#endif > #include > #include > #include > @@ -129,6 +134,9 @@ cb_dumpdata(struct pmap_md *md, int seqn > printf("%c\b", "|/-\\"[twiddle++ & 3]); > counter &= (1<<24) - 1; > } > +#ifdef SW_WATCHDOG > + wdog_kern_pat(WD_LASTVAL); > +#endif > error = di->dumper(di->priv, (void*)va, 0, dumplo, sz); > pmap_dumpsys_unmap(md, ofs, va); > if (error) > > Modified: head/sys/x86/x86/dump_machdep.c > ============================================================================== > --- head/sys/x86/x86/dump_machdep.c Thu Apr 28 14:55:41 2011 (r221172) > +++ head/sys/x86/x86/dump_machdep.c Thu Apr 28 16:02:05 2011 (r221173) > @@ -27,6 +27,8 @@ > #include > __FBSDID("$FreeBSD$"); > > +#include "opt_watchdog.h" > + > #include > #include > #include > @@ -34,6 +36,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#ifdef SW_WATCHDOG > +#include > +#endif > #include > #include > #include > @@ -193,6 +198,9 @@ cb_dumpdata(struct md_pa *mdp, int seqnr > a = pa + i * PAGE_SIZE; > va = pmap_kenter_temporary(trunc_page(a), i); > } > +#ifdef SW_WATCHDOG > + wdog_kern_pat(WD_LASTVAL); > +#endif > error = dump_write(di, va, 0, dumplo, sz); > if (error) > break; -- Andriy Gapon