mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "wangjie (L)" <wangjie125@huawei.com>
To: Jesper Dangaard Brouer <jbrouer@redhat.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Guangbin Huang <huangguangbin2@huawei.com>
Cc: <brouer@redhat.com>, <hawk@kernel.org>,
	<ilias.apalodimas@linaro.org>, <davem@davemloft.net>,
	<edumazet@google.com>, <pabeni@redhat.com>, <lorenzo@kernel.org>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<bpf@vger.kernel.org>, <lipeng321@huawei.com>,
	<chenhao288@hisilicon.com>
Subject: Re: [PATCH net-next v2] net: page_pool: optimize page pool page allocation in NUMA scenario
Date: Mon, 4 Jul 2022 09:14:00 +0800	[thread overview]
Message-ID: <5fbe43df-7469-f8af-97a2-ad5f20efa889@huawei.com> (raw)
In-Reply-To: <728b4c15-8114-e253-5d45-a5610882f891@redhat.com>



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.
>
> .
>


      reply	other threads:[~2022-07-04  1:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-29 13:33 Guangbin Huang
2022-07-01  4:15 ` Jakub Kicinski
2022-07-01  7:56   ` Jesper Dangaard Brouer
2022-07-04  1:14     ` wangjie (L) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5fbe43df-7469-f8af-97a2-ad5f20efa889@huawei.com \
    --to=wangjie125@huawei.com \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=chenhao288@hisilicon.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=huangguangbin2@huawei.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jbrouer@redhat.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lipeng321@huawei.com \
    --cc=lorenzo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®