From owner-freebsd-fs@freebsd.org Tue Mar 5 09:26:57 2019 Return-Path: Delivered-To: freebsd-fs@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 1EC2715218C8 for ; Tue, 5 Mar 2019 09:26:57 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-ot1-f67.google.com (mail-ot1-f67.google.com [209.85.210.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E15A889D5 for ; Tue, 5 Mar 2019 09:26:56 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-ot1-f67.google.com with SMTP id n71so6838526ota.10 for ; Tue, 05 Mar 2019 01:26:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=5BSfxPz+QpITUc5KvNJnkGhj9vSpRT1QD8014Q+8feQ=; b=htYyPQxOWRn1fLxjKmZhEcFDLrvb/jB4BigeYOr3u2vOlZRJvbhCLv3fKCZfZETeXq Ks3Dbg4kxDKXr3PSu/DZCqRz7yRztPyQ6/tNG1cUYHENhSmSfI1cA8iGaOHIw2C5fjyB hJVKFM/cEosjXkO2aeRc6sg7lWe2C+TVmw7erbtI3E51qQZk74nqeBCJsL/NVrPrcuyr GnNiPQQeNstuOej7YjZKJVcHapS+YQof7xrt8mPNiutMHuUNvKqu3CwdGGxKlP/pWObH PHOVljFIzUEDWcZnArhvpcdRMdj1nsM0NJmbdCudTBItMIU2p2YjiXbJSeKV8OgrIfIK QQpQ== X-Gm-Message-State: APjAAAXlxG1Zd8d1SXp+c1GncegVj7ZDLU5EuEh/NThK281DlFDiiAXv 8plk+7YU3XKpU/iXI2vHh8YgpR4NqU72KS7GgerfSrAs X-Google-Smtp-Source: APXvYqz6uq6Vri9Mha1AuzcbDcJp7sLDHAZKulU9O7VseabWlTfNmSgVNNrK2m19Y8HcHCePz3y51Ff5/me02XImyxM= X-Received: by 2002:a05:6830:1193:: with SMTP id u19mr341469otq.221.1551778014814; Tue, 05 Mar 2019 01:26:54 -0800 (PST) MIME-Version: 1.0 From: Edward Napierala Date: Tue, 5 Mar 2019 09:26:43 +0000 Message-ID: Subject: 'td' vs sys/fs/nfsserver/ To: FreeBSD FS Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4E15A889D5 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of etnapierala@gmail.com designates 209.85.210.67 as permitted sender) smtp.mailfrom=etnapierala@gmail.com X-Spamd-Result: default: False [-3.82 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-fs@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_TRACE(0.00)[0:+]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.62)[-0.619,0]; RCVD_IN_DNSWL_NONE(0.00)[67.210.85.209.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[]; FORGED_SENDER(0.30)[trasz@freebsd.org,etnapierala@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[trasz@freebsd.org,etnapierala@gmail.com]; IP_SCORE(-1.19)[ipnet: 209.85.128.0/17(-3.84), asn: 15169(-2.04), country: US(-0.07)]; TO_DOM_EQ_FROM_DOM(0.00)[] X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Mar 2019 09:26:57 -0000 Hello. As many of you know, right now, throughout the kernel, there=E2=80=99s the =E2=80=98td=E2=80=99 argument being passed over and ove= r, even though we have a cheap way of accessing it by using =E2=80=98curthread=E2=80=99. = That=E2=80=99s suboptimal for obvious reasons. It can=E2=80=99t be fixed =E2=80=98just li= ke that=E2=80=99, as it would introduce a lot of code churn, and also possible bugs in case we miss a case where the =E2=80=98td=E2=80=99 is not equal to curth= read. So, here's the big picture: this is what I'm _not_ intending to do at this point. What I do intend doing is to go and try to fix it in a single kernel component, the NFS server. The idea: drop the =E2=80=98td=E2=80=99 argumen= t (in case of NFS server it=E2=80=99s usually spelled =E2=80=98p=E2=80=99 due to = historical reasons) where it=E2=80=99s unused, which turns out to be quite often, and otherwise push =E2=80=98td=E2=80=99 down, function by function, so that whe= n you review it it=E2=80=99s obvious that it=E2=80=99s equal to curthread. There= are three reasons to do this: first, it makes it very obvious that the=E2=80=A8td passed to various VOPs it calls is indeed always curthread, and makes it easier to do the change described in the previous paragraph, should someone try it. Second=E2=80=A6 well, it=E2=80=99s a cle= anup: the NFS code passes it everywhere, and in many cases it's not used at all. Third, and this is the man reason: it=E2=80=99s a good way to test the idea of pushing td down layer by layer without touching any APIs that are not local to the NFS server, to see if it works, and if it doesn't annoy people to much. =E2=80=A8=E2=80=A8=E2=80=A8So, since I= =E2=80=99ve been asked to discuss it in public first: what do you guys think?