lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220506172348.GA543299@bhelgaas>
Date:   Fri, 6 May 2022 12:23:48 -0500
From:   Bjorn Helgaas <helgaas@...nel.org>
To:     Peng Liu <liupeng256@...wei.com>
Cc:     bhelgaas@...gle.com, tglx@...utronix.de, mingo@...hat.com,
        bp@...en8.de, dave.hansen@...ux.intel.com, x86@...nel.org,
        hpa@...or.com, lorenzo.pieralisi@....com, guohanjun@...wei.com,
        sudeep.holla@....com, rafael@...nel.org, lenb@...nel.org,
        akpm@...ux-foundation.org, logang@...tatee.com,
        martin.oliveira@...eticom.com, thunder.leizhen@...wei.com,
        axboe@...nel.dk, kch@...dia.com, ming.lei@...hat.com,
        shinichiro.kawasaki@....com, mcgrof@...nel.org,
        jiangguoqing@...inos.cn, jpittman@...hat.com, dave@...olabs.net,
        wangkefeng.wang@...wei.com, linux-block@...r.kernel.org,
        linux-ia64@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-pci@...r.kernel.org, linux-acpi@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-mm@...ck.org
Subject: Re: [PATCH 1/2] include/linux/nodemask.h: create node_available()
 helper

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ