Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Mar 2019 09:26:43 +0000
From:      Edward Napierala <trasz@freebsd.org>
To:        FreeBSD FS <freebsd-fs@freebsd.org>
Subject:   'td' vs sys/fs/nfsserver/
Message-ID:  <CAFLM3-ouStEoEmXUmgJzaR5RoR954a4-RdK%2BNe6dzzqzsr50-A@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFLM3-ouStEoEmXUmgJzaR5RoR954a4-RdK%2BNe6dzzqzsr50-A>