From owner-svn-src-all@freebsd.org Sat Aug 8 01:51:38 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 3A48137A184; Sat, 8 Aug 2020 01:51:38 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com [209.85.210.50]) (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 4BNlZd0s9kz4BCN; Sat, 8 Aug 2020 01:51:36 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ot1-f50.google.com with SMTP id a65so3044532otc.8; Fri, 07 Aug 2020 18:51:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=P+/Gi6TXXCwKwAKQZtpj2Cla+rJnZGUntsq1UFB1R/A=; b=L6QIPkjHnbuhytzt+q4DS9MlNE1+TLVwrBs5uJA9TXK6Ckj79+QC7EGD4yXKvsxww5 IyVyASWqvhY+ZhxmkdIZfRWFGa3eHH4c2rmHBA26ffcMxtWT6+nkzQ7WMj3bzIvHFlMi mZ9zz6RXGqzIyYNS0hvEypunPaeTzBKhUYPEQSuF9xkSmc6tANCc7TZijA1VpLKTfzxW 3HdvZAgcXIKISxvuHPpKPEJ2MiFO1XuU3tnwNN4flSJ4Sp4DcGbmf6Y+wyLxfrfy/VG6 j30znYafDRJaNiwZQlIN/UUYqwRD4iRCAzGbYg52VTWGCDfFe5qFgoPpwf+yKoBM1419 qm8Q== X-Gm-Message-State: AOAM533WXUVvTpzufbAI3jZWIEFAEpXrl1TM/1Aj17KD/5m2fzl7/ZDi dkL6CDY3tIkkYrgpzWjOfJ3LH8VwO8s+shm2PEBBjyvH X-Google-Smtp-Source: ABdhPJyW5YIFSaDciMUNP2k4AuQhttZ+BHrtwPX0I6R2DsJMA4EDl33OOovpDhQy6suRhRmYhJwB6OH3KVH8r6bi0yg= X-Received: by 2002:a9d:4b82:: with SMTP id k2mr14646875otf.18.1596851495977; Fri, 07 Aug 2020 18:51:35 -0700 (PDT) MIME-Version: 1.0 References: <202008072306.077N6fjP084661@repo.freebsd.org> In-Reply-To: From: Alan Somers Date: Fri, 7 Aug 2020 19:51:24 -0600 Message-ID: Subject: Re: svn commit: r364044 - in head: share/man/man9 sys/compat/linuxkpi/common/src sys/kern sys/security/audit sys/sys To: Mateusz Guzik Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4BNlZd0s9kz4BCN X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.210.50 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-0.68 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.27)[-0.274]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; NEURAL_HAM_LONG(-0.54)[-0.539]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[freebsd.org]; RWL_MAILSPIKE_GOOD(0.00)[209.85.210.50:from]; NEURAL_SPAM_SHORT(0.13)[0.130]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.210.50:from]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 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: Sat, 08 Aug 2020 01:51:38 -0000 So it's just the struct copy, then? I'm impressed that it made that much difference to remove it. -Alan On Fri, Aug 7, 2020 at 7:40 PM Mateusz Guzik wrote: > or to put differently, the difference is disapperance of vn_stat from > the codepath. > > On 8/8/20, Mateusz Guzik wrote: > > tmpfs_getattr fills > 100 bytes worth of data into struct vattr, which > > then has to be converted to struct stat format. The conversion happens > > to copy some of it as it is and branch on other stuff. tmpfs_stat > > elides the entire process. > > > > On 8/8/20, Alan Somers wrote: > >> On Fri, Aug 7, 2020 at 5:06 PM Mateusz Guzik wrote: > >> > >>> Author: mjg > >>> Date: Fri Aug 7 23:06:40 2020 > >>> New Revision: 364044 > >>> URL: https://svnweb.freebsd.org/changeset/base/364044 > >>> > >>> Log: > >>> vfs: add VOP_STAT > >>> > >>> The current scheme of calling VOP_GETATTR adds avoidable overhead. > >>> > >>> An example with tmpfs doing fstat (ops/s): > >>> before: 7488958 > >>> after: 7913833 > >>> > >>> Reviewed by: kib (previous version) > >>> Differential Revision: https://reviews.freebsd.org/D25910 > >>> > >>> Modified: > >>> head/share/man/man9/Makefile > >>> head/share/man/man9/VOP_ATTRIB.9 > >>> head/sys/compat/linuxkpi/common/src/linux_compat.c > >>> head/sys/kern/vfs_default.c > >>> head/sys/kern/vfs_syscalls.c > >>> head/sys/kern/vfs_vnops.c > >>> head/sys/kern/vnode_if.src > >>> head/sys/security/audit/audit_arg.c > >>> head/sys/sys/vnode.h > >>> > >> > >> What avoidable overhead? The tmpfs_stat handler that you added in your > >> next > >> commit looks pretty much the same as vop_getattr. I'm missing where the > >> performance improvement comes from. Could you please fill me in? > >> -Alan > >> > > > > > > -- > > Mateusz Guzik > > > > > -- > Mateusz Guzik >