From mboxrd@z Thu Jan 1 00:00:00 1970 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 6570FC433F5 for ; Sun, 28 Nov 2021 18:02:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238472AbhK1SFe (ORCPT ); Sun, 28 Nov 2021 13:05:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358807AbhK1SDd (ORCPT ); Sun, 28 Nov 2021 13:03:33 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DA88C0617A2; Sun, 28 Nov 2021 09:57:02 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id b13so10249269plg.2; Sun, 28 Nov 2021 09:57:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GIVU/9w51Ef2hg0ubArEuNU4cyYrytLI0Mp9d442l5g=; b=MOV5U2nrdRxFhWxyR7bOZpWlabqXOjxSoT999ssZl4Mq0S6JAhQfWyHw7OPilcdHmF 6BGRpZnEpe8f9bpa77XQqQiPPBLd4gqEwap2s83tCamJXoetkbl6hCD0wkZTc5ZtL81/ 0oBwvtx8A8nEwcdqAvCz07X70fdDjUOrb88hgxJCEmCDBMTsfM8MgzFpsGuihBTo3i4/ BO5H2USw15PhIR9jKFnq7EoAkCha2k8c7ry0hA6yyRozC0i3UkUk9dhKZX7Fdkb9vjGS 8k1hfy+ikEeJEGfeYwNOOXgwgIH5nCo9f2fvYp5m9MjcvWjKnN995P4PSF7zBTJOShEa Axzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GIVU/9w51Ef2hg0ubArEuNU4cyYrytLI0Mp9d442l5g=; b=SNOr0Vk7t+2s5St7ZpxT1BZXRRkotlRASZZHgItDe5FHMqh/Vq2973XYX0YxhxYV2R sSD1LSxcgRuDiwbVjq/mC1c6DbJVWe8L+xmJZTVdo3ds0bGOHnv2GIyOKY5IySEwYo/g VwAd3RoheYvjyOfH+Obm4kaTaNiOaIMTj/QOWm8SnBpkuMr5jGFKNDelpqs3RPpnFc6q d24W76Wx7BbvqhYICtmP7pywWQQ/bj72P92iqZbH9TCHsYqMFL00hHHn1r3J8HkN6RU2 nX0Jy267as/4U9Y3pWCd35Qa9ILfdeqULZjpw/bnFYeyoG6tV94u63OOZdfwjSoikZpe vbmA== X-Gm-Message-State: AOAM5317DfD3Phv3xb7Y2gCl7ZE7oBsX8MFIXt0fN4FF+EYD03dDAIss hmaH2NP1op04j4/PZ0Iwpv7D3daa+nse8bcJcqA= X-Google-Smtp-Source: ABdhPJwg/YAIedkhsO4JO/I1SvpK80O+jGy4LgSO12zXzv7Z2PPdL5Fb+4vML+arhaNI5Rnxj3zFEocQ77wPSF7XA5Q= X-Received: by 2002:a17:902:b581:b0:144:e601:de7 with SMTP id a1-20020a170902b58100b00144e6010de7mr54292000pls.71.1638122222149; Sun, 28 Nov 2021 09:57:02 -0800 (PST) MIME-Version: 1.0 References: <20211128035704.270739-1-yury.norov@gmail.com> <20211128035704.270739-8-yury.norov@gmail.com> <8f389151c39a8a5b6b31d5238cb680305225d9f2.camel@perches.com> <20211128174320.GA304543@lapt> In-Reply-To: <20211128174320.GA304543@lapt> From: Emil Renner Berthing Date: Sun, 28 Nov 2021 18:56:51 +0100 Message-ID: Subject: Re: [PATCH 7/9] lib/cpumask: add num_{possible,present,active}_cpus_{eq,gt,le} To: Yury Norov Cc: Joe Perches , Linux Kernel Mailing List , "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 , 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 , linux-s390@vger.kernel.org, linux-snps-arc@lists.infradead.org, linuxppc-dev@lists.ozlabs.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-csky@vger.kernel.org On Sun, 28 Nov 2021 at 18:43, 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. Ah, then the function is confusing. Usually it's lt = less than and lt = less than or equal. Same idea for gt vs ge.