Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp652934pxb; Thu, 21 Oct 2021 07:01:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/nY/31+BcAA2THeL9rKMGFhmz6Vc8T3ycwiyQmJJw8hFNpRbPNkKSgapYeO/8jDAxp4Bz X-Received: by 2002:aa7:d387:: with SMTP id x7mr7894643edq.299.1634824874971; Thu, 21 Oct 2021 07:01:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634824874; cv=none; d=google.com; s=arc-20160816; b=i0nGiB/Q3NvjCq5h7cFUStLuJ03R9i9eE12Hs/92CUkf24B9qXKD+iT5FhzfwAfRGH 5EHmBcBbcYEvOo04pXcZTmPaUIxqugT9UBfXHQd1SdJ1WHGFcUERBwY6P/+j/kZw7QU7 EHNHf5RidswIwQ4ZSYFheVN8/JQqvGeM1n97oaH/r1IZc1hR8WUfcoy5DF001oRScZC5 l12eMjekNUri2vH9wCRVLbHml68QVrgc1T2UgTch1GehPSXtQq7DNb8VaAamSn46iyi0 /KpfWgP/BULolUshs3XeJQOieT+M4TJEHQ9EJo3bhI/C1s1a37LTnvnJD9ORIaxMIbZB 84zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=XPtSTYpB/exfo6GDi2iA90FKlqrj8S8cUppkzZb2924=; b=iNZivB5rMDdlirbA5ydDmsYsI6M+1yP8IQiKCLCyWjm7RlruKvocAdu9B70uSpbsRf jYgyvxVpwdMoDWCzXDdhJr9zzwuu8fbKrv5hLguvLhLlCkbz69qfGw2ViGtiz45BfIQL YouuD/Guzo3e/3sHCGPFr9yOLOi/MFk9c5ff8DWXqDXR1Oq/OMTdJlQIyLIfpMiq6mmM 47DesOeUxv7uzdVhcbzZxYCT6dNo/8HPTOVOzkctR9i/13C0RJR3Aol6BjnNCT0prvfQ iW9ajBxu4Bb0qzrM2IgVHgx1yNfHgs+ZY77wVCEJ+k+nau1cy6gw8sFEy0z2GTfvkx2X g/xg== 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 dp6si9569542ejc.629.2021.10.21.07.00.49; Thu, 21 Oct 2021 07:01:14 -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 S230390AbhJUOBR (ORCPT + 99 others); Thu, 21 Oct 2021 10:01:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:40572 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230072AbhJUOBR (ORCPT ); Thu, 21 Oct 2021 10:01:17 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BF4AB60F46; Thu, 21 Oct 2021 13:58:59 +0000 (UTC) Date: Thu, 21 Oct 2021 09:58:58 -0400 From: Steven Rostedt To: Cai Huoqing 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: <20211021095858.51d600fc@gandalf.local.home> In-Reply-To: <20211021135312.GA3400@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> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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