[LTP] [PATCH 1/1] nfsstat01: Update client RPC calls for kernel 6.9
Petr Vorel
pvorel@suse.cz
Wed Aug 14 22:55:19 CEST 2024
> On Fri, 12 Jul 2024, Jeff Layton wrote:
> > On Fri, 2024-07-12 at 16:12 +1000, NeilBrown wrote:
> > > My point is that if we are going to change the kernel to accommodate LTP
> > > at all, we should accommodate LTP as it is today. If we are going to
> > > change LTP to accommodate the kernel, then it should accommodate the
> > > kernel as it is today.
> > The problem is that there is no way for userland tell the difference
> > between the older and newer behavior. That was what I was suggesting we
> > add.
> To make sure I wasn't talking through my hat, I had a look at the ltp
> code.
> The test in question simply tests that the count of RPC calls increases.
> It can get the count of RPC calls in one of 2 ways :
> 1/ "lhost" - look directly in /proc/net/rpc/{nfs,nfsd}
> 2/ "rhost" - ssh to the server and look in that file.
FYI "rhost" in LTP can be either using namespaces (Single Host Configuration [1]),
which is run by default, or SSH based (Two Host Configuration [2]). IMHO most of
the testers (including myself run tests simply via network namespaces).
NOTE: I suppose CONFIG_NAMESPACES=y is a must for 'ip netns' to be working, thus
tests would hopefully failed early on kernel having that disabled.
> The current test to "fix" this for kernels -ge "6.9" is to force the use
> of "rhost".
> I'm guessing that always using "rhost" for the nfsd stats would always
> work.
FYI this old commit [3] allowed these tests to be working in network namespaces.
It reads for network namespaces both /proc/net/rpc/{nfs,nfsd} from non-namespace
("lhost"). This is the subject of the change in 6.9, which now fails.
And for SSH based we obviously look on "rhost" already.
> But if not, the code could get both the local and remote nfsd stats, and
> check that at least one of them increases (and neither decrease).
This sounds reasonable, thanks for a hint. I'll just look for client RPC calls
(/proc/net/rpc/nfs) in both non-namespace and namespace. The only think is that
we effectively give up checking where it should be (if it for whatever reason in
the future changes again, we miss that). I'm not sure if this would be treated
the same as the current situation (Josef Bacik had obvious reasons for this to
be working).
@Josef @NFS maintainers: WDYT?
Kind regards,
Petr
> So ltp doesn't need to know which kernel is being used - it can be
> written to work safely on either.
> NeilBrown
[1] https://github.com/linux-test-project/ltp/tree/master/testcases/network#single-host-configuration
[2] https://github.com/linux-test-project/ltp/tree/master/testcases/network#two-host-configuration
[3] https://github.com/linux-test-project/ltp/commit/40958772f11d90e4b5052e7e772a3837d285cf89
> > To be clear, I hold this opinion loosely. If the consensus is that we
> > need to revert things then so be it. I just don't see the value of
> > doing that in this particular situation.
> > --
> > Jeff Layton <jlayton@kernel.org>
More information about the ltp
mailing list