Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp553025pxb; Thu, 21 Oct 2021 05:05:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4t7BxuOjQhdkPsZ2RegIraBp0SphytwkLS5Y5UhejB3s1toQfKtw+yuq/8Rmq+KeeYGT5 X-Received: by 2002:a17:90a:e010:: with SMTP id u16mr6227279pjy.217.1634817937449; Thu, 21 Oct 2021 05:05:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634817937; cv=none; d=google.com; s=arc-20160816; b=nmU1STwBYTfn53nZS+MostID38wLpkhJJQCyuA9KrbtY3tTqcuZzez8ol+vZfCja5V QF1lREwcLJsPnFMUXcKjwBOWj0820bBZVXolOYkYpblo7qi5HxQFE0M7rVje63MAvt1q wa2mA39HUDFNCtVObX1zbQv5YrxU2/q5QisyhgLYNtoOunV0eeQa2MJOuF8cD0kEncT9 /mZMkptaEXQaoho0xv1y4b8nAEBXEYkIFj6esP9zGd8mtglUZZWXAT7LbPtycCj7UZbn Oj2gXqG9tnymOsZydvQJFfZDU9wrD7hUejX8PpxWSnUZkJWBZNrH52NEUPxfRyp6jo6E R68w== 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=6/b8Z/zQjb+OlUiLQl7vKKzUFL3+9sxHXtRmV6o7c/0=; b=IOV2CFhgfGRaahVk2lkhwWO/7uxZvYHb68EcMYgD2iEQfJpyegRxcTfwMWeVahDHD6 kPUdKkPief9smv+z74rzluDo4rddslKmPTW+2ouB/bY5GmlXr0trKY2Qd2FsrBLLcmgD nqOLiQ9KDW8U2tTSeCRt6L2eUb++7d9tFo3MpccYsXMpjSWrERA96TCjNzAgeQHXeQdo l1xqP+1HdbiJxsKutO8iNWQy9G+JGmr8sMgdshaOXuUkRLTohqBAhqVB/HHLZ1KV8eXk QyWGnU6Hd4TgYGAzl6qDlGEdrwhs2ZKsylDUFLkHok8fEIABb5FAgcquMgIm1qLMzR0I MvBg== 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 15si11134551pjt.0.2021.10.21.05.05.24; Thu, 21 Oct 2021 05:05:37 -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 S231162AbhJUMEl (ORCPT + 99 others); Thu, 21 Oct 2021 08:04:41 -0400 Received: from mx22.baidu.com ([220.181.50.185]:42860 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231560AbhJUMEf (ORCPT ); Thu, 21 Oct 2021 08:04:35 -0400 Received: from BC-Mail-Ex06.internal.baidu.com (unknown [172.31.51.46]) by Forcepoint Email with ESMTPS id 0230A1FB162E2EA254AD; Thu, 21 Oct 2021 20:02:18 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex06.internal.baidu.com (172.31.51.46) 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:17 +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:16 +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 3/6] ring-buffer: Make use of the helper macro kthread_run_on_cpu() Date: Thu, 21 Oct 2021 20:01:32 +0800 Message-ID: <20211021120135.3003-4-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/ring_buffer.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index c5a3fbf19617..afb306e21e5b 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -5898,16 +5898,13 @@ static __init int test_ringbuffer(void) rb_data[cpu].buffer = buffer; rb_data[cpu].cpu = cpu; rb_data[cpu].cnt = cpu; - rb_threads[cpu] = kthread_create(rb_test, &rb_data[cpu], - "rbtester/%d", cpu); + rb_threads[cpu] = kthread_run_on_cpu(rb_test, &rb_data[cpu], + cpu, "rbtester/%u"); if (WARN_ON(IS_ERR(rb_threads[cpu]))) { pr_cont("FAILED\n"); ret = PTR_ERR(rb_threads[cpu]); goto out_free; } - - kthread_bind(rb_threads[cpu], cpu); - wake_up_process(rb_threads[cpu]); } /* Now create the rb hammer! */ -- 2.25.1