All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aslan Bakirov <aslanbekirov@gmail.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Aslan Bakirov <aslan@fb.com>,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	 linux-mm@kvack.org, kernel-team@fb.com, riel@surriel.com,
	 Roman Gushchin <guro@fb.com>,
	mhocko@kernel.org, hannes@cmpxchg.org
Subject: Re: [PATCH 1/2] mm: cma: NUMA node interface
Date: Thu, 2 Apr 2020 23:03:52 +0100	[thread overview]
Message-ID: <CAJth39gLFJyQYFMEBa3QuDdSCBy6iMhDABzo2ds6ua4+jprhkQ@mail.gmail.com> (raw)
In-Reply-To: <65164fdb-38b0-e239-84cc-ab22b92214c5@suse.cz>

[-- Attachment #1: Type: text/plain, Size: 2922 bytes --]

On Thu, Apr 2, 2020 at 4:48 PM Vlastimil Babka <vbabka@suse.cz> wrote:

> On 3/26/20 10:27 PM, Aslan Bakirov wrote:
> > I've noticed that there is no interfaces exposed by CMA which would let
> me
> > to declare contigous memory on particular NUMA node.
> >
> > This patchset adds the ability to try to allocate contiguous memory on
> > specific node.
>
> I would say more explicitly that 'try' here means it will fallback to other
> nodes if the specific one doesn't work. At least AFAICS that's what it
> does by
> calling memblock_alloc_range_nid() with exact_nid=false.
>

Thanks for the comments, Vlastimil. I created the next version with
mentioning fallback case in the changelog.

>
> > Implement a new method for declaring contigous memory on particular node
> > and keep cma_declare_contiguous() as a wrapper.
>
> Should there be also support for using this node spcification in the cma=X
> boot
> param?
>
> For this, I would wait for a real usecase for now, because adding it is
easy but removing is hard.


> > Signed-off-by: Aslan Bakirov <aslan@fb.com>
>
> ...
>
> > --- a/mm/cma.c
> > +++ b/mm/cma.c
> > @@ -220,7 +220,7 @@ int __init cma_init_reserved_mem(phys_addr_t base,
> phys_addr_t size,
> >  }
> >
> >  /**
> > - * cma_declare_contiguous() - reserve custom contiguous area
> > + * cma_declare_contiguous_nid() - reserve custom contiguous area
> >   * @base: Base address of the reserved area optional, use 0 for any
> >   * @size: Size of the reserved area (in bytes),
> >   * @limit: End address of the reserved memory (optional, 0 for any).
> > @@ -229,6 +229,7 @@ int __init cma_init_reserved_mem(phys_addr_t base,
> phys_addr_t size,
> >   * @fixed: hint about where to place the reserved area
> >   * @name: The name of the area. See function cma_init_reserved_mem()
> >   * @res_cma: Pointer to store the created cma region.
> > + * @nid: nid of the free area to find, %NUMA_NO_NODE for any node
>
> The bit about fallback should be also specified here.
>
> >   *
> >   * This function reserves memory from early allocator. It should be
> >   * called by arch specific code once the early allocator (memblock or
> bootmem)
> > @@ -238,10 +239,10 @@ int __init cma_init_reserved_mem(phys_addr_t base,
> phys_addr_t size,
> >   * If @fixed is true, reserve contiguous area at exactly @base.  If
> false,
> >   * reserve in range from @base to @limit.
> >   */
> > -int __init cma_declare_contiguous(phys_addr_t base,
> > +int __init cma_declare_contiguous_nid(phys_addr_t base,
> >                       phys_addr_t size, phys_addr_t limit,
> >                       phys_addr_t alignment, unsigned int order_per_bit,
> > -                     bool fixed, const char *name, struct cma **res_cma)
> > +                     bool fixed, const char *name, struct cma
> **res_cma, int nid)
> >  {
> >       phys_addr_t memblock_end = memblock_end_of_DRAM();
> >       phys_addr_t highmem_start;
>
>

[-- Attachment #2: Type: text/html, Size: 3970 bytes --]

  reply	other threads:[~2020-04-02 22:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26 21:27 [PATCH 1/2] mm: cma: NUMA node interface Aslan Bakirov
2020-03-26 21:27 ` [PATCH 2/2] mm: hugetlb: Use node interface of cma Aslan Bakirov
2020-03-27  8:06   ` Michal Hocko
2020-03-27 14:41     ` Roman Gushchin
2020-03-27 15:13       ` Michal Hocko
2020-04-02 15:20         ` Vlastimil Babka
2020-04-02 17:24           ` Michal Hocko
2020-03-27  2:50 ` [PATCH 1/2] mm: cma: NUMA node interface kbuild test robot
2020-03-27  8:02 ` Michal Hocko
2020-04-02 15:48 ` Vlastimil Babka
2020-04-02 22:03   ` Aslan Bakirov [this message]
2020-04-03 15:09   ` Roman Gushchin
2020-04-03 10:18 Aslan Bakirov
2020-04-03 11:18 Aslan Bakirov

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=CAJth39gLFJyQYFMEBa3QuDdSCBy6iMhDABzo2ds6ua4+jprhkQ@mail.gmail.com \
    --to=aslanbekirov@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=aslan@fb.com \
    --cc=guro@fb.com \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=riel@surriel.com \
    --cc=vbabka@suse.cz \
    /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.