Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp552136pxb; Thu, 21 Oct 2021 05:04:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9uogQFl3SumnhNBzaN9qtH6S/qVjsSSK/swV24TG1UetP8cbMmBrTdkeWk2zx4V2/AJaq X-Received: by 2002:a63:924c:: with SMTP id s12mr4185793pgn.416.1634817889733; Thu, 21 Oct 2021 05:04:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634817889; cv=none; d=google.com; s=arc-20160816; b=pF5AXdWpFg5X3R6yKxWE4eHN0/oJamnvUG6rALjIXDYIQzWakJfTdPDm4cRCm9BMbT RbghMXomlE4Fslb0ZAp0EpCk76YTb2+xWyFMzmcv0lo4EglIIm+NDCRJFJAIQ5TD5jmR Vg2sKS2KnbEPTuIqDE55zPwY2cFK36xUU2g4gngEJ+tp/Qha3631ShQtHkkprHXvK3eI 4+7Rg4+317rtUuSo8M+xANBT8/dlDiqfSwF6orhrWkYphE+/JDfYdLQpNXUES7HTSJAV jGX62VQaVVMsu03UJwLjcs69c+yMhAzoftoTNXxECiN85wxApcQxs8s3nazdtdvDk3W1 l+Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=Xdj0rmjrWZ534L4Rsl9Gu4pXluE47r7aw/KqzLnkNVw=; b=k5W6oyEl5qwzY46xchQ5pDjhlMsv6iWsThZWtDTQvY/Lu+eM4s0XxFQEIXExF6sn8i WPg+hG52WkmiEqgpP4gaF7ZXKXP0jI5PP6Vgje8inXVnI9q2aXc2vnmmzrM8sK2XbkEP mp1QkE20zqcsizGQND5syyW/jsfQAw3y6O5bDB/bycCo7RV10l7yHZqGj7wG0XnLS7Ge VekBpV4O15VaxjeedOcgZhNO4Nx9uT2SuGr6Cbhehju24AREWm8uOaPI+MTIkP/8U+Wn 1Ao+B3VIXOJ2UHKLyiTMh8q8nWVwKEAWq+BG+79NitIvtmoOP4m556Usj4wMmnxQk6po YjlA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h62si311935pge.509.2021.10.21.05.04.24; Thu, 21 Oct 2021 05:04:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231558AbhJUMEz (ORCPT + 99 others); Thu, 21 Oct 2021 08:04:55 -0400 Received: from mx22.baidu.com ([220.181.50.185]:43276 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231530AbhJUMEs (ORCPT ); Thu, 21 Oct 2021 08:04:48 -0400 Received: from BC-Mail-Ex03.internal.baidu.com (unknown [172.31.51.43]) by Forcepoint Email with ESMTPS id 48E6EE429F9C68435249; Thu, 21 Oct 2021 20:02:31 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex03.internal.baidu.com (172.31.51.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.12; Thu, 21 Oct 2021 20:02:31 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 21 Oct 2021 20:02:29 +0800 From: Cai Huoqing To: CC: Bernard Metzler , Doug Ledford , Jason Gunthorpe , Davidlohr Bueso , "Paul E. McKenney" , Josh Triplett , "Steven Rostedt" , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , Ingo Molnar , Daniel Bristot de Oliveira , , , Subject: [PATCH 6/6] trace/hwlat: Make use of the helper macro kthread_run_on_cpu() Date: Thu, 21 Oct 2021 20:01:35 +0800 Message-ID: <20211021120135.3003-7-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211021120135.3003-1-caihuoqing@baidu.com> References: <20211021120135.3003-1-caihuoqing@baidu.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-EX04.internal.baidu.com (172.31.51.44) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Repalce kthread_create/kthread_bind/wake_up_process() with kthread_run_on_cpu() to simplify the code. Signed-off-by: Cai Huoqing --- 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