Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2826468pxb; Mon, 19 Apr 2021 15:16:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzerh2gjZ6Ri3uwco0xgImDgguuH6Rx16MSzbTSXlkp/gpLt33Xwx34dKI2Mk422N3S1IEe X-Received: by 2002:a17:90a:f18f:: with SMTP id bv15mr1327785pjb.63.1618870561167; Mon, 19 Apr 2021 15:16:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618870561; cv=none; d=google.com; s=arc-20160816; b=pQli8U1vsxG5aBQXTqqREevzuJn25diA4zaRHony+InHoAIWYplgMumiAvrBk01Hgo 4qZveYB1RzaRXQUYtTBX7aWV+8ltVLKYZo58/zWWTjtQIJRfdla/PzvGunImkUT358bS 9ZNE4GtNUgA3scJoDz5PnS3+LeVwxPQNbBUfF0qUHC03mWY3jfYTcXBARJwTM4nIdLN+ zp4XznOnNaLTIQ3fI836eWl5IAr/tyIHjDeYdjqi17tAH58QtMxFQNFsq46pFPSlNqrE 9ZrVdkOQiwcox33X5H2haiKwelO+tW7QUbESghb938Z051fw8ox4JUofsjjo4yvHeREf Cu9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=N9TETHBPbbSqb/VoLAM4Ni8pA63gJ95JiyjztuQdV+o=; b=X+ZkX0IyCDUZIXCHaQBNL9vtzd09Ppj/6FQ4vcpQnkrT3fsH9kWZepQVqCaTTitsN4 EqgG6HE0XOIlNHC6c+tnJfmB+CTGkoqtP9Rhs3AN1LobolVq2XADLr4uDvBS1C45ds2R MuAE3x8X9OdJEO6yTueGr5er2Rqr1yvnkZ7pjxQlkUS4OvF/7t7t6esHS9CQMejdrEU3 7GDEyHq1SO4FGmf19y/D9+V5hm1HIZG6PXbHdyJi8B0fzCW86OuWnA8EO/AiLfQk2ZuD rdsJdz8l3/bmflPNfm0wts7FzWSsDUfjI20Kxmto6GCSrYZnTRQR9dJjVRU6p99nBh69 Dm0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=bJiDKamk; 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 w5si673530pjh.156.2021.04.19.15.15.49; Mon, 19 Apr 2021 15:16:01 -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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=bJiDKamk; 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 S237802AbhDSSxc (ORCPT + 99 others); Mon, 19 Apr 2021 14:53:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233654AbhDSSxc (ORCPT ); Mon, 19 Apr 2021 14:53:32 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 215E8C06174A for ; Mon, 19 Apr 2021 11:53:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:To:Subject:Sender: Reply-To:Cc:Content-ID:Content-Description; bh=N9TETHBPbbSqb/VoLAM4Ni8pA63gJ95JiyjztuQdV+o=; b=bJiDKamkTgPf86ocXig+w7FedJ ha3RGCnDi68uGQgcsCteQ4pBbO164qtIjgh7MIEGK4sWGOJZ6YjWH65f8e/7ZJs9FdAb21Cy/3l7S kc8+jO7BFfHTRAozw9gPdWpzt0nVo1H8xzW7P2tdIoz1kehlp9kqC6781Fg2mNcZloJKfxEi+Ua0x kEShzVRbz13W4OouSDDd819pLx5/ApFN2rPwLobpeW/GA2eX5JMFrb5jfELATWmyD/IOvX5TIW9FX ibIBj0HjvdjUqyY06oeJ1op3acilUHyTWhFGfueNg+CcvNf+8qGnLSKsVQl72EYg6pdnn0C5iR04h JNtnc3iQ==; Received: from [2601:1c0:6280:3f0::df68] by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lYZ0d-00E9nw-Vf; Mon, 19 Apr 2021 18:52:41 +0000 Subject: Re: [PATCH] smp: add a best_effort version of smp_call_function_many() To: Luigi Rizzo , linux-kernel@vger.kernel.org, peterz@infradead.org, axboe@kernel.dk, paulmck@kernel.org References: <20210419184455.2987243-1-lrizzo@google.com> From: Randy Dunlap Message-ID: Date: Mon, 19 Apr 2021 11:52:33 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <20210419184455.2987243-1-lrizzo@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi-- On 4/19/21 11:44 AM, Luigi Rizzo wrote: > > Signed-off-by: Luigi Rizzo > --- > include/linux/smp.h | 10 ++++++ > kernel/smp.c | 75 +++++++++++++++++++++++++++++++++++++-------- > 2 files changed, 72 insertions(+), 13 deletions(-) > > diff --git a/kernel/smp.c b/kernel/smp.c > index aeb0adfa0606..75155875fadc 100644 > --- a/kernel/smp.c > +++ b/kernel/smp.c > @@ -693,8 +715,32 @@ static void smp_call_function_many_cond(const struct cpumask *mask, > csd_lock_wait(csd); > } > } > + return busy ? cfd->cpumask : NULL; > } > > +/** > + * Extended version of smp_call_function_many(). Same constraints. > + * @mode == 0 same as wait = false, returns 0; > + * @mode == 1 same as wait = true, returns 0; > + * @mode = SMP_CFM_BEST_EFFORT: skips CPUs with previous pending requests, > + * returns 0 and *mask unmodified if no CPUs are skipped, > + * -EBUSY if CPUs are skipped, and *mask is the set of skipped CPUs Please convert those comments to real kernel-doc format. (Documentation/doc-guide/kernel-doc.rst) > + */ > +int __smp_call_function_many(struct cpumask *mask, smp_call_func_t func, > + void *info, int mode) > +{ thanks. -- ~Randy