Received: by 10.213.65.68 with SMTP id h4csp1039390imn; Wed, 14 Mar 2018 07:52:22 -0700 (PDT) X-Google-Smtp-Source: AG47ELtwU19rlBDvSCFeF8cUl4Lo1dmuKjOup0l+cPT8hVeWXWN2Xbma9HtJinxwaD6SizyeHrlU X-Received: by 10.167.130.88 with SMTP id e24mr4621107pfn.66.1521039142706; Wed, 14 Mar 2018 07:52:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521039142; cv=none; d=google.com; s=arc-20160816; b=dv5XD7gkvvLhwzML5UdqmU2VTzfs76MF9AnOi8uDNfX2lzhrgH7suGLxVK1QON1vt/ Z7Ef5KYBUcxHIpWO+tkXjgiNxe7/cCuxV1Dg616Ibu7anavZfQoVilwGurF1UodXRIb2 zC7bgxQm2/B8zc709t+nC4cY8l1obJ+211hwmmZ3jD0sf4jv8thka/V0Yquslj2VWMNB XuthuANZSI7zrxZ4f5FQhEpS0RUYF4jDR8dCk1z6B9ZG7juPYtuWLtor5Kb0B6UBraaK YyyUY7v9WoZFxU1+Y2UIPd3rHue/XcYUec4qAk4Gf6ZWFsB7aCjGG6qSZz05PLGVhqhg b5Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=bodlhj8oocCWQNcGuBMNLxAf5uoVapByX3RfOh9rR5c=; b=DQTnXLm3wdaEFLMBZK3Cn7u/u0dfXMLoMKrdtoer1oSDInpxNp9QzVQ/Pj5Pyph2RX g5LrEUqkW/PxzEbrURpbXR+9o+MbLXMxEsQNo091Z6avVWTCa+vgp3WjyQgcEUS5Ybve rD3B5Z5WDjlY2DyPlLp+MaiphsGvBBY0DjIVYGzWy9ze0i789IRqvcn2qpArnlFqzN5c v5VCdtMu/TdBRnNd6D5JyqH6G9D67ZS+6nh2BqxgTS0V3hD54g1hcvxaAdJxCDPDIKn2 6wIrEsBbNdQjpqC+giQLQDC5MFJPe6Hhun3imkd/xS8rboY3wUUZJ8Lhitefgu9VPoVZ Imsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=kDIfkypU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c6-v6si2085264plm.448.2018.03.14.07.52.07; Wed, 14 Mar 2018 07:52:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=kDIfkypU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751959AbeCNOvH (ORCPT + 99 others); Wed, 14 Mar 2018 10:51:07 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:58576 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751788AbeCNOvF (ORCPT ); Wed, 14 Mar 2018 10:51:05 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w2EEknQJ058228; Wed, 14 Mar 2018 14:50:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=bodlhj8oocCWQNcGuBMNLxAf5uoVapByX3RfOh9rR5c=; b=kDIfkypUYbCv/OCHjx5LaBKRQyP55JZ1a6oeyx5p+0BX9MDzYlN+ajWaGdNJYqDQyMUk 7CvrRJJhGRtYUsW1vMYYr3Xayl6VRusNuW7IFWzb1a9jGrrcXUCRiyK/iTwBe4Q+Md1m ADDoTqRCMy4R68gdfioWIBN+65XMOcRrSl9diePudcfBuzT1jWgX6P9bUpovB/uohlc1 KWyjPOZZ+F49I6RhnvMqGRFTcbGgoG95uZKJbFqrxOklE+9CM8URHR7Xs6sv36zMtcJZ i8Scjt2v0W6VU1ZT4FvIYF42J5XQ7fGafOH5vwey6Gf3qlOApxU8/OKZCw5y1pRIne8J sA== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2gq4m3rjse-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Mar 2018 14:50:41 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w2EEodxj017668 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Mar 2018 14:50:40 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w2EEocv8007402; Wed, 14 Mar 2018 14:50:38 GMT Received: from [192.168.1.10] (/98.216.35.41) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 14 Mar 2018 07:50:37 -0700 Subject: Re: [PATCH 10/16] mm: remove obsolete alloc_remap() To: Arnd Bergmann , linux-arch@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Andrew Morton , Michal Hocko , Vlastimil Babka , Mel Gorman , Johannes Weiner , Tetsuo Handa , "Kirill A. Shutemov" , Ingo Molnar , Petr Tesarik , Dave Hansen , Wei Yang , linux-mm@kvack.org References: <20180314143529.1456168-1-arnd@arndb.de> <20180314143958.1548568-1-arnd@arndb.de> From: Pavel Tatashin Message-ID: <83b23320-e9de-a0cf-144c-1b60b9b7002a@oracle.com> Date: Wed, 14 Mar 2018 10:50:35 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180314143958.1548568-1-arnd@arndb.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8831 signatures=668690 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803140168 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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), >