From patchwork Fri Aug 3 19:58:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 10555477 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 6338513B4 for ; Fri, 3 Aug 2018 19:59:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53BF92C1DE for ; Fri, 3 Aug 2018 19:59:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47E182C252; Fri, 3 Aug 2018 19:59:32 +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 5ED022C1DE for ; Fri, 3 Aug 2018 19:59:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4D3366B026D; Fri, 3 Aug 2018 15:59:29 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 4A8D46B026E; Fri, 3 Aug 2018 15:59:29 -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 399F26B026F; Fri, 3 Aug 2018 15:59:29 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by kanga.kvack.org (Postfix) with ESMTP id C785E6B026D for ; Fri, 3 Aug 2018 15:59:28 -0400 (EDT) Received: by mail-ed1-f69.google.com with SMTP id y8-v6so2018984edr.12 for ; Fri, 03 Aug 2018 12:59:28 -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:from:to:cc :subject:date:in-reply-to:references:message-id; bh=GUnPBwTCgCMUyubunDgn1FtKTOdOaBs5jPMP++jGO8M=; b=t1m3eILMNbhHlNyKFPbc86XemdDdfEfYYuB+dPUsagKhz5pfaB5CKa6ancwK41PYiQ VeKXeI5GveTachpadSsuESB3t+AFACU6lNAOZjIKD7oCkf44nejX+mjN8IwPrGXhmH9G Olgx10n8Tte3u+HySmFxPZYYfXzeD1ucNI7vfzo8npOczbZEdUlN2rrU3ud3427p5vnh itUS9mf7Z0aYLq6KtLokOHkerFQv5GWF5g6ACmmrb+pAdZZrJFB/l48mkItcwGmQV5Q/ 9EXTOBIp3G5BwDGmYI6oyfnUZfyMI4HP0N9i0YtSRgGpp50RXuGd9rc0dgRyZsNWRiVc V5FQ== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) smtp.mailfrom=rppt@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com X-Gm-Message-State: AOUpUlFRyHKJsJGTEEpQGzhUdXVnK3eDJ+p/ed/Wv/ENn0zVDOnup3ft qp0FyyqdHixHHYtjd2SGJEehtzMZ8AF7bYAyV4SdMf0UyN4Al9oyUTSs+XO13+pC+D5TzJGC0Ry MxME8Zs0xt9Z9ILxYWfwwkmliKOugt+tsgCgTCAA1ipzkqjEnk8ygddeuoLpWFfY= X-Received: by 2002:a50:ec0b:: with SMTP id g11-v6mr8718146edr.38.1533326368299; Fri, 03 Aug 2018 12:59:28 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcFWWkgsZljCQ2PLUfJIg5IJCcEYCZvZUwIJMgvtF07n3Rnl+68eQ5IZY0HW0xQvmAqM0Cr X-Received: by 2002:a50:ec0b:: with SMTP id g11-v6mr8718129edr.38.1533326367427; Fri, 03 Aug 2018 12:59:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533326367; cv=none; d=google.com; s=arc-20160816; b=JCO9tbNqQMiMIXddoU/yRHUgSKavO/g5xxbrQrxUt/KenlMbAX99ursqZ3/7xxtnnB L86ddFs2HTXXQ4GUIflAevKJAYUgoQWt9w4YSLm6XhAg+wjnV6rF0tBMK2TpGRFa6oAa 0NF1/2AtxSYApYIySg9seTFcAF65wOCZR4cQRf+jmIUIZroCVD/GBazrcLfW3x21AosV FNQ2cfveSO7CnQ0RwgannyFHyIBsJZ35EWtjnHx/VtSZkUCWHPz3os/Jc4jNfKvKXLGR LoTVlCVoQ5fjzQfIA3c1qBxGmc/pcOLdX5GNtgKp9H+YLUAVLofhown6hTiOo49dBZnS ox6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:references:in-reply-to:date:subject:cc:to:from :arc-authentication-results; bh=GUnPBwTCgCMUyubunDgn1FtKTOdOaBs5jPMP++jGO8M=; b=ISnbm24O8XRSGlUlW6HaT4BJy5K7tx+C7CoqmecbLI6MRjOPosUg8FviaseB9K5ucL 6L7fV3nGY9zJy9X1ac0oCbWH1h8JwmJBSWUN51PFOlofbHyF1W6C7zc9eJmJKYYR7nKJ /QTkfDvey2sd2OxoX0chF9uwMIby3mFgolclEUnddmBvOhwaYIxZ/3N4YcaKqCWr1eSe xP7Van1eG/ejpK1rHHiWNeE2rJmiriBavK0kxkoV3dLnVxZaXlpgZH0kHI7Jl762iZmA 8RLmNI23BrDcNFCByhZlZ/qEirTFIh9f+frugpEBW/dSkkztpGk5ckghCfzU1gGA7mk0 oVOg== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) smtp.mailfrom=rppt@linux.vnet.ibm.com; dmarc=fail (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 x62-v6si2285545edc.151.2018.08.03.12.59.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Aug 2018 12:59:27 -0700 (PDT) Received-SPF: neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) client-ip=148.163.156.1; Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) smtp.mailfrom=rppt@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w73Jx4Rt026815 for ; Fri, 3 Aug 2018 15:59:25 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2kmudxctg5-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 03 Aug 2018 15:59:25 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 3 Aug 2018 20:59:22 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) 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) Fri, 3 Aug 2018 20:59:18 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w73JxH9b39256106 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 Aug 2018 19:59:17 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9A2BBA404D; Fri, 3 Aug 2018 22:59:26 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7979DA4040; Fri, 3 Aug 2018 22:59:24 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.204.91]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 3 Aug 2018 22:59:24 +0100 (BST) Received: by rapoport-lnx (sSMTP sendmail emulation); Fri, 03 Aug 2018 22:59:13 +0300 From: Mike Rapoport To: Andrew Morton Cc: Richard Kuo , Ley Foon Tan , Richard Weinberger , Guan Xuetao , Michal Hocko , linux-hexagon@vger.kernel.org, nios2-dev@lists.rocketboards.org, linux-um@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mike Rapoport Subject: [PATCH 7/7] unicore32: switch to NO_BOOTMEM Date: Fri, 3 Aug 2018 22:58:50 +0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533326330-31677-1-git-send-email-rppt@linux.vnet.ibm.com> References: <1533326330-31677-1-git-send-email-rppt@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18080319-4275-0000-0000-000002A367CD X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18080319-4276-0000-0000-000037AB871B Message-Id: <1533326330-31677-8-git-send-email-rppt@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-03_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=48 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=804 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808030216 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 The unicore32 already supports memblock and uses it for some early memory reservations, e.g initrd and the page tables. At some point unicore32 allocates the bootmem bitmap from the memblock and then hands over the memory reservations from memblock to bootmem. This patch removes the bootmem initialization and leaves memblock as the only boot time memory manager for unicore32. Signed-off-by: Mike Rapoport Acked-by: Guan Xuetao --- arch/unicore32/Kconfig | 1 + arch/unicore32/mm/init.c | 54 +----------------------------------------------- 2 files changed, 2 insertions(+), 53 deletions(-) diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig index 03f991e..cff4b9d 100644 --- a/arch/unicore32/Kconfig +++ b/arch/unicore32/Kconfig @@ -5,6 +5,7 @@ config UNICORE32 select ARCH_MIGHT_HAVE_PC_PARPORT select ARCH_MIGHT_HAVE_PC_SERIO select HAVE_MEMBLOCK + select NO_BOOTMEM select HAVE_GENERIC_DMA_COHERENT select HAVE_KERNEL_GZIP select HAVE_KERNEL_BZIP2 diff --git a/arch/unicore32/mm/init.c b/arch/unicore32/mm/init.c index f4950fb..44ccc15 100644 --- a/arch/unicore32/mm/init.c +++ b/arch/unicore32/mm/init.c @@ -84,58 +84,6 @@ static void __init find_limits(unsigned long *min, unsigned long *max_low, } } -static void __init uc32_bootmem_init(unsigned long start_pfn, - unsigned long end_pfn) -{ - struct memblock_region *reg; - unsigned int boot_pages; - phys_addr_t bitmap; - pg_data_t *pgdat; - - /* - * Allocate the bootmem bitmap page. This must be in a region - * of memory which has already been mapped. - */ - boot_pages = bootmem_bootmap_pages(end_pfn - start_pfn); - bitmap = memblock_alloc_base(boot_pages << PAGE_SHIFT, L1_CACHE_BYTES, - __pfn_to_phys(end_pfn)); - - /* - * Initialise the bootmem allocator, handing the - * memory banks over to bootmem. - */ - node_set_online(0); - pgdat = NODE_DATA(0); - init_bootmem_node(pgdat, __phys_to_pfn(bitmap), start_pfn, end_pfn); - - /* Free the lowmem regions from memblock into bootmem. */ - for_each_memblock(memory, reg) { - unsigned long start = memblock_region_memory_base_pfn(reg); - unsigned long end = memblock_region_memory_end_pfn(reg); - - if (end >= end_pfn) - end = end_pfn; - if (start >= end) - break; - - free_bootmem(__pfn_to_phys(start), (end - start) << PAGE_SHIFT); - } - - /* Reserve the lowmem memblock reserved regions in bootmem. */ - for_each_memblock(reserved, reg) { - unsigned long start = memblock_region_reserved_base_pfn(reg); - unsigned long end = memblock_region_reserved_end_pfn(reg); - - if (end >= end_pfn) - end = end_pfn; - if (start >= end) - break; - - reserve_bootmem(__pfn_to_phys(start), - (end - start) << PAGE_SHIFT, BOOTMEM_DEFAULT); - } -} - static void __init uc32_bootmem_free(unsigned long min, unsigned long max_low, unsigned long max_high) { @@ -232,7 +180,7 @@ void __init bootmem_init(void) find_limits(&min, &max_low, &max_high); - uc32_bootmem_init(min, max_low); + node_set_online(0); #ifdef CONFIG_SWIOTLB swiotlb_init(1);