From patchwork Sat Oct 27 09:20:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 10658295 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B4D6414E2 for ; Sat, 27 Oct 2018 09:20:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C93C2BCCF for ; Sat, 27 Oct 2018 09:20:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9048B2BE15; Sat, 27 Oct 2018 09:20:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5086E2BE13 for ; Sat, 27 Oct 2018 09:20:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BBADD6B0334; Sat, 27 Oct 2018 05:20:41 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B68396B0335; Sat, 27 Oct 2018 05:20:41 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A56E16B0336; Sat, 27 Oct 2018 05:20:41 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ot1-f70.google.com (mail-ot1-f70.google.com [209.85.210.70]) by kanga.kvack.org (Postfix) with ESMTP id 7846F6B0334 for ; Sat, 27 Oct 2018 05:20:41 -0400 (EDT) Received: by mail-ot1-f70.google.com with SMTP id k24so1371245otl.13 for ; Sat, 27 Oct 2018 02:20:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:date:from:to :cc:subject:mime-version:content-disposition:user-agent:message-id; bh=jJI+wENLETUv/7MyFHQ1CQCCWFudll7CpKS47LGWRw4=; b=UQG63C/b+1e3T9FwCVOFPjSmJlMcjhV+HOq6AHraItlp30Z6+RTbDjELb8gnJpmMBX GHJEfq2mifldMYuBNpF2QxS9SRYkLwtLQbl2bA30BW99PyS/irVMB6aeb9/0JttFpN0J TjUWm766zWcTrhhS6C4ScYi1vfckrvAL9q7fYrR5iwEt63HcH3xBVR8OiZzMt/PfcRJp cGMTTnoGYUmOuDF6E5UZWkjP2v/zCf+NDj0DbSaZOrB/utWZhR0OEoSKhyTmhVdjfd+z Ge3lqtqlYJuO86kL6RQeCl2gi29ODI8oyj4eR1M+haiwS0iRh0W3cCh8inp4JClmqMUv 6Alw== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of rppt@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=rppt@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com X-Gm-Message-State: AGRZ1gK3QH1sfaoCC+OLMLttcCFbQHQ9TWkrjG+oftqWieKf139nkx4C QlCZKEdnG02fGxxvDT2VcnFZRPlKZ2bXHJiMm6OoC2311tAbXenU5a+lr/f3Tq2E7v4kDAa/2Ea Dj5p28bXyGVEGiPp9cv2rM1NWXBeh0sbvfvZmCoqPEPC1ihyaFaXiniFXkIqiDAHAKA== X-Received: by 2002:aca:dd42:: with SMTP id u63-v6mr3861727oig.306.1540632041150; Sat, 27 Oct 2018 02:20:41 -0700 (PDT) X-Google-Smtp-Source: AJdET5ezyk7OsFNJHII7BTUJdaP1rrTfa4RaDiptPgHjpACmB5zYeICacgHV9CE1BxNGKZ9Z3RsU X-Received: by 2002:aca:dd42:: with SMTP id u63-v6mr3861708oig.306.1540632040322; Sat, 27 Oct 2018 02:20:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540632040; cv=none; d=google.com; s=arc-20160816; b=A+rx5qOccmCEcD/NwkoN928NIY/wJyvuZrRo22N5oiODDYCO1gRLDRRf7cWmt9LO7J aiPK3ptFcc2eI4iQJKihUYGkYSazAFq5v4/oeWysWyZOtlRg9mNwaP78CGuwsVJOQxdH nHGBsVwoijCjnRhCNvm/Qq+6NvQ8VwXj1yLSvII2pOfBdJsYJ3MpbtPkigF7vovNL86o RH46w7Medq/2uIETXJhzTsftaUC9Q1hyIA6IHDVijJVY3dwAnhMrUmuJfRXfGVdtKCGH GdYwoALKczON20LTMdndY6thDx9iNURtYGysDzXT1YNjT4+BjMymRyXnDF93xj7qajbp SjjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:user-agent:content-disposition:mime-version:subject:cc :to:from:date; bh=jJI+wENLETUv/7MyFHQ1CQCCWFudll7CpKS47LGWRw4=; b=l1pRO6plzxRpnDJ6sTFTYFjCDwJiC4HIDz+21GDQhG0iKbSMIHMvOXMzPKG4qzteyF Jf63/2mELgYlhXqaptWfJUHtaD0rGjz73rKZJMdS6ita6WE4wBX2TwfdNQr+i9wrNERR YPOJE6E9nWXnE6e77vfPxXjjf1+1j7Xjz5e0cxHXIFEG2UW7dGQpaXOUOcL/LpY2+mTH oiH0tMj/H+mKe9gNHRtw9l01AaKZDmsS9acVprfiD0SxlX1QKuGbWCR+7DucbBYbfBwV qyMQrEe874qqjEFWFQiFKsxVwnCGO2vuUfhk1lKvW2YFoejUuNyLsOZeU2Oq3XbIL3qO x9AQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of rppt@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=rppt@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com. [148.163.156.1]) by mx.google.com with ESMTPS id j187-v6si6277oih.22.2018.10.27.02.20.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Oct 2018 02:20:40 -0700 (PDT) Received-SPF: pass (google.com: domain of rppt@linux.ibm.com designates 148.163.156.1 as permitted sender) client-ip=148.163.156.1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of rppt@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=rppt@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w9R9IiwS078954 for ; Sat, 27 Oct 2018 05:20:39 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ncn39rath-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 27 Oct 2018 05:20:39 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 27 Oct 2018 10:20:36 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) 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) Sat, 27 Oct 2018 10:20:34 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w9R9KXvX65732768 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 27 Oct 2018 09:20:33 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ACAD552052; Sat, 27 Oct 2018 09:20:33 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.207.63]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTPS id 692E952051; Sat, 27 Oct 2018 09:20:32 +0000 (GMT) Date: Sat, 27 Oct 2018 10:20:29 +0100 From: Mike Rapoport To: Andrew Morton Cc: Mark Salter , linux-c6x-dev@linux-c6x.org, linux-mm@kvack.org Subject: [PATCH RESEND] c6x: switch to NO_BOOTMEM MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-GCONF: 00 x-cbid: 18102709-4275-0000-0000-000002D4AB71 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18102709-4276-0000-0000-000037E0C400 Message-Id: <20181027092028.GC6770@rapoport-lnx> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-10-27_02:,, 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-1807170000 definitions=main-1810270087 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Hi, The patch below that switches c6x to NO_BOOTMEM is already merged into c6x tree, but as there were no pull request from c6x during v4.19 merge window it is still not present in Linus' tree. Probably it would be better to direct it via mm tree to avoid possible conflicts and breakage because of bootmem removal. 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 */