From owner-svn-src-head@freebsd.org Fri Jul 10 09:54:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 63F793655F3; Fri, 10 Jul 2020 09:54:12 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay05.pair.com (relay05.pair.com [216.92.24.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B37fq60l4z4Q1B; Fri, 10 Jul 2020 09:54:11 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x8.osted.lan (5.186.119.8.cgn.fibianet.dk [5.186.119.8]) by relay05.pair.com (Postfix) with ESMTP id D41E51A27D8; Fri, 10 Jul 2020 05:54:10 -0400 (EDT) Received: from x8.osted.lan (localhost [127.0.0.1]) by x8.osted.lan (8.15.2/8.15.2) with ESMTPS id 06A9s7YF035926 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 10 Jul 2020 11:54:07 +0200 (CEST) (envelope-from pho@x8.osted.lan) Received: (from pho@localhost) by x8.osted.lan (8.15.2/8.15.2/Submit) id 06A9s7Eg035925; Fri, 10 Jul 2020 11:54:07 +0200 (CEST) (envelope-from pho) Date: Fri, 10 Jul 2020 11:54:07 +0200 From: Peter Holm To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r363069 - head/sys/kern Message-ID: <20200710095407.GA35896@x8.osted.lan> References: <202007100647.06A6lwCE015392@repo.freebsd.org> <20200710090131.GA34716@x8.osted.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4B37fq60l4z4Q1B X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of pho@holm.cc has no SPF policy when checking 216.92.24.67) smtp.mailfrom=pho@holm.cc X-Spamd-Result: default: False [-0.07 / 15.00]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.09)[-0.085]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.51)[-0.508]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; RWL_MAILSPIKE_GOOD(0.00)[216.92.24.67:from]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.58)[-0.580]; R_SPF_NA(0.00)[no SPF record]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[pho@freebsd.org,pho@holm.cc]; RCVD_IN_DNSWL_LOW(-0.10)[216.92.24.67:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:7859, ipnet:216.92.0.0/16, country:US]; FROM_NEQ_ENVFROM(0.00)[pho@freebsd.org,pho@holm.cc]; RECEIVED_SPAMHAUS_PBL(0.00)[5.186.119.8:received] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2020 09:54:12 -0000 On Fri, Jul 10, 2020 at 11:25:52AM +0200, Mateusz Guzik wrote: > On 7/10/20, Mateusz Guzik wrote: > > On 7/10/20, Peter Holm wrote: > >> On Fri, Jul 10, 2020 at 06:47:58AM +0000, Mateusz Guzik wrote: > >>> Author: mjg > >>> Date: Fri Jul 10 06:47:58 2020 > >>> New Revision: 363069 > >>> URL: https://svnweb.freebsd.org/changeset/base/363069 > >>> > >>> Log: > >>> vfs: depessimize getfsstat when only the count is requested > >>> > >>> This avoids relocking mountlist_mtx for each entry. > >>> > >>> Modified: > >>> head/sys/kern/vfs_syscalls.c > >>> > >>> Modified: head/sys/kern/vfs_syscalls.c > >>> ============================================================================== > >>> --- head/sys/kern/vfs_syscalls.c Fri Jul 10 06:46:42 2020 (r363068) > >> > >> Could this one be yours? > >> > >> 20200710 09:46:31 all (267/723): procfs.sh > >> panic: lock (sleep mutex) mountlist not locked @ kern/vfs_syscalls.c:561 > >> cpuid = 4 > >> time = 1594367192 > >> KDB: stack backtrace: > >> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > >> 0xfffffe00377a6910 > >> vpanic() at vpanic+0x182/frame 0xfffffe00377a6960 > >> panic() at panic+0x43/frame 0xfffffe00377a69c0 > >> witness_unlock() at witness_unlock+0x147/frame 0xfffffe00377a6a00 > >> __mtx_unlock_flags() at __mtx_unlock_flags+0x4d/frame 0xfffffe00377a6a30 > >> kern_getfsstat() at kern_getfsstat+0x40b/frame 0xfffffe00377a6ab0 > >> sys_getfsstat() at sys_getfsstat+0x22/frame 0xfffffe00377a6ad0 > >> amd64_syscall() at amd64_syscall+0x159/frame 0xfffffe00377a6bf0 > >> fast_syscall_common() at fast_syscall_common+0x101/frame > >> 0xfffffe00377a6bf0 > >> --- syscall (557, FreeBSD ELF64, sys_getfsstat), rip = 0x80032db1a, rsp = > >> 0x7fffffffd738, rbp = 0x7fffffffd790 --- > >> KDB: enter: panic > >> > >> https://people.freebsd.org/~pho/stress/log/mjguzik030.txt > >> > > > > Does this fix it for you? > > > > diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c > > index f37a54809e24..2caf09f3412c 100644 > > --- a/sys/kern/vfs_syscalls.c > > +++ b/sys/kern/vfs_syscalls.c > > @@ -551,7 +551,7 @@ kern_getfsstat(struct thread *td, struct statfs > > **buf, size_t bufsize, > > > > if (count == maxcount) { > > vfs_unbusy(mp); > > - break; > > + goto out; > > } > > > > mtx_lock(&mountlist_mtx); > > > > Reproduced and verified the above fixes it, committed here: > https://svnweb.freebsd.org/changeset/base/363072 > > -- > Mateusz Guzik Yes, thank you. This fixed the problem for me. - Peter