mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fredrik Tolf <fredrik@dolda2000.com>
To: Chuck Lever <cel@kernel.org>
Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] SUNRPC: Make svcauth_gss sequence-number window size tunable
Date: Wed, 2 Dec 2026 22:17:22 +0100 (CET)	[thread overview]
Message-ID: <0a5d15b2-6dd4-d759-4a96-fb6722b16a4d@dolda2000.com> (raw)
In-Reply-To: <4d7ef5ff-5e24-4f9e-b904-16e5cc3251a2@app.fastmail.com>

On Wed, 2 Dec 2026, Chuck Lever wrote:
> I've made some time to investigate the issue again.

Thank you!

> There are some things that make this much worse: an underpowered NFS 
> server [..]

I do think that is my specific case -- I just have a home server for misc 
tasks, including but not limited to NFS, running on an old Haswell 
dual-core Pentium, and I've already speculated that what caused this to 
start happening to me on the regular was that I upgraded my main desktop 
system that I'm using to more powerful hardware, so that the performance 
disparity between the client and the server has grown.

I imagine this to be a pretty common case, though -- a somewhat 
high-powered desktop system with some spare hardware lying around for a 
NAS seems to be a thing people do. Perhaps the less common thing about my 
setup is using Kerberos authentication, but nevertheless. Anyway...

> (What confused me about your original suggestion was "sunrpc" and 
> "scheduling" in the same sentence: here, it's the kernel's scheduler 
> that chooses which nfsd thread to awaken).

Yes; just to be clear, what I meant was just the specific way that work on 
sunrpc requests is scheduled, which I realize is currently left entirely 
to the general kernel scheduler, which indeed is my main point, that there 
are no NFS/sunrpc-specific scheduling constraints on incoming requests.

At risk of repeating myself, I'm not really that deeply familiar with 
NFS/sunrpc, normally just being a somewhat casual (but long-time) home 
user of them, but as far as my current analysis goes, I think one of the 
following is the proper root-cause fix. I'd like to preface them all, 
however, by re-emphasizing that I think the core weirdness of the protocol 
is the way that the GSS authentication uses a seqno window, which seems 
primarily intended for out-of-order handling under a UDP scenario, where 
authentication failures can be treated the same as simple packet loss, and 
that that whole scenario becomes pretty weird on TCP, where the transport 
layer is supposed to handle integrity and retransmission -- I mean, 
arguably, the sequence numbers could just as well be entirely implicit 
over TCP. With that out of the way:

  * I don't know if this is congruent with the protocol specifications, but
    if requests over TCP could be treated as "lost in transport" just as
    they are over UDP and retransmitted by the client on time-out or such,
    that should make transient authentication failures work just as well as
    they would over UDP.

  * If it is not congruent, then I believe the only "correct" fix is to
    serialize authentication checks with the TCP request order. One way to
    do this would be to do the authentication checks when requests are
    decoded from the transport instead of when they are processed.
    Naturally, this would make the auth checks single-threaded, which might
    not be optimal, but I also imagine they take so much less time than the
    actual processing that it might not be an issue. I haven't profiled it
    though, so I wouldn't actually know.

    I imagine the main issue with this solution is that the authentication
    mechanism itself needs to gain access to (poternially partially
    decoded) requests as they are dequeued from the transport instead of at
    the processing stage, but I'm not familiar enough with the sunrpc
    servicing code to know whether this is a major issue/rewrite. Arguably,
    however, as you stated, GSS authentication *has* an intrinsic ordering
    constraint and therefore *needs* this, so it might be what it is.

  * If the lack of parallelism *is* an issue, then the solution I would
    consider would be to use some sort of locking on the struct
    gss_svc_seq_data, so that auth checks that need to progress the window
    cannot proceed until prior requests have all been authenticated. That
    would delay/serialize further processing of *some* requests, of course,
    but unlike the prior suggestion, that would be the exception rather
    than the rule.

    Perhaps, depending on the structure of the current code, this may also
    be easier to implement than serializing all authencation, given that
    requests could be identified as prior or subsequent based on some
    counter that could be set cheaply when dequeuing them from the
    transport, rather than needing to be partially decoded to get to the
    actual GSS sequence number.

Is any of this reasonable?

--
Fredrik Tolf

      reply	other threads:[~2026-12-02 21:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23  0:56 Fredrik Tolf
2026-11-23 14:20 ` Chuck Lever
2026-11-23 16:26   ` Fredrik Tolf
2026-12-02 19:46     ` Chuck Lever
2026-12-02 21:17       ` Fredrik Tolf [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0a5d15b2-6dd4-d759-4a96-fb6722b16a4d@dolda2000.com \
    --to=fredrik@dolda2000.com \
    --cc=cel@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®