From: "Yajun Deng" <yajun.deng@linux.dev>
To: "Kefeng Wang" <wangkefeng.wang@huawei.com>, 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 11:16:05 +0000 [thread overview]
Message-ID: <e41ea9022c217bb6aed5a8a4b8375a62878c9c8b@linux.dev> (raw)
In-Reply-To: <1d38aa26-cd2f-4330-9dcc-6c379cecb83b@huawei.com>
May 16, 2024 at 6:03 PM, "Kefeng Wang" <wangkefeng.wang@huawei.com> wrote:
>
> 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/
>
Okay, thanks!
> >
> > 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)
> >
>
prev parent reply other threads:[~2024-05-16 11:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-16 9:17 [PATCH] mm/cma: get nid from physical address Yajun Deng
2024-05-16 10:03 ` Kefeng Wang
2024-05-16 11:16 ` Yajun Deng [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=e41ea9022c217bb6aed5a8a4b8375a62878c9c8b@linux.dev \
--to=yajun.deng@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=wangkefeng.wang@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.