From: yangerkun <yangerkun@huawei.com>
To: Trond Myklebust <trondmy@hammerspace.com>,
"horms@kernel.org" <horms@kernel.org>,
"davem@davemloft.net" <davem@davemloft.net>,
"chuck.lever@oracle.com" <chuck.lever@oracle.com>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"okorniev@redhat.com" <okorniev@redhat.com>,
"anna@kernel.org" <anna@kernel.org>,
"lilingfeng3@huawei.com" <lilingfeng3@huawei.com>,
"Dai.Ngo@oracle.com" <Dai.Ngo@oracle.com>,
"jlayton@kernel.org" <jlayton@kernel.org>,
"neilb@suse.de" <neilb@suse.de>,
"tom@talpey.com" <tom@talpey.com>,
"edumazet@google.com" <edumazet@google.com>,
"kuba@kernel.org" <kuba@kernel.org>
Cc: "lilingfeng@huaweicloud.com" <lilingfeng@huaweicloud.com>,
"houtao1@huawei.com" <houtao1@huawei.com>,
"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"yukuai1@huaweicloud.com" <yukuai1@huaweicloud.com>,
"yi.zhang@huawei.com" <yi.zhang@huawei.com>
Subject: Re: [PATCH] SUNRPC: Set tk_rpc_status when RPC_TASK_SIGNALLED is detected
Date: Fri, 17 Jan 2025 10:29:31 +0800 [thread overview]
Message-ID: <58bf9d83-b58d-e5a6-4096-64eb96f3854a@huawei.com> (raw)
In-Reply-To: <642413c4bdbe296db722f0091ffa5190c992eb8e.camel@hammerspace.com>
在 2025/1/17 4:52, Trond Myklebust 写道:
> On Thu, 2025-01-16 at 19:43 +0800, yangerkun wrote:
>> Hi,
>>
>> Thanks for the patch.
>>
>> Before 39494194f93b("SUNRPC: Fix races with rpc_killall_tasks()",
>> every
>> time we set RPC_TASK_SIGNALLED, when we go through __rpc_execute,
>> this
>> rpc_task will immediate break and exist.
>>
>> However after that, __rpc_execute won't judge RPC_TASK_SIGNNALED, so
>> for
>> the case like you point out below, even after your commit
>> rpc_check_timeout will help break and exist eventually, but this
>> rpc_task has already do some work. I prefer reintroduce judging
>> RPC_TASK_SIGNNALED in __rpc_execute to help exist immediatly.
>>
>
> Better yet... Let's get rid of the RPC_TASK_SIGNALLED flag altogether
> and just replace
>
> #define RPC_TASK_SIGNALLED(task) (READ_ONCE(task->tk_rpc_status) == -ERESTARTSYS)
Hi,
Thanks for your reply! Yeah, if all the places where tk_rpc_status is
updated are by calling rpc_task_set_rpc_status, we can use
task->tk_rpc_status == -ERESTARTSYS to determine whether rpc_task is
RPC_TASK_SIGNALLED. But for the case like Li has provided,
__rpc_restart_call won't do this, and will overwrite tk_rpc_status
unconditionally. This won't be a stable solution. Maybe it's better to
change __rpc_restart_call calling rpc_task_set_rpc_status too? And
__rpc_execute will be enough to help solve this case.
>
> There is no good reason to try to maintain two completely separate
> sources of truth to describe the same task state.
>
next prev parent reply other threads:[~2025-01-17 2:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-14 14:41 [PATCH] SUNRPC: Set tk_rpc_status when RPC_TASK_SIGNALLED is detected Li Lingfeng
2025-01-16 11:43 ` yangerkun
2025-01-16 14:32 ` Li Lingfeng
2025-01-16 20:52 ` Trond Myklebust
2025-01-17 2:29 ` yangerkun [this message]
2025-01-17 3:15 ` Trond Myklebust
2025-01-17 12:16 ` yangerkun
2025-01-26 2:20 ` Li Lingfeng
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=58bf9d83-b58d-e5a6-4096-64eb96f3854a@huawei.com \
--to=yangerkun@huawei.com \
--cc=Dai.Ngo@oracle.com \
--cc=anna@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=houtao1@huawei.com \
--cc=jlayton@kernel.org \
--cc=kuba@kernel.org \
--cc=lilingfeng3@huawei.com \
--cc=lilingfeng@huaweicloud.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--cc=netdev@vger.kernel.org \
--cc=okorniev@redhat.com \
--cc=pabeni@redhat.com \
--cc=tom@talpey.com \
--cc=trondmy@hammerspace.com \
--cc=yi.zhang@huawei.com \
--cc=yukuai1@huaweicloud.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