Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1269293pxb; Thu, 21 Oct 2021 20:00:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzb50v1wSVfYGAWPPK9cC6ZEvPuXvL8+eBMxToomShEGotwtcMMm1knmU/wdFsN9GaWiz+d X-Received: by 2002:a17:90b:4f4b:: with SMTP id pj11mr11457305pjb.4.1634871649980; Thu, 21 Oct 2021 20:00:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634871649; cv=none; d=google.com; s=arc-20160816; b=r0Jw9T7Vjq3M7g14A8diOywVR/ARJTK5z0e3/W+wa1bamWUQ8QntbWYD29L0rfW3Cd kmJqz5s/HANFZMUDAbTzFovg/6LFZ7GpimPCV/u+KvN3BuyE6HftGExTH9exG8zflGDS GDvMneMUqfHfNpAw9z+9g0Qhp7NTbJ2h+1auTv7So2neVw3vyPrqmmtabefvtVe+Yw8E Pu7GOlrD8d1+kFU0pHSdAelBKVps7CBoLurlUG3nfbdNQXNqG8gFxwpNP5NvgmmPEf+A UaQkIlJF2dU3z2cVMOP9QmQve6KqH44YPyDfZ2QZwZlQkXjotg/d30wFeUHYXSFovrTW 7XCg== 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=+okT50Cpp6/1Pw6BCZKYHUs2IGw2igxLdYa2glGFkfE=; b=xS99YTWHBGMbascLPuyxFIvE3PjYY6RKlNaHaMyTieDVtBsqHl5I3QlD/gDZjhcA+X VfRImqxVXgOHbRP/uJnDnyNesVvUi3tPBpGxjPTKuwd5Cg1DeCURqaHfIGvD2pdt7+ju eOBLgQXEKgannJwNbrtJt65/IiAr9dIBS9ZOTraOzCYB+fR8mgNRNfBgWqGUSWOFBSyk c1/sjtq0PDOGPxZqFMUGS+y2WgGFlzNuKdRJZc9JuNx48MCJ0/ARa2WGydDijcLbWItd 58y/+LUzOi86FAJk84dDNwsiBEERqycUleGGD1JRoYLo10db5YIxhzw7MTU7Y0mu4G44 qBtA== 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 c11si11247900pgw.198.2021.10.21.20.00.35; Thu, 21 Oct 2021 20:00: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 S232734AbhJVDBo (ORCPT + 99 others); Thu, 21 Oct 2021 23:01:44 -0400 Received: from mx22.baidu.com ([220.181.50.185]:50614 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232660AbhJVDBc (ORCPT ); Thu, 21 Oct 2021 23:01:32 -0400 Received: from BC-Mail-Ex07.internal.baidu.com (unknown [172.31.51.47]) by Forcepoint Email with ESMTPS id 9CE801ACFEDD149798ED; Fri, 22 Oct 2021 10:59:14 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-EX07.internal.baidu.com (172.31.51.47) 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:14 +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:13 +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 3/6] ring-buffer: Make use of the helper function kthread_run_on_cpu() Date: Fri, 22 Oct 2021 10:57:06 +0800 Message-ID: <20211022025711.3673-4-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/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