From: Trond Myklebust <trondmy@hammerspace.com>
To: "caihuoqing@baidu.com" <caihuoqing@baidu.com>
Cc: "bfields@fieldses.org" <bfields@fieldses.org>,
"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
"anna.schumaker@netapp.com" <anna.schumaker@netapp.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"chuck.lever@oracle.com" <chuck.lever@oracle.com>
Subject: Re: [PATCH] SUNRPC: Make use of the helper macro kthread_run()
Date: Thu, 21 Oct 2021 13:16:48 +0000 [thread overview]
Message-ID: <36250e331421cddb10fbb1ca38df72aad812e3a3.camel@hammerspace.com> (raw)
In-Reply-To: <20211021084336.2448-1-caihuoqing@baidu.com>
On Thu, 2021-10-21 at 16:43 +0800, Cai Huoqing wrote:
> [You don't often get email from caihuoqing@baidu.com. Learn why this
> is important at http://aka.ms/LearnAboutSenderIdentification.]
>
> Repalce kthread_create/wake_up_process() with kthread_run()
> to simplify the code.
>
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
> ---
> fs/lockd/svc.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
> index b220e1b91726..934dc13a7011 100644
> --- a/fs/lockd/svc.c
> +++ b/fs/lockd/svc.c
> @@ -397,7 +397,7 @@ static int lockd_start_svc(struct svc_serv *serv)
> svc_sock_update_bufs(serv);
> serv->sv_maxconn = nlm_max_connections;
>
> - nlmsvc_task = kthread_create(lockd, nlmsvc_rqst, "%s", serv-
> >sv_name);
> + nlmsvc_task = kthread_run(lockd, nlmsvc_rqst, "%s", serv-
> >sv_name);
> if (IS_ERR(nlmsvc_task)) {
> error = PTR_ERR(nlmsvc_task);
> printk(KERN_WARNING
> @@ -405,7 +405,6 @@ static int lockd_start_svc(struct svc_serv *serv)
> goto out_task;
> }
> nlmsvc_rqst->rq_task = nlmsvc_task;
> - wake_up_process(nlmsvc_task);
No. That would mean nlmsvc_rqst->rq_task would be uninitialised when
the thread starts. Please try to understand the code before proposing
changes.
>
> dprintk("lockd_up: service started\n");
> return 0;
> --
> 2.25.1
>
--
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com
prev parent reply other threads:[~2021-10-21 13:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-21 8:43 Cai Huoqing
2021-10-21 13:16 ` Trond Myklebust [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=36250e331421cddb10fbb1ca38df72aad812e3a3.camel@hammerspace.com \
--to=trondmy@hammerspace.com \
--cc=anna.schumaker@netapp.com \
--cc=bfields@fieldses.org \
--cc=caihuoqing@baidu.com \
--cc=chuck.lever@oracle.com \
--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®