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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5fbe43df-7469-f8af-97a2-ad5f20efa889@huawei.com>
Date:   Mon, 4 Jul 2022 09:14:00 +0800
From:   "wangjie (L)" <wangjie125@...wei.com>
To:     Jesper Dangaard Brouer <jbrouer@...hat.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Guangbin Huang <huangguangbin2@...wei.com>
CC:     <brouer@...hat.com>, <hawk@...nel.org>,
        <ilias.apalodimas@...aro.org>, <davem@...emloft.net>,
        <edumazet@...gle.com>, <pabeni@...hat.com>, <lorenzo@...nel.org>,
        <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <bpf@...r.kernel.org>, <lipeng321@...wei.com>,
        <chenhao288@...ilicon.com>
Subject: Re: [PATCH net-next v2] net: page_pool: optimize page pool page
 allocation in NUMA scenario



On 2022/7/1 15:56, Jesper Dangaard Brouer wrote:
>
> On 01/07/2022 06.15, Jakub Kicinski wrote:
>> On Wed, 29 Jun 2022 21:33:05 +0800 Guangbin Huang wrote:
>>> +#ifdef CONFIG_NUMA
>>> +    pref_nid = (pool->p.nid == NUMA_NO_NODE) ? numa_mem_id() :
>>> pool->p.nid;
>>> +#else
>>> +    /* Ignore pool->p.nid setting if !CONFIG_NUMA */
>>> +    pref_nid = NUMA_NO_NODE;
>>> +#endif
>>
>> Please factor this out to a helper, this is a copy of the code from
>> page_pool_refill_alloc_cache() and #ifdefs are a little yuck.
>>
>
> I would say simply use 'pool->p.nid' in the call to
> alloc_pages_bulk_array_node() and drop this optimization (that was
> copy-pasted from fast-path).
>
> The optimization avoids one reading from memory compile time depending
> on CONFIG_NUMA.  It is *not* worth doing in this code path which is even
> named "slow" (__page_pool_alloc_pages_slow).
>
> --Jesper
>
Simply use pool->p.nid looks simply and makes sense in both scenario. I 
will rewrite and test the patch in next version.
>
> .
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ