From: Jeff Layton <jlayton@kernel.org>
To: Chuck Lever <cel@kernel.org>, NeilBrown <neil@brown.name>,
Olga Kornievskaia <okorniev@redhat.com>,
Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Cc: Rick Macklem <rmacklem@uoguelph.ca>, linux-nfs@vger.kernel.org
Subject: Re: [PATCH v2 5/7] NFSD: Evict completed DRC entries via implied ACK
Date: Fri, 28 Aug 2026 15:15:41 -0400 [thread overview]
Message-ID: <a99df73fc1db0f976da665cfb4ea39682f680118.camel@kernel.org> (raw)
In-Reply-To: <10c97c34-1061-4aa2-a5b5-234e4d01e894@app.fastmail.com>
On Fri, 2026-08-28 at 14:59 -0400, Chuck Lever wrote:
> On Fri, Aug 28, 2026, at 2:38 PM, Jeff Layton wrote:
> > On Fri, 2026-08-28 at 12:17 -0400, Chuck Lever wrote:
> > > A completed DRC entry stays in its bucket until RC_EXPIRE elapses or
> > > the cache exceeds max_drc_entries. Entries whose replies the client
> > > already holds lengthen the bucket and slow every lookup that hashes
> > > there.
> > >
> > > RFC 1813 Section 4.5 observes that on a connection-oriented transport
> > > a duplicate request arises from reconnection, not from within a live
> > > connection. A fresh request on a live TCP or RDMA connection therefore
> > > means the client is not retransmitting an earlier one. UDP clients
> > > retransmit on timeout over a shared svc_xprt, so eviction is
> > > restricted to transports marked XPT_ORDERED. Even there the evidence
> > > is not conclusive, since a client with several requests outstanding
> > > sends the next before the previous reply arrives. The cache is
> > > advisory: a premature eviction costs a miss and re-execution, the same
> > > outcome memory pressure and RC_EXPIRE already produce.
> >
> > No, it's not. The DRC is necessary for proper function, and if we drop
> > non-idempotent requests prematurely, then that could cause spurious
> > errors.
> >
> > Or am I misunderstanding what you mean by "The cache" here?
>
> Not talking about the NFSv4.1 session cache. The old DRC has
> always been best-effort. It cannot be relied upon for proper
> function, since the DRC is non-deterministic.
>
Yes, but in this case you can potentially evict this thing well before
you actually need it:
- client does a v3 RENAME (anything non-idempotent, really)
- reply to the RENAME goes out just before a new call comes in (WRITE
or something maybe). The RENAME DRC entry's timestamp is a few jiffies
earlier so we evict it.
- connection drops before client gets the reply and client reconnects
and retransmits the v3 RENAME
...hilarity ensues? Maybe this sort of bad luck never happens in
practice, but I don't see what would prevent it.
> The point I'm making here is that items already get evicted
> due to memory pressure or because the DRC size is capped.
>
> In particular, if you are actively removing items that are
> very unlikely to be hit, that *reduces* the likelihood that
> other, perhaps more valuable, items will be evicted due to
> memory pressure.
>
Sure, but usually we evict the oldest stuff first, and we generally
keep a big enough cache to get past the point where retransmissions
occur. This patchset changes that and will evict things earlier.
Maybe that's OK in practice.
--
Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2026-08-28 19:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-28 16:17 [PATCH v2 0/7] Implied-ACK eviction for NFSD's duplicate reply cache Chuck Lever
2026-08-28 16:17 ` [PATCH v2 1/7] SUNRPC: Assign a unique identifier to each svc_xprt Chuck Lever
2026-08-28 18:37 ` Jeff Layton
2026-08-28 16:17 ` [PATCH v2 2/7] NFSD: Track transport in DRC entries Chuck Lever
2026-08-28 16:17 ` [PATCH v2 3/7] SUNRPC: Record last-request timestamp on svc_xprt Chuck Lever
2026-08-28 16:17 ` [PATCH v2 4/7] SUNRPC: Mark connection-oriented transports " Chuck Lever
2026-08-28 18:19 ` Jeff Layton
2026-08-28 16:17 ` [PATCH v2 5/7] NFSD: Evict completed DRC entries via implied ACK Chuck Lever
2026-08-28 18:38 ` Jeff Layton
2026-08-28 18:59 ` Chuck Lever
2026-08-28 19:15 ` Jeff Layton [this message]
2026-08-28 20:37 ` Chuck Lever
2026-08-28 16:17 ` [PATCH v2 6/7] NFSD: Add tracepoints for DRC entry eviction Chuck Lever
2026-08-28 16:17 ` [PATCH v2 7/7] NFSD: Record DRC population in lookup tracepoints Chuck Lever
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=a99df73fc1db0f976da665cfb4ea39682f680118.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=Dai.Ngo@oracle.com \
--cc=cel@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neil@brown.name \
--cc=okorniev@redhat.com \
--cc=rmacklem@uoguelph.ca \
--cc=tom@talpey.com \
/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