From owner-svn-src-all@freebsd.org Fri Apr 6 17:06:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03289F968CD; Fri, 6 Apr 2018 17:06:23 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8E5C69132; Fri, 6 Apr 2018 17:06:22 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3BDA14A79; Fri, 6 Apr 2018 17:06:22 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36H6MF6056596; Fri, 6 Apr 2018 17:06:22 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36H6MEg056595; Fri, 6 Apr 2018 17:06:22 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201804061706.w36H6MEg056595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Fri, 6 Apr 2018 17:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332117 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 332117 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 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: Fri, 06 Apr 2018 17:06:23 -0000 Author: jtl Date: Fri Apr 6 17:06:22 2018 New Revision: 332117 URL: https://svnweb.freebsd.org/changeset/base/332117 Log: Pat the watchdog less while producing a coredump. Prior to this change, we patted the watchdog approximately once per 4KB page of memory. After this change, we pat the watchdog approximately once per 128MB of memory. On a sample machine, this translated to patting the watchdog approximately every 5.4 seconds, which "seems reasonable". We can choose a different value in the future, if warranted. This has extensive field experience. It is a performance improvement, and has not caused any known problems. Reviewed by: imp, kib Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D14988 Modified: head/sys/amd64/amd64/minidump_machdep.c Modified: head/sys/amd64/amd64/minidump_machdep.c ============================================================================== --- head/sys/amd64/amd64/minidump_machdep.c Fri Apr 6 17:04:21 2018 (r332116) +++ head/sys/amd64/amd64/minidump_machdep.c Fri Apr 6 17:06:22 2018 (r332117) @@ -62,7 +62,7 @@ static struct kerneldumpheader kdh; /* Handle chunked writes. */ static size_t fragsz; static void *dump_va; -static size_t counter, progress, dumpsize; +static size_t counter, progress, dumpsize, wdog_next; CTASSERT(sizeof(*vm_page_dump) == 8); static int dump_retry_count = 5; @@ -134,6 +134,9 @@ report_progress(size_t progress, size_t dumpsize) } } +/* Pat the watchdog approximately every 128MB of the dump. */ +#define WDOG_DUMP_INTERVAL (128 * 1024 * 1024) + static int blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz) { @@ -173,9 +176,14 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t report_progress(progress, dumpsize); counter &= (1<<24) - 1; } + if (progress <= wdog_next) { + wdog_kern_pat(WD_LASTVAL); + if (wdog_next > WDOG_DUMP_INTERVAL) + wdog_next -= WDOG_DUMP_INTERVAL; + else + wdog_next = 0; + } - wdog_kern_pat(WD_LASTVAL); - if (ptr) { error = dump_append(di, ptr, 0, len); if (error) @@ -313,7 +321,7 @@ minidumpsys(struct dumperinfo *di) } dumpsize += PAGE_SIZE; - progress = dumpsize; + wdog_next = progress = dumpsize; /* Initialize mdhdr */ bzero(&mdhdr, sizeof(mdhdr));