Re: [PATCH 1/2] include/linux/nodemask.h: create node_available() helper
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Peng Liu <liupeng256@xxxxxxxxxx>
- Subject: Re: [PATCH 1/2] include/linux/nodemask.h: create node_available() helper
- From: Bjorn Helgaas <helgaas@xxxxxxxxxx>
- Date: Fri, 6 May 2022 12:23:48 -0500
- Cc: bhelgaas@xxxxxxxxxx, tglx@xxxxxxxxxxxxx, mingo@xxxxxxxxxx, bp@xxxxxxxxx, dave.hansen@xxxxxxxxxxxxxxx, x86@xxxxxxxxxx, hpa@xxxxxxxxx, lorenzo.pieralisi@xxxxxxx, guohanjun@xxxxxxxxxx, sudeep.holla@xxxxxxx, rafael@xxxxxxxxxx, lenb@xxxxxxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx, logang@xxxxxxxxxxxx, martin.oliveira@xxxxxxxxxxxxx, thunder.leizhen@xxxxxxxxxx, axboe@xxxxxxxxx, kch@xxxxxxxxxx, ming.lei@xxxxxxxxxx, shinichiro.kawasaki@xxxxxxx, mcgrof@xxxxxxxxxx, jiangguoqing@xxxxxxxxxx, jpittman@xxxxxxxxxx, dave@xxxxxxxxxxxx, wangkefeng.wang@xxxxxxxxxx, linux-block@xxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-pci@xxxxxxxxxxxxxxx, linux-acpi@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-mm@xxxxxxxxx
- In-reply-to: <20220506015801.757918-2-liupeng256@huawei.com>
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
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]