From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Yajun Deng <yajun.deng@linux.dev>, <akpm@linux-foundation.org>
Cc: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm/cma: get nid from physical address
Date: Thu, 16 May 2024 18:03:44 +0800 [thread overview]
Message-ID: <1d38aa26-cd2f-4330-9dcc-6c379cecb83b@huawei.com> (raw)
In-Reply-To: <20240516091701.1527002-1-yajun.deng@linux.dev>
On 2024/5/16 17:17, Yajun Deng wrote:
> The nid passed to cma_declare_contiguous_nid() may be NUMA_NO_NODE,
> which is not the actual nid. To get the correct nid, we can get the nid
> from physical address.
>
Please check
https://lore.kernel.org/linux-riscv/47437c2b-5946-41c6-ad1b-cc03329eb230@huawei.com/
> Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
> ---
> mm/cma.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/mm/cma.c b/mm/cma.c
> index 3e9724716bad..be6cdde32944 100644
> --- a/mm/cma.c
> +++ b/mm/cma.c
> @@ -361,6 +361,7 @@ int __init cma_declare_contiguous_nid(phys_addr_t base,
> kmemleak_ignore_phys(addr);
> base = addr;
> }
> + nid = early_pfn_to_nid(PHYS_PFN(base));
>
> ret = cma_init_reserved_mem(base, size, order_per_bit, name, res_cma);
> if (ret)
next prev parent reply other threads:[~2024-05-16 10:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-16 9:17 Yajun Deng
2024-05-16 10:03 ` Kefeng Wang [this message]
2024-05-16 11:16 ` Yajun Deng
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=1d38aa26-cd2f-4330-9dcc-6c379cecb83b@huawei.com \
--to=wangkefeng.wang@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=yajun.deng@linux.dev \
/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