Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1273357pxb; Thu, 21 Oct 2021 20:07:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAhpr5W4YJxAMvvUZo+A/UlIUapSG5GKprBp0VM+zISQnAZEaccsEwV2dStGbubL58qZZs X-Received: by 2002:a17:90b:3b8e:: with SMTP id pc14mr11432051pjb.180.1634872035274; Thu, 21 Oct 2021 20:07:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634872035; cv=none; d=google.com; s=arc-20160816; b=DJ1JZFP5jptyg8l3pJp+dU2kn3FW3TJ33ikKIhEtyISMuMA6aVGSLe8GEFnRrNjW6i +9Xn6wu6fW5cJbwoLuQtHbDCKce9WLa0iN+50i8pvvPQIpPNeIIoC6VQXO0MZfuJ/6zZ bd+cGVqVLa16pW2lGv5wqBj5hwphWhtQOq3Aa6nZo3+GoaoFQzc0xOdYDi/MVmXrscKh l3MCWat6UIn3DYHT5Qa2Zwfr6aO6tATFZs2Ehtp/DEN1JDdbOwrcE59ZA84tm3PjyOlm fFrirtl2I+nzZW+z2A4SbPk7ceut9qRU0Nnl8b1W+0HXzrwoSfHUNGX4mujle/LCCW+H WA2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=JQlxxhJQxHtVvZqZhDxG0uvt0Z30AsdvRhjHfDEgvW4=; b=gnqsKPmP2iA0kG/abgGwe//h4KeZ6t29TJi5W1J5O2mRyMu3CQgc7BWNae/mt0Lk2h PFptO6zowfaRP2hCguN0pveOYYR5/bS6RzrS9BuDkJUWwCTV7sawKa8kYtHJjMfBP5Gw zbsBJbDYncMWilV738ui5xMFUJGfH6KE1sy5a+H338c59sRZ5ANpRJP7VnoFusgQxHES 9zcG7kCpu9KXYJx+UAIpgKvXE8B1oovnLnXOIXlLttQYpviI/3jCfMm6cYqdAvGTjA8M az/t0/eOK2dS9vbVU/ndWiNvs56TIRBOKNPNf7oaelsCBhi35AuMpK7mdr2Kuj25ROb8 P5Lw== 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 e25si10991864pgv.258.2021.10.21.20.06.55; Thu, 21 Oct 2021 20:07:15 -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 S232547AbhJVDIA (ORCPT + 99 others); Thu, 21 Oct 2021 23:08:00 -0400 Received: from mx22.baidu.com ([220.181.50.185]:57914 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232508AbhJVDH7 (ORCPT ); Thu, 21 Oct 2021 23:07:59 -0400 Received: from BC-Mail-Ex18.internal.baidu.com (unknown [172.31.51.12]) by Forcepoint Email with ESMTPS id 13DE3CBE79C2B0832747; Fri, 22 Oct 2021 11:05:21 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex18.internal.baidu.com (172.31.51.12) 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 11:05:20 +0800 Received: from localhost (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 11:05:20 +0800 Date: Fri, 22 Oct 2021 11:05:24 +0800 From: Cai Huoqing To: Steven Rostedt CC: 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: Re: [PATCH 1/6] kthread: Add the helper macro kthread_run_on_cpu() Message-ID: <20211022030524.GA3762@LAPTOP-UKSR4ENP.internal.baidu.com> References: <20211021120135.3003-1-caihuoqing@baidu.com> <20211021120135.3003-2-caihuoqing@baidu.com> <20211021091001.26c24d5b@gandalf.local.home> <20211021135312.GA3400@LAPTOP-UKSR4ENP.internal.baidu.com> <20211021095858.51d600fc@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211021095858.51d600fc@gandalf.local.home> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-Ex18.internal.baidu.com (172.31.51.12) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21 10月 21 09:58:58, Steven Rostedt wrote: > On Thu, 21 Oct 2021 21:53:12 +0800 > Cai Huoqing wrote: > > > > > +/** > > > > + * kthread_run_on_cpu - create and wake a cpu bound thread. > > > > + * @threadfn: the function to run until signal_pending(current). > > > > + * @data: data ptr for @threadfn. > > > > + * @cpu: The cpu on which the thread should be bound, > > > > + * @namefmt: printf-style name for the thread. Format is restricted > > > > + * to "name.*%u". Code fills in cpu number. > > > > + * > > > > + * Description: Convenient wrapper for kthread_create_on_node() > > > > + * followed by wake_up_process(). Returns the kthread or > > > > + * ERR_PTR(-ENOMEM). > > > > + */ > > > > +#define kthread_run_on_cpu(threadfn, data, cpu, namefmt) \ > > > > > > Why is this a macro and not a static inline function? > > > > > > -- Steve > > Hi,Thanks for your feedback, > > > > I think using static inline function is nice, but here try to keep > > consistent with the other macros, > > sush as kthread_create/kthread_init_work... > > Which they did because they didn't want to use va_list to have variable > arguments, which you don't have. > > Which begs the question, should you? > > -- Steve Hi, Thanks your reply. I get it, V3 here: https://lore.kernel.org/lkml/20211022025711.3673-2-caihuoqing@baidu.com/ Thanks, Cai