Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1269559pxb; Thu, 21 Oct 2021 20:01:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzV7snbszHc9P4pp5MG6CHENkyM3ZeMRuZ83m10YoASvDiuLt99MHOzsaq/usRzZGuQQIDz X-Received: by 2002:a65:6398:: with SMTP id h24mr7299422pgv.367.1634871670780; Thu, 21 Oct 2021 20:01:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634871670; cv=none; d=google.com; s=arc-20160816; b=MU3AyeALLofMnLlKLUC2XOPVM+5I8mi3dlhHKfGIDCNxxA74SZ+aQNxPCeHABeN+J9 jGFNDslE8a1ZZmJe0KXUu+lTyiKNSC2D9K0pLmnwYS2g7Jso1TwJwjaQFBgegLi6DfJj iAXT3dwp6NV3Kshbfk7wYcWErivlHyIlycGbjMkEKc4KAqqwinnoNQYi0OCDchVuM7KD 7Tj0DCtM9xatGihWy3DPQRFboQGtTgBjFxSmivbSGIJOZ5jzR9MDrJ5v8Zz/DaxtXPYi rT95zzcyd5UAEwFm+W+JitIR76q5W782KfD1GQulVAdmk7tT41IbUaeXodw73sV92Xq2 pjnA== 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=l/LTxTH9kv2CSLqemK3XFhsj9swLlalqWai3xTO6ucE=; b=YU4cQG/bYqcYsK9UVO/Ldzkc6S+U9/WInfMD2Ps8NGXWxyIumkA/HQu2BSo4jOorXx htqjOmRjd2niUT8Uf9f+1bRkp3e+s4M2jS14gCediMwZTV/6BTvkH2l9iYqyFxTyRFdm vIoQbbiGWW7mZh5+AVS3iFsxJsm89r6rJ4RktjP5GW5HIkrzMWQDTngw2OPC8UPQ5j4i Nj7DhOYKR1O5pucA6l2I0wuLaSlO2TS4yTaToW+s7+f6yP2NNNC+Gc5NMaCTnSDvNzJQ jMjuM56k9XlXd/DzVdhV7f0UTO9Ry882jeHwCLCcJV2+N5NvffwmEo7ixULJFDWTtAFE 0cPA== 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 h4si11111772pfv.329.2021.10.21.20.00.55; Thu, 21 Oct 2021 20:01:10 -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 S232733AbhJVDBt (ORCPT + 99 others); Thu, 21 Oct 2021 23:01:49 -0400 Received: from mx22.baidu.com ([220.181.50.185]:50940 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232726AbhJVDBl (ORCPT ); Thu, 21 Oct 2021 23:01:41 -0400 Received: from BC-Mail-EX04.internal.baidu.com (unknown [172.31.51.44]) by Forcepoint Email with ESMTPS id AD93910DD569BC6C80B1; Fri, 22 Oct 2021 10:59:23 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-EX04.internal.baidu.com (172.31.51.44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.12; Fri, 22 Oct 2021 10:59:23 +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; Fri, 22 Oct 2021 10:59:22 +0800 From: Cai Huoqing To: CC: Cai Huoqing , Bernard Metzler , Doug Ledford , Jason Gunthorpe , "Davidlohr Bueso" , "Paul E. McKenney" , "Josh Triplett" , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , Ingo Molnar , Daniel Bristot de Oliveira , , , Subject: [PATCH v3 6/6] trace/hwlat: Make use of the helper function kthread_run_on_cpu() Date: Fri, 22 Oct 2021 10:57:09 +0800 Message-ID: <20211022025711.3673-7-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211022025711.3673-1-caihuoqing@baidu.com> References: <20211022025711.3673-1-caihuoqing@baidu.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-Ex28.internal.baidu.com (172.31.51.22) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace kthread_create_on_cpu/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