From: Aslan Bakirov <aslanbekirov@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
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 v2] mm: cma: NUMA node interface
Date: Thu, 2 Apr 2020 23:26:51 +0100 [thread overview]
Message-ID: <CAJth39gK87TE6ejVkRu6RxdU2AD-47CviiDxeEWVXe_2Gs7Pbw@mail.gmail.com> (raw)
In-Reply-To: <20200402220713.GO21484@bombadil.infradead.org>
[-- Attachment #1: Type: text/plain, Size: 2839 bytes --]
On Thu, Apr 2, 2020 at 11:07 PM Matthew Wilcox <willy@infradead.org> wrote:
> On Thu, Apr 02, 2020 at 02:58:10PM -0700, 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.
>
> Do you have a user for this functionality?
>
Yes, we are using this functionality in second part of this patchset, We
use this interface
in hugetlb_cma_reserve() to reserve CMA on specific node.
>
> > +++ b/include/linux/cma.h
> > @@ -24,10 +24,20 @@ extern phys_addr_t cma_get_base(const struct cma
> *cma);
> > extern unsigned long cma_get_size(const struct cma *cma);
> > extern const char *cma_get_name(const struct cma *cma);
> >
> > -extern int __init cma_declare_contiguous(phys_addr_t base,
> > +extern 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);
> > +static inline int __init cma_declare_contiguous(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)
> > + {
> > + return cma_declare_contiguous_nid(base,
> size,
> > + limit, alignment,
> order_per_bit,
> > + fixed, name, res_cma,
> NUMA_NO_NODE);
> > + }
>
> ... what even is this indentation?
>
> Sorry, about indentation problems, fix is coming in the next version.
> +phys_addr_t memblock_alloc_range_nid(phys_addr_t size,
> > + phys_addr_t align, phys_addr_t
> start,
> > + phys_addr_t end, int nid, bool
> exact_nid);
>
> >80 columns. checkpatch should warn you of nits like this.
>
> > if (base < highmem_start && limit > highmem_start) {
> > - addr = memblock_phys_alloc_range(size, alignment,
> > - highmem_start,
> limit);
> > + addr = memblock_alloc_range_nid(size, alignment,
> > + highmem_start,
> limit, nid, false);
>
> The deep indentation makes it hard to add new parameters. I'd do it as:
> addr = memblock_alloc_range_nid(size, alignment,
> highmem_start, limit, nid, false);
>
>
>
[-- Attachment #2: Type: text/html, Size: 4042 bytes --]
prev parent reply other threads:[~2020-04-02 22:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-02 21:58 Aslan Bakirov
2020-04-02 22:07 ` Matthew Wilcox
2020-04-02 22:26 ` Aslan Bakirov [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=CAJth39gK87TE6ejVkRu6RxdU2AD-47CviiDxeEWVXe_2Gs7Pbw@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=willy@infradead.org \
/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