[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKv+Gu8dO=fn+MLvZEGzJMvw6u1vMaACz5utBzE4YLLFduGRFQ@mail.gmail.com>
Date: Mon, 2 Apr 2018 08:57:44 +0200
From: Ard Biesheuvel <ard.biesheuvel@...aro.org>
To: Jia He <hejianet@...il.com>
Cc: Russell King <linux@...linux.org.uk>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will.deacon@....com>,
Mark Rutland <mark.rutland@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
Michal Hocko <mhocko@...e.com>,
Wei Yang <richard.weiyang@...il.com>,
Kees Cook <keescook@...omium.org>,
Laura Abbott <labbott@...hat.com>,
Vladimir Murzin <vladimir.murzin@....com>,
Philip Derrin <philip@....systems>,
AKASHI Takahiro <takahiro.akashi@...aro.org>,
James Morse <james.morse@....com>,
Steve Capper <steve.capper@....com>,
Pavel Tatashin <pasha.tatashin@...cle.com>,
Gioh Kim <gi-oh.kim@...fitbricks.com>,
Vlastimil Babka <vbabka@...e.cz>, Mel Gorman <mgorman@...e.de>,
Johannes Weiner <hannes@...xchg.org>,
Kemi Wang <kemi.wang@...el.com>,
Petr Tesarik <ptesarik@...e.com>,
YASUAKI ISHIMATSU <yasu.isimatu@...il.com>,
Andrey Ryabinin <aryabinin@...tuozzo.com>,
Nikolay Borisov <nborisov@...e.com>,
Daniel Jordan <daniel.m.jordan@...cle.com>,
Daniel Vacek <neelx@...hat.com>,
Eugeniu Rosca <erosca@...adit-jv.com>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux-MM <linux-mm@...ck.org>, Jia He <jia.he@...-semitech.com>
Subject: Re: [PATCH v5 3/5] mm/memblock: introduce memblock_search_pfn_regions()
On 2 April 2018 at 04:30, Jia He <hejianet@...il.com> wrote:
> This api is the preparation for further optimizing early_pfn_valid
>
Please add more explanatation here of what it is you are doing and why.
> Signed-off-by: Jia He <jia.he@...-semitech.com>
> ---
> include/linux/memblock.h | 2 ++
> mm/memblock.c | 9 +++++++++
> 2 files changed, 11 insertions(+)
>
> diff --git a/include/linux/memblock.h b/include/linux/memblock.h
> index 0257aee..a0127b3 100644
> --- a/include/linux/memblock.h
> +++ b/include/linux/memblock.h
> @@ -203,6 +203,8 @@ void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn,
> i >= 0; __next_mem_pfn_range(&i, nid, p_start, p_end, p_nid))
> #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
>
> +int memblock_search_pfn_regions(unsigned long pfn);
> +
> /**
> * for_each_free_mem_range - iterate through free memblock areas
> * @i: u64 used as loop variable
> diff --git a/mm/memblock.c b/mm/memblock.c
> index ba7c878..0f4004c 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -1617,6 +1617,15 @@ static int __init_memblock memblock_search(struct memblock_type *type, phys_addr
> return -1;
> }
>
> +/* search memblock with the input pfn, return the region idx */
> +int __init_memblock memblock_search_pfn_regions(unsigned long pfn)
> +{
> + struct memblock_type *type = &memblock.memory;
> + int mid = memblock_search(type, PFN_PHYS(pfn));
> +
> + return mid;
> +}
> +
> bool __init memblock_is_reserved(phys_addr_t addr)
> {
> return memblock_search(&memblock.reserved, addr) != -1;
> --
> 2.7.4
>
Powered by blists - more mailing lists