From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=46.4.95.116 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796246253; b=i40MUwjjT9Xf9lgivaGlfT0YIo9esjau5TrjLZcXOf+stmn+ObSGjsnospjLHgm8n6JL mKRqiL+MjzNOSFMNz9nCXR+y1U2cdpc8WjoGwJkJeyfkh/b5wZJJ3qeKzWl8KmYU97pNq +H2cmSKN4y4nlNNcuFoJFn3yJoGDYwUpdY1/c3DxyWsrruTrXRW/ngk8U2iPC95zeWu4A RFkycgAqRfsQkmVPtjKWb344uL4ho91zLtwfAVTXeJhcAIUJ/ytBVEWLzH85FY3QOhTM4 L1EiYMbliaZW9VzFWfTprbssWbGHagw8ro1iwxpeSgqYcKe8pxs7ZP8S7HPz0Zbs+Cw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796246253; h=DMARC-Filter:Received:DKIM-Signature:Received:Date:From:To:cc: Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type; bh=QxvUUYQucckn8IJIdrZFbLObtoYo1CmNf5jl9/Uontw=; b=FBSltg75CB+U7eVd34v8EQQfhchNSBS6sXzrjT2UuchUbqeRXlQdaAgjhsmNxqGKaIfQ 77yfZ8QLqgH1VEhn5g9Da70Qytvi8i0X55zdpwA8uoRkuM8V1AehbN2ATlRBjkb1ZKRjg qNPDE8kyfh+L5Zk8BOnKHzX37pIP33TVBrCDKjTZFoS7eXiUPy0V3t84huHWjrbkbtRjN ScfR6j6axYpm7kFdbTT9N+2n4GJhkDFipdfDwSdxXnUqU4V4AP2rar9uCY2AVLbfjS77c 5Q0JDEUFDku9TkXCkGLZlS0B57hnXhw6wRUe+2p3/kXg9VPhEqSu3JJ/G7Dp+OJMftg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=dolda2000.com; spf=none smtp.mailfrom=dolda2000.com; dkim=pass header.d=dolda2000.com header.i=@dolda2000.com header.a=rsa-sha256 header.s=dolda header.b=xvATvg6a; arc=none smtp.remote-ip=46.4.95.116 Received: from ansgar.seatribe.se (ansgar.seatribe.se [46.4.95.116]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9101606A322; Wed, 2 Dec 2026 21:17:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A9101606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=dolda2000.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=dolda2000.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=dolda2000.com header.i=@dolda2000.com header.a=rsa-sha256 header.s=dolda header.b=xvATvg6a Received: from [2001:9b1:40cc:0:ffff:e9ff:2d3f:febd] (helo=nerv.dolda2000.com) by ansgar.seatribe.se with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1xYrhb-0003Su-2X; Wed, 02 Dec 2026 22:17:23 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dolda2000.com; s=dolda; t=1796246243; bh=JOTsNZpmpiqC7DHe5Wwo7a4EHsek0kmvoVZdaXOkWTU=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=xvATvg6a9zxLksawa67FypgYDnCBWddlexnL26UuDyza1fX2pXgfLpxnnXmk/WgEP S5YlYEkDMDc2mm99Fy1bgd2BGyngYYhus1IBdKE3s2+TLVOECDM6e8NWXhgTrag+E0 GbN69OJ3B9WpzAAvqh3MgSDg6osu3/4spFYHYhDMOUywhFgmP4+P+Z8Dz8of2G0hRW 0GeKX4N6oK4V7+gbhcNNzAMMp1rC+psrvdZb7u53LHOZC+e+ICrhuHFzXuVDohm83r UmGBvS600vzAYZfRiu4S7kBs+J+qhnxknOWwE4frwpWC/l5KCOaBcX3raSkfMTVMnB 4nY+zQ+KRkx0Q== Received: from shack.dolda2000.com (shack.dolda2000.com [192.168.1.187]) (authenticated bits=0) by nerv.dolda2000.com (8.18.1/8.18.1/Debian-6) with ESMTPSA id 6B2LHMWq015522 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 2 Dec 2026 22:17:22 +0100 Date: Wed, 2 Dec 2026 22:17:22 +0100 (CET) From: Fredrik Tolf To: Chuck Lever cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] SUNRPC: Make svcauth_gss sequence-number window size tunable In-Reply-To: <4d7ef5ff-5e24-4f9e-b904-16e5cc3251a2@app.fastmail.com> Message-ID: <0a5d15b2-6dd4-d759-4a96-fb6722b16a4d@dolda2000.com> References: <20261123005648.29562-1-fredrik@dolda2000.com> <9f8f700f-a10f-4aff-a385-4300c8164f1b@app.fastmail.com> <4d7ef5ff-5e24-4f9e-b904-16e5cc3251a2@app.fastmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed 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