From owner-svn-src-all@freebsd.org Fri Jul 10 09:25:55 2020 Return-Path: Delivered-To: svn-src-all@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 C4FFC3649CA; Fri, 10 Jul 2020 09:25:55 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B372B5dcNz4NLR; Fri, 10 Jul 2020 09:25:54 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x443.google.com with SMTP id a6so5208169wrm.4; Fri, 10 Jul 2020 02:25:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=H52lGY3IEINcovmX9keuh/cjqfM0QZ/kDW0+rBen2d0=; b=B+XF5ldlYX/Day3Rlqj7Vwhjf9FNOw8c20NmeTP9ftDq4xxe+dqHPr3PFE7rzoVaFB i4ZSLE6C/Mw75lQPmCb3gpX3HA63C1VZbSK0bSOXmTJJwuf/GmXDEMgLDayOZasUPS5D OcFuZ+Rt2KuDnhe2ErWWOHmNeqpg1hkLvZPdUsJOYeglSCeOuoKJDZjvAGtNEPMzDdDz j2w5XZECO9kcSk6lW28ItvOARi7VTXw4wBA75DtPZk0knGtrpLXTRjJfCCLApPsYIa4k 7RQRI5pLKrAh71nRVIGhTP4xJBSNMUDaQcagjuJSNK9EW2ebzWDjH7qyGiGZ7TPhNP6D 2ODg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=H52lGY3IEINcovmX9keuh/cjqfM0QZ/kDW0+rBen2d0=; b=ZkFfPaZWEKjywS85Xefph3LRR/E7mAHPWJkdA7w2Byl4fp+RXZePsA0yUJ6+FI+RYX 0e0BdulWjujhLFSNRVbjKXp0dHW/EOQXGESDHt6WfUXBkK6mNAPZxEM0nmqB5lnvItZ+ q1SEjQn9VSweDHwW6a7tCR27TzyxPqZAn9sMok3hRElh2h5m5mnR8YAM+qMZxLDqUtCX ltH01D2WatUbG/V96OoHKXiwvsV3PpvwyNRwwbToE8UlHLoWYEIugkA4RjAcNC8A5Ct3 kuEmf6Mq8BQbGyQOomJV80VsrYInmla7dRQzOpVDfTmqEURRxzzAkePQdtQExXTNekT9 Kgww== X-Gm-Message-State: AOAM531cyWilfR/1hjimwbX0FqTmN1jgLYfsiJ+3wfutlCruSfCHLf3A m9UF7l4wz8hZlBhQ/ESpa0t284SGjvfmnGUJaV1BmA== X-Google-Smtp-Source: ABdhPJx9U+r4izDZKWeYJnhGZLKjfRBAU/7k5zg03qqJ1P5q+kTRDSxslNeHOQYcpRGaB9xio47CbnxBsKnFBXWt32o= X-Received: by 2002:adf:ded2:: with SMTP id i18mr67574304wrn.109.1594373153244; Fri, 10 Jul 2020 02:25:53 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:9d84:0:0:0:0:0 with HTTP; Fri, 10 Jul 2020 02:25:52 -0700 (PDT) In-Reply-To: References: <202007100647.06A6lwCE015392@repo.freebsd.org> <20200710090131.GA34716@x8.osted.lan> From: Mateusz Guzik Date: Fri, 10 Jul 2020 11:25:52 +0200 Message-ID: Subject: Re: svn commit: r363069 - head/sys/kern To: Peter Holm Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4B372B5dcNz4NLR X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=B+XF5ldl; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::443 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-3.74 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; NEURAL_HAM_LONG(-1.04)[-1.035]; TO_DN_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::443:from]; NEURAL_HAM_SHORT(-0.70)[-0.705]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 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, 10 Jul 2020 09:25:55 -0000 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