public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Tatashin <pasha.tatashin@oracle.com>
To: Arnd Bergmann <arnd@arndb.de>, linux-arch@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Michal Hocko <mhocko@suse.com>, Vlastimil Babka <vbabka@suse.cz>,
	Mel Gorman <mgorman@techsingularity.net>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Ingo Molnar <mingo@kernel.org>, Petr Tesarik <ptesarik@suse.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Wei Yang <richard.weiyang@gmail.com>,
	linux-mm@kvack.org
Subject: Re: [PATCH 10/16] mm: remove obsolete alloc_remap()
Date: Wed, 14 Mar 2018 10:50:35 -0400	[thread overview]
Message-ID: <83b23320-e9de-a0cf-144c-1b60b9b7002a@oracle.com> (raw)
In-Reply-To: <20180314143958.1548568-1-arnd@arndb.de>

Hi Arnd,

I like this cleanup, but arch/tile (which is afaik Orphaned but still in the gate) has:

HAVE_ARCH_ALLOC_REMAP set to yes:

arch/tile/Kconfig
 config HAVE_ARCH_ALLOC_REMAP
         def_bool y

Define in arch/tile/kernel/setup.c:
void *__init alloc_remap(int nid, unsigned long size)
{
        int pages = node_end_pfn[nid] - node_start_pfn[nid];
        void *map = pfn_to_kaddr(node_memmap_pfn[nid]);
        BUG_ON(size != pages * sizeof(struct page));
        memset(map, 0, size);
        return map; 
}

Thank you,
Pavel

On 03/14/2018 10:39 AM, Arnd Bergmann wrote:
> Tile was the only remaining architecture to implement alloc_remap(),
> and since that is being removed, there is no point in keeping this
> function.
> 
> Removing all callers simplifies the mem_map handling.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  include/linux/bootmem.h |  9 ---------
>  mm/page_alloc.c         |  5 +----
>  mm/sparse.c             | 15 ---------------
>  3 files changed, 1 insertion(+), 28 deletions(-)
> 
> diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
> index a53063e9d7d8..7942a96b1a9d 100644
> --- a/include/linux/bootmem.h
> +++ b/include/linux/bootmem.h
> @@ -364,15 +364,6 @@ static inline void __init memblock_free_late(
>  }
>  #endif /* defined(CONFIG_HAVE_MEMBLOCK) && defined(CONFIG_NO_BOOTMEM) */
>  
> -#ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP
> -extern void *alloc_remap(int nid, unsigned long size);
> -#else
> -static inline void *alloc_remap(int nid, unsigned long size)
> -{
> -	return NULL;
> -}
> -#endif /* CONFIG_HAVE_ARCH_ALLOC_REMAP */
> -
>  extern void *alloc_large_system_hash(const char *tablename,
>  				     unsigned long bucketsize,
>  				     unsigned long numentries,
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index cb416723538f..484e21062228 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -6199,10 +6199,7 @@ static void __ref alloc_node_mem_map(struct pglist_data *pgdat)
>  		end = pgdat_end_pfn(pgdat);
>  		end = ALIGN(end, MAX_ORDER_NR_PAGES);
>  		size =  (end - start) * sizeof(struct page);
> -		map = alloc_remap(pgdat->node_id, size);
> -		if (!map)
> -			map = memblock_virt_alloc_node_nopanic(size,
> -							       pgdat->node_id);
> +		map = memblock_virt_alloc_node_nopanic(size, pgdat->node_id);
>  		pgdat->node_mem_map = map + offset;
>  	}
>  	pr_debug("%s: node %d, pgdat %08lx, node_mem_map %08lx\n",
> diff --git a/mm/sparse.c b/mm/sparse.c
> index 7af5e7a92528..65bb52599f90 100644
> --- a/mm/sparse.c
> +++ b/mm/sparse.c
> @@ -427,10 +427,6 @@ struct page __init *sparse_mem_map_populate(unsigned long pnum, int nid,
>  	struct page *map;
>  	unsigned long size;
>  
> -	map = alloc_remap(nid, sizeof(struct page) * PAGES_PER_SECTION);
> -	if (map)
> -		return map;
> -
>  	size = PAGE_ALIGN(sizeof(struct page) * PAGES_PER_SECTION);
>  	map = memblock_virt_alloc_try_nid(size,
>  					  PAGE_SIZE, __pa(MAX_DMA_ADDRESS),
> @@ -446,17 +442,6 @@ void __init sparse_mem_maps_populate_node(struct page **map_map,
>  	unsigned long pnum;
>  	unsigned long size = sizeof(struct page) * PAGES_PER_SECTION;
>  
> -	map = alloc_remap(nodeid, size * map_count);
> -	if (map) {
> -		for (pnum = pnum_begin; pnum < pnum_end; pnum++) {
> -			if (!present_section_nr(pnum))
> -				continue;
> -			map_map[pnum] = map;
> -			map += size;
> -		}
> -		return;
> -	}
> -
>  	size = PAGE_ALIGN(size);
>  	map = memblock_virt_alloc_try_nid_raw(size * map_count,
>  					      PAGE_SIZE, __pa(MAX_DMA_ADDRESS),
> 

  parent reply	other threads:[~2018-03-14 14:50 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-14 14:34 [PATCH 00/16] remove eight obsolete architectures Arnd Bergmann
2018-03-14 14:34 ` Arnd Bergmann
2018-03-14 14:36 ` [PATCH 01/16] mn10300: Remove the architecture Arnd Bergmann
2018-03-14 14:36   ` Arnd Bergmann
2018-03-14 14:36   ` [PATCH 02/16] arch: remove frv port Arnd Bergmann
2018-03-14 14:36     ` Arnd Bergmann
2018-03-14 14:36   ` [PATCH 03/16] arch: remove m32r port Arnd Bergmann
2018-03-14 14:36     ` Arnd Bergmann
2018-03-14 14:36   ` [PATCH 04/16] arch: remove score port Arnd Bergmann
2018-03-14 14:36     ` Arnd Bergmann
2018-03-14 14:36   ` [PATCH 05/16] arch: remove blackfin port Arnd Bergmann
2018-03-14 14:36     ` Arnd Bergmann
2018-03-14 16:51     ` [PATCH] scripts/checkstack.pl: remove blackfin support Tobias Klauser
2018-03-14 16:51       ` Tobias Klauser
2018-03-14 17:04       ` Arnd Bergmann
2018-03-14 17:04         ` Arnd Bergmann
2018-03-15 22:24     ` [PATCH 05/16] arch: remove blackfin port Bryan Wu
2018-03-15 22:24       ` Bryan Wu
2018-03-14 14:36   ` [PATCH 06/16] arch: remove tile port Arnd Bergmann
2018-03-14 14:36     ` Arnd Bergmann
2018-03-16  1:23     ` Chris Metcalf
2018-03-16  1:23       ` Chris Metcalf
2018-03-16  8:12       ` Arnd Bergmann
2018-03-16  8:12         ` Arnd Bergmann
2018-03-14 14:36   ` [PATCH 07/16] CRIS: Drop support for the CRIS port Arnd Bergmann
2018-03-14 14:36     ` Arnd Bergmann
2018-03-14 14:39 ` [PATCH 10/16] mm: remove obsolete alloc_remap() Arnd Bergmann
2018-03-14 14:39   ` Arnd Bergmann
2018-03-14 14:50   ` Pavel Tatashin [this message]
2018-03-14 14:50     ` Pavel Tatashin
2018-03-14 14:56     ` Arnd Bergmann
2018-03-14 14:56       ` Arnd Bergmann
2018-03-14 14:59       ` Pavel Tatashin
2018-03-14 14:59         ` Pavel Tatashin
2018-03-14 14:43 ` [PATCH 11/16] treewide: simplify Kconfig dependencies for removed archs Arnd Bergmann
2018-03-14 14:43   ` Arnd Bergmann
2018-03-14 14:43   ` [PATCH 12/16] asm-generic: siginfo: remove obsolete #ifdefs Arnd Bergmann
2018-03-14 14:43     ` Arnd Bergmann
2018-03-14 16:38     ` Eric W. Biederman
2018-03-14 16:38       ` Eric W. Biederman
2018-03-14 20:31     ` Dominik Brodowski
2018-03-14 20:31       ` Dominik Brodowski
2018-03-14 20:40       ` Arnd Bergmann
2018-03-14 20:40         ` Arnd Bergmann
2018-03-14 20:45         ` Dominik Brodowski
2018-03-14 20:45           ` Dominik Brodowski
2018-03-15 10:06     ` Eric W. Biederman
2018-03-15 10:06       ` Eric W. Biederman
2018-03-15 10:48       ` Arnd Bergmann
2018-03-15 10:48         ` Arnd Bergmann
2018-03-15 11:37         ` Eric W. Biederman
2018-03-15 11:37           ` Eric W. Biederman
2018-03-15 12:50           ` Arnd Bergmann
2018-03-15 12:50             ` Arnd Bergmann
2018-03-15 18:07             ` Eric W. Biederman
2018-03-15 18:07               ` Eric W. Biederman
     [not found]   ` <20180314144614.1632190-1-arnd-r2nGTMty4D4@public.gmane.org>
2018-03-15 12:54     ` [PATCH 11/16] treewide: simplify Kconfig dependencies for removed archs Kalle Valo
2018-03-15 12:54       ` Kalle Valo
2018-03-19 23:06   ` Alexandre Belloni
2018-03-19 23:06     ` Alexandre Belloni
2018-03-14 14:51 ` [PATCH 13/16] Documentation: arch-support: remove obsolete architectures Arnd Bergmann
2018-03-14 14:51   ` Arnd Bergmann
2018-03-14 14:52 ` [PATCH 15/16] recordmcount.pl: drop blackin and tile support Arnd Bergmann
2018-03-14 14:52   ` Arnd Bergmann
2018-03-15 20:42   ` Steven Rostedt
2018-03-15 20:42     ` Steven Rostedt
2018-03-14 14:53 ` [PATCH 16/16] ktest: remove obsolete architectures Arnd Bergmann
2018-03-14 14:53   ` Arnd Bergmann
2018-03-15 20:46   ` Steven Rostedt
2018-03-15 20:46     ` Steven Rostedt
2018-03-14 20:38 ` [PATCH 14/16] asm-generic: clean up asm/unistd.h Arnd Bergmann
2018-03-14 20:38   ` Arnd Bergmann
2018-03-15  9:42 ` [PATCH 00/16] remove eight obsolete architectures David Howells
2018-03-15  9:42   ` David Howells
2018-03-15  9:48   ` Geert Uytterhoeven
2018-03-15  9:48     ` Geert Uytterhoeven
2018-03-15 16:56     ` rfc: remove print_vma_addr ? (was Re: [PATCH 00/16] remove eight obsolete architectures) Joe Perches
2018-03-15 16:56       ` Joe Perches
     [not found]       ` <1521133006.22221.35.camel-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2018-03-15 17:08         ` Matthew Wilcox
2018-03-15 17:08           ` Matthew Wilcox
2018-03-15 17:13           ` Joe Perches
2018-03-15 17:13             ` Joe Perches
2018-03-15  9:56   ` [PATCH 00/16] remove eight obsolete architectures Arnd Bergmann
2018-03-15  9:56     ` Arnd Bergmann
2018-03-16  4:50     ` afzal mohammed
2018-03-16  4:50       ` afzal mohammed
     [not found]   ` <2929.1521106970-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2018-03-15  9:59     ` Hannes Reinecke
2018-03-15  9:59       ` Hannes Reinecke
2018-03-15 10:42       ` Arnd Bergmann
2018-03-15 10:42         ` Arnd Bergmann
2018-03-15 14:17         ` Christoph Hellwig
2018-03-15 14:17           ` Christoph Hellwig
     [not found]         ` <CAK8P3a01pfvsdM1mR8raU9dA7p4H-jRJz2Y8-+KEY76W_Mukpg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-03-20 17:11           ` Palmer Dabbelt
2018-03-20 17:11             ` Palmer Dabbelt

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=83b23320-e9de-a0cf-144c-1b60b9b7002a@oracle.com \
    --to=pasha.tatashin@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hannes@cmpxchg.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@suse.com \
    --cc=mingo@kernel.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=ptesarik@suse.com \
    --cc=richard.weiyang@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox