Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp6281198imm; Wed, 27 Jun 2018 05:22:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdEdUzhsx7uCwS3S2KpKWbMgDG6BbnmhZ1NmNKEQqHAMycTMzHsn/vJbwPtIqMxFl4wC0Ye X-Received: by 2002:a65:5087:: with SMTP id r7-v6mr286654pgp.113.1530102143276; Wed, 27 Jun 2018 05:22:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530102143; cv=none; d=google.com; s=arc-20160816; b=lhJjYyCidImfq4urxphSKAUEyTXLg6dkJ+cENq3mpg6yHHy9snO93KPZGzfebddGwF Qe5Jr75BbWNyUIxeC8iLA2xmfJ+HnSAtHOmdJbc4mxMb91R2uitnSlk3FvVoyZiCE1nk YoNjjuQsqzV90rMLMIMhBFtOSfn1suERKAy091t4FxaPM5RsLC4EctoBFMk9fmDQKrBY eoyaL2mRYQVcB2P8AEoeiaNcLazR6TeN55ji0Q2erc4zO2ub9twLtU2J5Zv3+fA8QP2u ZPTH37oDRxRXZmhEJXlqxPYTTLt1KSsSfDqHv3Bnxy2lKPhB/szq+oQEqKVxvAnIW1Pt 62TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date :arc-authentication-results; bh=N4tT3hONXy7OMsMv2kdgbFlGPEhxwHFKinBD/+BTD38=; b=AyKULa65AD4JiNKSU22H+eXL3UKw79KJfX3Qvrgy0us6PglDIr/SXAU/NgovPRMoti wmrepxeapgKULo57Xrm0B2q3/52GOyJxGkO9o+mOi2HqqjsibOHtS8j9P1EaQf1cbjxg OfyI5tWhoKTtd77J9xq1bcBWG//8LorAOq3XWREqSzQs+ZJIARn0lKJd0cmVGrZ915w4 ymMamVILhb8jdSfTZOv53vHhTM3Rv4jas8e5VYJ/xjWskRSPMLnRIqF1wvtRbdMOle6w UjyXRYeusr5MwbYvzzilAFXcjD/D0oSG198g3XFNtQG1A0xpGn9lJCPtzdGvKuIQBoSp 4fkg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q2-v6si3838387plh.136.2018.06.27.05.22.08; Wed, 27 Jun 2018 05:22:23 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964882AbeF0MUn (ORCPT + 99 others); Wed, 27 Jun 2018 08:20:43 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:49550 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933679AbeF0MUm (ORCPT ); Wed, 27 Jun 2018 08:20:42 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5RCEWTm031054 for ; Wed, 27 Jun 2018 08:20:42 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2jv8tc4esk-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 27 Jun 2018 08:20:42 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 27 Jun 2018 13:20:39 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 27 Jun 2018 13:20:37 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w5RCKamC31719504 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 27 Jun 2018 12:20:36 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7952A52052; Wed, 27 Jun 2018 13:20:28 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.8.118]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTPS id E97235204E; Wed, 27 Jun 2018 13:20:27 +0100 (BST) Date: Wed, 27 Jun 2018 15:20:33 +0300 From: Mike Rapoport To: Mark Salter , Aurelien Jacquiot Cc: Michal Hocko , linux-c6x , linux-mm , lkml Subject: Re: [PATCH] c6x: switch to NO_BOOTMEM References: <1530101360-5768-1-git-send-email-rppt@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1530101360-5768-1-git-send-email-rppt@linux.vnet.ibm.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-GCONF: 00 x-cbid: 18062712-4275-0000-0000-000002927371 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062712-4276-0000-0000-00003799DC19 Message-Id: <20180627122033.GF4291@rapoport-lnx> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-27_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1806270137 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (adding proper linux-c6x-dev list, sorry about the noise) On Wed, Jun 27, 2018 at 03:09:20PM +0300, Mike Rapoport wrote: > The c6x is already using memblock and does most of early memory > reservations with it, so it was only a matter of removing the bootmem > initialization and handover of the memory from memblock to bootmem. > > Signed-off-by: Mike Rapoport > --- > arch/c6x/Kconfig | 1 + > arch/c6x/kernel/setup.c | 26 +------------------------- > 2 files changed, 2 insertions(+), 25 deletions(-) > > diff --git a/arch/c6x/Kconfig b/arch/c6x/Kconfig > index bf59855628ac..054c7c963180 100644 > --- a/arch/c6x/Kconfig > +++ b/arch/c6x/Kconfig > @@ -14,6 +14,7 @@ config C6X > select GENERIC_IRQ_SHOW > select HAVE_ARCH_TRACEHOOK > select HAVE_MEMBLOCK > + select NO_BOOTMEM > select SPARSE_IRQ > select IRQ_DOMAIN > select OF > diff --git a/arch/c6x/kernel/setup.c b/arch/c6x/kernel/setup.c > index 786e36e2f61d..cc74cb9d349b 100644 > --- a/arch/c6x/kernel/setup.c > +++ b/arch/c6x/kernel/setup.c > @@ -296,7 +296,6 @@ notrace void __init machine_init(unsigned long dt_ptr) > > void __init setup_arch(char **cmdline_p) > { > - int bootmap_size; > struct memblock_region *reg; > > printk(KERN_INFO "Initializing kernel\n"); > @@ -353,16 +352,6 @@ void __init setup_arch(char **cmdline_p) > init_mm.end_data = memory_start; > init_mm.brk = memory_start; > > - /* > - * Give all the memory to the bootmap allocator, tell it to put the > - * boot mem_map at the start of memory > - */ > - bootmap_size = init_bootmem_node(NODE_DATA(0), > - memory_start >> PAGE_SHIFT, > - PAGE_OFFSET >> PAGE_SHIFT, > - memory_end >> PAGE_SHIFT); > - memblock_reserve(memory_start, bootmap_size); > - > unflatten_device_tree(); > > c6x_cache_init(); > @@ -397,22 +386,9 @@ void __init setup_arch(char **cmdline_p) > /* Initialize the coherent memory allocator */ > coherent_mem_init(dma_start, dma_size); > > - /* > - * Free all memory as a starting point. > - */ > - free_bootmem(PAGE_OFFSET, memory_end - PAGE_OFFSET); > - > - /* > - * Then reserve memory which is already being used. > - */ > - for_each_memblock(reserved, reg) { > - pr_debug("reserved - 0x%08x-0x%08x\n", > - (u32) reg->base, (u32) reg->size); > - reserve_bootmem(reg->base, reg->size, BOOTMEM_DEFAULT); > - } > - > max_low_pfn = PFN_DOWN(memory_end); > min_low_pfn = PFN_UP(memory_start); > + max_pfn = max_low_pfn; > max_mapnr = max_low_pfn - min_low_pfn; > > /* Get kmalloc into gear */ > -- > 2.7.4 > -- Sincerely yours, Mike.