From owner-svn-src-head@freebsd.org Fri Jul 10 09:04:37 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 CC40B3644BB; Fri, 10 Jul 2020 09:04:37 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) (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 4B36Yd3cJqz4MMm; Fri, 10 Jul 2020 09:04:37 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x343.google.com with SMTP id l2so5099878wmf.0; Fri, 10 Jul 2020 02:04:37 -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=Vy5mg3lg8entatbZgPkorP51EQzj6SQKyyQosg8h4fE=; b=I/SJv5+Bi0pTt/c3pbrAUTwa/JSfB2A/1NY14ybFpA2Fnlcl8UVAHzgBbMJYJmlc9H 8FnrfQtg1Ld5MGuYYWu7n8Sh1qjqIoYZkT0dzQOGKiJsdktR/Ird3WlDs2ZCPSUmlXGU /oppClfhJCZgF1xCiL9Wyy5REbTKbyjQxOZPrKdlQTuvZUiLAf/RGwmIoE/AlvN+UIDT hxlXcDYHon/3KVHraJJ86ie9kDPyhNE3+ic/HjD8mtY2ekSv69lA+7fxFByW4iODM3dO Mfrv+foATqcO5ePdtm9Fm/9gGdMWA0DfPnIy7l6nfz9ZbJ6kDkKBf8e53dfwlnaNlpLk on4A== 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=Vy5mg3lg8entatbZgPkorP51EQzj6SQKyyQosg8h4fE=; b=lKuSmiqJxrhq8cDIuq0t647RAfsDyz/bXhJBB7dTmktl5lFlCyKf7j5F361M5KpSUe 6vx4KYCmISPG8o9FBnWpZC1f7KinpRXSv0muQkE1IIuh28S3xIKqfUvLa0ZQEPFDH2dC 90qzKmYhSaDkotyycTOeRr/0mxri3VdORVNT1ju1eXcBhHEua9a18sQlLqsy0GQtnlga L8PORkJ7FwR7lE/cvvYe07Zzt32GvHPtBsIqR70Qnu9SKZpPkKvxNet8h5ctzgbmCLq/ ecTSrRxWZifscn4PuOML8vLChLbQmGKnFkt7/J9sJY94YhMO7SSJ/8rK0+a39MBREXGD xXVA== X-Gm-Message-State: AOAM530/w2KrjRxG9nW8YAAzyjEXkhXQH1jph5/LCaIiWU0FmAu1/AF+ /5MmZ+k4HsvwHdo/WnwsfcxkhRIXGcJDZjl0o0ZMiA== X-Google-Smtp-Source: ABdhPJwZNmyt4cPEplyVEvLNFglKbGGaY11n5clLldz13bnSB4LqbxuEKlqB2lRcPWbkCGrBiknPuUzS2hvIxr2g3Vc= X-Received: by 2002:a05:600c:2209:: with SMTP id z9mr4111140wml.178.1594371875214; Fri, 10 Jul 2020 02:04:35 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:9d84:0:0:0:0:0 with HTTP; Fri, 10 Jul 2020 02:04:34 -0700 (PDT) In-Reply-To: <20200710090131.GA34716@x8.osted.lan> References: <202007100647.06A6lwCE015392@repo.freebsd.org> <20200710090131.GA34716@x8.osted.lan> From: Mateusz Guzik Date: Fri, 10 Jul 2020 11:04:34 +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: 4B36Yd3cJqz4MMm X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] 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:04:37 -0000 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); -- Mateusz Guzik