Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp576175pxb; Thu, 21 Oct 2021 05:32:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHDlL7u7RaAHy+Uylq9Ru8S+Lr15N0jBpAvbkL8U1pCq1Ylk7FSF+BCg8CFDouPjOzqPow X-Received: by 2002:a17:906:269a:: with SMTP id t26mr6987747ejc.20.1634819576962; Thu, 21 Oct 2021 05:32:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634819576; cv=none; d=google.com; s=arc-20160816; b=jeqoXSsVFeo1ggrZ+QT0LPM3zb6aZ1qXUVbZoLrg4AwTrOFeivz6ez4XRh9OzffEpz qpIixjrS7qRUvRQyYtiwuv9f88fYEmFl72YrlBaBYfZTdE5O0tJzstDt5pxGn1Lss/bj eTC7Wk2hUHXYlZEiK4BixG0arxkOmaSYD44IIv+ZFstRYab+YcxD0GYT0txIY1W8xh19 OrFkg5j1R7ucnd6SL72El14tSXOO5MiEzoTs4Kb2GKWNgSDcnc7I+WLLAIG/vioKJu+n NcJp/sVTLmQUJtpXgYmF6zu6Wz8EJu0GYaxvGXN8NFusRmf4S7Oqj6brT9Xd32so2LiT FLdg== 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=fKmhjgUUwmeVxSCRdWBXp0OxxuR9gD3c7wSqrBrHbqndXyUkr4voeCtu2LOYTKfjZk 3tyMQdf8bp6KjpqFURdugkzWDeoONYoV0QPFXBjKKnnUiAlfpvXfPxn5yY28KLd5tbKu soBRyTXg03uuQslnu2tiE0rZ0f0BCSw7VNvvqKCkhA+jFM9tIfaEAp7cjB9hVz6GS48r qt3oBYRR90XQSYogPvq0ddzuTzM+3ccJB6EkzoGEa23vmQNW2qFdj80TymAkpdAsGpsW siKUB7tGv4PYUh/7C59FM1MMLOIumS4e5BLw/xWm0dBB/YRyDj8/w9Ee8eHUilXJChjM d9pg== 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 r14si1614334edi.313.2021.10.21.05.32.30; Thu, 21 Oct 2021 05:32:56 -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 S231629AbhJUMam (ORCPT + 99 others); Thu, 21 Oct 2021 08:30:42 -0400 Received: from mx22.baidu.com ([220.181.50.185]:42056 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231641AbhJUMai (ORCPT ); Thu, 21 Oct 2021 08:30:38 -0400 Received: from BC-Mail-Ex26.internal.baidu.com (unknown [172.31.51.20]) by Forcepoint Email with ESMTPS id 36D4860908AFF032E941; Thu, 21 Oct 2021 20:28:21 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex26.internal.baidu.com (172.31.51.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Thu, 21 Oct 2021 20:28:21 +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:20 +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 3/6] ring-buffer: Make use of the helper macro kthread_run_on_cpu() Date: Thu, 21 Oct 2021 20:27:54 +0800 Message-ID: <20211021122758.3092-4-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/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