Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6BC3C433F5 for ; Sun, 28 Nov 2021 18:00:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359072AbhK1SD7 (ORCPT ); Sun, 28 Nov 2021 13:03:59 -0500 Received: from smtprelay0168.hostedemail.com ([216.40.44.168]:42148 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1358717AbhK1SBx (ORCPT ); Sun, 28 Nov 2021 13:01:53 -0500 Received: from omf09.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay01.hostedemail.com (Postfix) with ESMTP id 991EA101DBDB6; Sun, 28 Nov 2021 17:58:34 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf09.hostedemail.com (Postfix) with ESMTPA id A8CC6E0003E9; Sun, 28 Nov 2021 17:57:35 +0000 (UTC) Message-ID: <3e76ba158acaf414c982c95285ad5054fea7cd4f.camel@perches.com> Subject: Re: [PATCH 7/9] lib/cpumask: add num_{possible,present,active}_cpus_{eq,gt,le} From: Joe Perches To: Yury Norov Cc: linux-kernel@vger.kernel.org, "James E.J. Bottomley" , "Martin K. Petersen" , "Paul E. McKenney" , "Rafael J. Wysocki" , Alexander Shishkin , Alexey Klimov , Amitkumar Karwar , Andi Kleen , Andrew Lunn , Andrew Morton , Andy Gross , Andy Lutomirski , Andy Shevchenko , Anup Patel , Ard Biesheuvel , Arnaldo Carvalho de Melo , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Christoph Hellwig , Christoph Lameter , Daniel Vetter , Dave Hansen , David Airlie , David Laight , Dennis Zhou , Dinh Nguyen , Geetha sowjanya , Geert Uytterhoeven , Greg Kroah-Hartman , Guo Ren , Hans de Goede , Heiko Carstens , Ian Rogers , Ingo Molnar , Jakub Kicinski , Jason Wessel , Jens Axboe , Jiri Olsa , Jonathan Cameron , Juri Lelli , Kalle Valo , Kees Cook , Krzysztof Kozlowski , Lee Jones , Marc Zyngier , Marcin Wojtas , Mark Gross , Mark Rutland , Matti Vaittinen , Mauro Carvalho Chehab , Mel Gorman , Michael Ellerman , Mike Marciniszyn , Nicholas Piggin , Palmer Dabbelt , Peter Zijlstra , Petr Mladek , Randy Dunlap , Rasmus Villemoes , Roy Pledge , Russell King , Saeed Mahameed , Sagi Grimberg , Sergey Senozhatsky , Solomon Peachy , Stephen Boyd , Stephen Rothwell , Steven Rostedt , Subbaraya Sundeep , Sudeep Holla , Sunil Goutham , Tariq Toukan , Tejun Heo , Thomas Bogendoerfer , Thomas Gleixner , Ulf Hansson , Vincent Guittot , Vineet Gupta , Viresh Kumar , Vivien Didelot , Vlastimil Babka , Will Deacon , bcm-kernel-feedback-list@broadcom.com, kvm@vger.kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-csky@vger.kernel.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-snps-arc@lists.infradead.org, linuxppc-dev@lists.ozlabs.org Date: Sun, 28 Nov 2021 09:57:41 -0800 In-Reply-To: <20211128174320.GA304543@lapt> References: <20211128035704.270739-1-yury.norov@gmail.com> <20211128035704.270739-8-yury.norov@gmail.com> <8f389151c39a8a5b6b31d5238cb680305225d9f2.camel@perches.com> <20211128174320.GA304543@lapt> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.4-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Stat-Signature: dxps35jgdkfac6qsmj9i1wzczrakfui8 X-Rspamd-Server: rspamout02 X-Rspamd-Queue-Id: A8CC6E0003E9 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX19MP3rv506VCPcDGFODNyKX4EmAMaIjwdw= X-HE-Tag: 1638122255-377930 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2021-11-28 at 09:43 -0800, Yury Norov wrote: > On Sun, Nov 28, 2021 at 09:07:52AM -0800, Joe Perches wrote: > > On Sat, 2021-11-27 at 19:57 -0800, Yury Norov wrote: > > > Add num_{possible,present,active}_cpus_{eq,gt,le} and replace num_*_cpus() > > > with one of new functions where appropriate. This allows num_*_cpus_*() > > > to return earlier depending on the condition. > > [] > > > diff --git a/arch/arc/kernel/smp.c b/arch/arc/kernel/smp.c > > [] > > > @@ -103,7 +103,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) > > > * if platform didn't set the present map already, do it now > > > * boot cpu is set to present already by init/main.c > > > */ > > > - if (num_present_cpus() <= 1) > > > + if (num_present_cpus_le(2)) > > > init_cpu_present(cpu_possible_mask); > > > > ? is this supposed to be 2 or 1 > > X <= 1 is the equivalent of X < 2. True. The call though is _le not _lt