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 2B13EC61DA4 for ; Wed, 15 Mar 2023 16:49:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231924AbjCOQtU (ORCPT ); Wed, 15 Mar 2023 12:49:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230044AbjCOQtM (ORCPT ); Wed, 15 Mar 2023 12:49:12 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E934E3C3B for ; Wed, 15 Mar 2023 09:48:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678898898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=nm5gfruTLsdagm9njmR29/Ig/a6aY+NuRLyWyFUeNqo=; b=FQSiS9fdfUyaG1punQWH9LZA1+RfMd2cNJ5xsSQWz4yr1SqzdJzwjeJk3CzHqpGOPcdHcb wXMlog5vwafcEpMz7RW41+nwhiKjjVKfatODIxalzyuwzenfWPnBDqwTPfDFx3fjJRGH08 CqeYrwW6HcbE4mC3s9oQHaZZUtH5X3E= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-654-OrOHAQrROeedLzyEuGOZ-w-1; Wed, 15 Mar 2023 12:48:17 -0400 X-MC-Unique: OrOHAQrROeedLzyEuGOZ-w-1 Received: by mail-wr1-f72.google.com with SMTP id bn9-20020a056000060900b002cfe8493fe6so1170273wrb.4 for ; Wed, 15 Mar 2023 09:48:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678898896; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nm5gfruTLsdagm9njmR29/Ig/a6aY+NuRLyWyFUeNqo=; b=sqLDhFVtcfqfrZeAicE/FwaQNnCJXubbkudcYjzY4Apxn6e6rocjaUavJ0UQvxrKMW wKP5vhdVZ7hfqwY+gCod8rndHiagxX3Un3GlspvTLnyUBrRbosJhITyFu4acKujAipty KT+DwA348Kz54ENvbGgrHW5IpRS2Ma72J+A+4EmOx6fDVSg4nL+0PjuRsh+AYvqOwSdM mKXn2/wJK1bL4enjBuATEvkZSvH3w4XqwJi66kJ4KkjvooALLshGhJGBB6+kj9cQIcvV RIamdSomi7GAdmqKTLAqB0Hg5EV79TuoC/H+u3K/f5siP+Sbbem3y8rmWQLqdpyiLcZt 0bAQ== X-Gm-Message-State: AO0yUKXPZGtzRM/1464qRDXV1PYYdy2QsY5T2Js9grQfdbmqt0bsH7CY YNHSyYVFxCBT9VRZpndSnuoUOQXfQSDTA0THBCJctv6EgYnJBHWPGja6VRfrL+UGMwxgjYdQhPr 9Jk4DKPXyr1KjMTg9qMetnA7T X-Received: by 2002:adf:f209:0:b0:2d0:27dd:9c40 with SMTP id p9-20020adff209000000b002d027dd9c40mr2037092wro.26.1678898895832; Wed, 15 Mar 2023 09:48:15 -0700 (PDT) X-Google-Smtp-Source: AK7set9jfn/9WqJrQVlsKAuBzHsI/W7q2SC2Q1SzV+VIJZiJybGCBhMLfTelmL18XXOCJLm0rYHCmQ== X-Received: by 2002:adf:f209:0:b0:2d0:27dd:9c40 with SMTP id p9-20020adff209000000b002d027dd9c40mr2037086wro.26.1678898895600; Wed, 15 Mar 2023 09:48:15 -0700 (PDT) Received: from vschneid.remote.csb ([154.57.232.159]) by smtp.gmail.com with ESMTPSA id h13-20020a056000000d00b002cfec8b7f89sm4560610wrx.77.2023.03.15.09.48.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 09:48:15 -0700 (PDT) From: Valentin Schneider To: Yury Norov , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: Yury Norov , Arnd Bergmann , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Jeremy Kerr , Jakub Kicinski , Dietmar Eggemann , Barry Song Subject: Re: [PATCH 1/2] sched/topology: introduce node_has_cpus() macro In-Reply-To: <20230222025029.453834-1-yury.norov@gmail.com> References: <20230222025029.453834-1-yury.norov@gmail.com> Date: Wed, 15 Mar 2023 16:48:12 +0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/02/23 18:50, Yury Norov wrote: > Currently, to check if NUMA node has CPUs, one has to use the > nr_cpus_node() macro, which ends up with cpumask_weight. We can do it > better with cpumask_empty(), because the latter can potentially return > earlier - as soon as 1st set bit found. > > This patch adds a node_has_cpus() macro to implement that. > > Signed-off-by: Yury Norov Reviewed-by: Valentin Schneider