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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8780BC433F5 for ; Fri, 6 May 2022 17:24:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=jOL0PTIzq46WznbveIE6NakGpTP7CEDlUeG5DNyNTnI=; b=V7Amk3bKo6SkBZ 1cHKRnJbrMY2hFq+YQGD+BlwmxQQMW7tgAHNI+h3E3Y5K0LkcYa40f0yHO0JQiY3ZBaaxvfpkZiwL emdxNKHjQyr0whVlFsbhiDHJMxAJM7E5EcV+Lg6ctaZ6pkcx3FcKmEbmTrWsExvYDny8UHDW0dyYR GTyon8HR4rmXt2189IAAXcw9mD38NlL2kAMkOKz+hsgOJy7Gb3lvK5F4cbIQ6w/uEtYGap15ycpgd ElyW2nhIFLP4xJo0kn/KtlMmkKpSohORlXSzLqvKw2j6wUZy8UWNKg/a8h1jnqcUzQ3+tMD3aA3y8 ZgQJKSCa/nBvNheMlbuQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nn1gL-004VLF-0P; Fri, 06 May 2022 17:23:57 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nn1gI-004VJs-5s for linux-arm-kernel@lists.infradead.org; Fri, 06 May 2022 17:23:55 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 75303B837F3; Fri, 6 May 2022 17:23:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6385C385A8; Fri, 6 May 2022 17:23:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651857831; bh=nXZ3Q1jTbaZ/sK8x9V920nhEF4T7dJ3ktr0gnhCZATw=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=OfYs4mRhp6lLGqo13sQacwVW9iittAZ7SAI7kb+r6hxxdi/apElxndNV2zhleIjOa R19ikT+HJLadc/9Ye9/w48Cbh2j2zDiXP1448RufOjTjoKrwQLOpaYs7svQda8uNHl 1yp0T2hge2QaBesrUXtuFaOu7mz+e+agAvK9ixsfGkCLNaHFlC3+EC8Cd5CNeCOX3J v498ZxqcSIobrgKGg/YVtjgFYXl3l/djT+e/iwLJwUmjgvQDs6QaZFv0sqApMzlbYU uRHapzwdExq7H7WLMD+rjjwqt1kgyHR0gJHvZWb9+1I3CwwnqPnicF0+eHdFs1YRp5 atMpv+P/D1hUQ== Date: Fri, 6 May 2022 12:23:48 -0500 From: Bjorn Helgaas To: Peng Liu Cc: bhelgaas@google.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, lorenzo.pieralisi@arm.com, guohanjun@huawei.com, sudeep.holla@arm.com, rafael@kernel.org, lenb@kernel.org, akpm@linux-foundation.org, logang@deltatee.com, martin.oliveira@eideticom.com, thunder.leizhen@huawei.com, axboe@kernel.dk, kch@nvidia.com, ming.lei@redhat.com, shinichiro.kawasaki@wdc.com, mcgrof@kernel.org, jiangguoqing@kylinos.cn, jpittman@redhat.com, dave@stgolabs.net, wangkefeng.wang@huawei.com, linux-block@vger.kernel.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org Subject: Re: [PATCH 1/2] include/linux/nodemask.h: create node_available() helper Message-ID: <20220506172348.GA543299@bhelgaas> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220506015801.757918-2-liupeng256@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220506_102354_389171_B95DB575 X-CRM114-Status: GOOD ( 11.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Subject line convention looks like "numa: ..." On Fri, May 06, 2022 at 01:58:00AM +0000, Peng Liu wrote: > Lots of code dose does > node != NUMA_NO_NODE && !node_online(node) > or > node == NUMA_NO_NODE || node_online(node) > so create node_available to do this to simplify code. node_available() I'm not really sure what meaning "node_available" conveys, though. Probably just because I don't understand NUMA. Should the test for NUMA_NO_NODE be folded into node_state() or node_online() directly instead of adding a new node_available() interface? NUMA_NO_NODE is -1. It's not clear to me that node_state()/ node_isset()/test_bit() would do the right thing given -1. I doubt all node_online() callers ensure they don't pass NUMA_NO_NODE. > --- a/include/linux/nodemask.h > +++ b/include/linux/nodemask.h > @@ -70,6 +70,7 @@ > * > * int node_online(node) Is some node online? > * int node_possible(node) Is some node possible? > + * int node_available(node) Is some node available(online or NUMA_NO_NODE)? Existing file generally fits in 80 columns; follow that lead unless you have a really good reason. E.g., maybe this? + * int node_available(node) Node online or NUMA_NO_NODE _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel