All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cai Huoqing <caihuoqing@baidu.com>
To: <caihuoqing@baidu.com>
Cc: Bernard Metzler <bmt@zurich.ibm.com>,
	Doug Ledford <dledford@redhat.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Davidlohr Bueso <dave@stgolabs.net>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	Josh Triplett <josh@joshtriplett.org>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Joel Fernandes <joel@joelfernandes.org>,
	Ingo Molnar <mingo@redhat.com>,
	Daniel Bristot de Oliveira <bristot@kernel.org>,
	<linux-rdma@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<rcu@vger.kernel.org>
Subject: [PATCH v2 6/6] trace/hwlat: Make use of the helper macro kthread_run_on_cpu()
Date: Thu, 21 Oct 2021 20:27:57 +0800	[thread overview]
Message-ID: <20211021122758.3092-7-caihuoqing@baidu.com> (raw)
In-Reply-To: <20211021122758.3092-1-caihuoqing@baidu.com>

Repalce kthread_create_on_cpu/wake_up_process()
with kthread_run_on_cpu() to simplify the code.

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
v1->v2: Update changelog.

 kernel/trace/trace_hwlat.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/kernel/trace/trace_hwlat.c b/kernel/trace/trace_hwlat.c
index 1b83d75eb103..0e555335f095 100644
--- a/kernel/trace/trace_hwlat.c
+++ b/kernel/trace/trace_hwlat.c
@@ -491,18 +491,14 @@ static void stop_per_cpu_kthreads(void)
 static int start_cpu_kthread(unsigned int cpu)
 {
 	struct task_struct *kthread;
-	char comm[24];
 
-	snprintf(comm, 24, "hwlatd/%d", cpu);
-
-	kthread = kthread_create_on_cpu(kthread_fn, NULL, cpu, comm);
+	kthread = kthread_run_on_cpu(kthread_fn, NULL, cpu, "hwlatd/%u");
 	if (IS_ERR(kthread)) {
 		pr_err(BANNER "could not start sampling thread\n");
 		return -ENOMEM;
 	}
 
 	per_cpu(hwlat_per_cpu_data, cpu).kthread = kthread;
-	wake_up_process(kthread);
 
 	return 0;
 }
-- 
2.25.1


  parent reply	other threads:[~2021-10-21 12:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-21 12:27 [PATCH v2 0/6] kthread: Add the helper macro kthread_run_on_cpu() Cai Huoqing
2021-10-21 12:27 ` [PATCH v2 1/6] " Cai Huoqing
2021-10-21 12:27 ` [PATCH v2 2/6] RDMA/siw: Make use of " Cai Huoqing
2021-10-21 22:56   ` kernel test robot
2021-10-21 22:56     ` kernel test robot
2021-10-21 12:27 ` [PATCH v2 3/6] ring-buffer: " Cai Huoqing
2021-10-21 12:27 ` [PATCH v2 4/6] rcutorture: " Cai Huoqing
2021-10-21 12:27 ` [PATCH v2 5/6] trace/osnoise: " Cai Huoqing
2021-10-21 12:27 ` Cai Huoqing [this message]
2021-10-21 16:31   ` [PATCH v2 6/6] trace/hwlat: " Bart Van Assche
2021-10-21 16:31 ` [PATCH v2 0/6] kthread: Add " Bart Van Assche

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=20211021122758.3092-7-caihuoqing@baidu.com \
    --to=caihuoqing@baidu.com \
    --cc=bmt@zurich.ibm.com \
    --cc=bristot@kernel.org \
    --cc=dave@stgolabs.net \
    --cc=dledford@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@redhat.com \
    --cc=paulmck@kernel.org \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.