Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp576103pxb; Thu, 21 Oct 2021 05:32:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5fWmtagLi2eUl2FZSKFoCtwGyBwkJ51CHOQTxO8Ny0Pk/rPc4fda8l8q4DeUDotc8E72n X-Received: by 2002:a50:e188:: with SMTP id k8mr7643772edl.119.1634819570879; Thu, 21 Oct 2021 05:32:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634819570; cv=none; d=google.com; s=arc-20160816; b=ZhUfTDuYc9s2DqxWWBdStDXLi+M35OtKldA75KCgBMAyJKpOMtDo3CznnR3pJD62LZ 2bqwh0kFWDStlefaWlJkT9XUudIsJH6XkNbupvy9t7BXcPlpr5MoX/y49XZxmtgVinWQ nB6DIchdfg2YdRAWEIC/DJGaWsUprCA/l/Wbbc1LVy5PZY4Lpjh/EohVWOuPoFQqWPOb JeFnGIpnTDXYA++VmpAwLC6x3SI9CW+YmEv5wX/5wNzV1pqhJmvpSqhYA+VQGuxb1N0f nuYajHcOw9lYpDnfS7P+14rm6UwjQc58X0OXf8T611+m9b3HyBeZUM4ihpqRBOeN8syo AbmA== 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=ii8hNZbrKTBz1gVJagPYFJL34XZGunTgX0Xy6T3qhfs=; b=v7rRlfn7jUwafPjfLKKQc90uTkdR4zQng1eiuoxyQL7YoYBm9NkqGx4Hm4zmH98gVm guILl8OtrdxK0QAR+X1LTS/sPlQXQbB3cOvd2La/L/PCnYH1U6u+UxEcU02nF4FLFfok 6gKz1qHsmilelprNLtZDkTmCBc+Pz4yNuEPB0W/baz+Owrt8rW8erga07kx8iomfCyDc Bg1NmsFw956GEHYPdgA4XWFXNyVeAf0O+AkaQLJm/hUbtSgkN6i7fdz0G9nG36kKPrWS EwOzKGuxWnF+HpE5BGrjF6K8dxqTtFF5LrCFAhD3pnyijse4X+CfgDSDDUNA6+q2D0hk 2h8g== 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 z42si6762474ede.468.2021.10.21.05.32.24; Thu, 21 Oct 2021 05:32:50 -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 S231755AbhJUMaw (ORCPT + 99 others); Thu, 21 Oct 2021 08:30:52 -0400 Received: from mx22.baidu.com ([220.181.50.185]:42398 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230190AbhJUMar (ORCPT ); Thu, 21 Oct 2021 08:30:47 -0400 Received: from BC-Mail-Ex23.internal.baidu.com (unknown [172.31.51.17]) by Forcepoint Email with ESMTPS id 7E137C6C204F9F897255; Thu, 21 Oct 2021 20:28:29 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex23.internal.baidu.com (172.31.51.17) 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:28:29 +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:28:28 +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 v2 6/6] trace/hwlat: Make use of the helper macro kthread_run_on_cpu() Date: Thu, 21 Oct 2021 20:27:57 +0800 Message-ID: <20211021122758.3092-7-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211021122758.3092-1-caihuoqing@baidu.com> References: <20211021122758.3092-1-caihuoqing@baidu.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-Ex10.internal.baidu.com (172.31.51.50) 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_on_cpu/wake_up_process() with kthread_run_on_cpu() to simplify the code. Signed-off-by: Cai Huoqing --- 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