mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tim Menninger <tmenninger@everpuredata.com>
To: trondmy@kernel.org
Cc: anna@kernel.org, cel@kernel.org, ebadger@everpuredata.com,
	jcurley@everpuredata.com, jlayton@kernel.org,
	linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org,
	netdev@vger.kernel.org, slingappa@everpuredata.com
Subject: Re: [PATCH v2 1/2] SUNRPC: add request-scoped disconnects when cancelling tasks
Date: Thu,  5 Nov 2026 17:06:53 +0000	[thread overview]
Message-ID: <20261105170653.3200815-1-tmenninger@everpuredata.com> (raw)
In-Reply-To: <b9ed2a8b5f687d7f581d4867a7867c5c012bb2cc.camel@kernel.org>

> I'm all for optimising where it makes sense, however this is adding
> another spinlock protected section in xprt_release() for something that
> is clearly a rare corner case.

I agree about avoiding the additional lock acquisition in
xprt_release(). I should rework that part.

> So how about something like the following change instead?

I tested it with the same reproducer, but I still see the reconnect
behavior, without a noticeable improvement.

I think there are two separate issues here. Counting only successful
cancellations avoids triggering another disconnect merely because an
already-cancelled task still matches. Cancelling untransmitted tasks
separately also avoids disconnecting solely because of those tasks.

However, when cancellation of a transmitted task succeeds, we still call
rpc_clnt_disconnect(), which disconnects every connected transport on
that client. That can affect another transport which carried no matching
requests, or a replacement connection generation established since the
cancelled request was transmitted. Neither RPC_WAS_SENT() nor a
successful cancellation status update tells us whether those connections
carried the affected request.

What I'm trying to do is limit that blast radius. For a request with
rq_xprt == X and rq_connect_cookie == C, cancellation should not
disconnect X if its current cookie no longer matches C, nor disconnect
an unrelated transport Y on the same client.

Would retaining the request/connection-generation scope, while removing
the additional unconditional lock acquisition from xprt_release(), be a
reasonable direction?

  reply	other threads:[~2026-11-05 17:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05  2:02 [PATCH v2 0/2] SUNRPC/NFS: limit transport disconnects when cancelling flexfiles I/O tmenninger
2026-11-05  2:02 ` [PATCH v2 1/2] SUNRPC: add request-scoped disconnects when cancelling tasks tmenninger
2026-11-05  3:14   ` Trond Myklebust
2026-11-05  3:20     ` Trond Myklebust
2026-11-05 17:06       ` Tim Menninger [this message]
2026-11-05  2:02 ` [PATCH v2 2/2] NFSv4/flexfiles: limit transport disconnects when cancelling I/O tmenninger

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=20261105170653.3200815-1-tmenninger@everpuredata.com \
    --to=tmenninger@everpuredata.com \
    --cc=anna@kernel.org \
    --cc=cel@kernel.org \
    --cc=ebadger@everpuredata.com \
    --cc=jcurley@everpuredata.com \
    --cc=jlayton@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=slingappa@everpuredata.com \
    --cc=trondmy@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®