From patchwork Wed Jun 27 12:09:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 10491297 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A108860230 for ; Wed, 27 Jun 2018 12:09:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8ED2928C93 for ; Wed, 27 Jun 2018 12:09:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82F4A28CAC; Wed, 27 Jun 2018 12:09:34 +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 095CC28C93 for ; Wed, 27 Jun 2018 12:09:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 19F516B0003; Wed, 27 Jun 2018 08:09:33 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 129466B0006; Wed, 27 Jun 2018 08:09:33 -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 EE3D26B0269; Wed, 27 Jun 2018 08:09:32 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wm0-f71.google.com (mail-wm0-f71.google.com [74.125.82.71]) by kanga.kvack.org (Postfix) with ESMTP id 8E61A6B0003 for ; Wed, 27 Jun 2018 08:09:32 -0400 (EDT) Received: by mail-wm0-f71.google.com with SMTP id q19-v6so2479056wmq.8 for ; Wed, 27 Jun 2018 05:09:32 -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:message-id; bh=NYxOhpqlcWClbC2y9e5CJK7Uq249r4GM1JrNa0CRv6k=; b=i6kNuhSaXccCQgKhYDlpzUVulbriqHynpEWky4r4T89r/ZQg1z0L+L0CAm/RZ1oEa1 dVEuPB3kcFZG/2NOkva/JKpxRrOXLNp2m6YXLMZESJW6vFbb4xyKDkCGlA6HXVPFXxsJ LiGjDY5/r59qZ10ZL2b0CWjlNFSAvsJCi8nEErcl0o+onoARqgaGmZBtOlMNBKl4DOuA z5Cpcg0Cov/Y4wbFjUUNNdSQAilWJSgLwzHaAtspqofQZq2BAt2Iwdn8jIWREmiy3rdH 98m04t6f9E4lJZ76suZGozHDbODbMJr4NxA/wS+b4VgHVt3ndnAFgsPByPpSV6QjTuAH aOCA== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.158.5 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: APt69E05YbYC4aC5trtdxyIKrYujJRo6tECFA/vp4993r/o7y4wrWHR8 UVH+NjmRriguVn1YwuyG2Auty0dgz7TnMQF9Qzydy03uABxsC5cmu+mi3mnB3yvJlb+XQWOJiey 22WWGpWZ0bkFcaC2SZ4mRsSMrH/1dDUIxxdLf2LxsuNd18G12uj1/4UiUdy7hPZE= X-Received: by 2002:adf:8227:: with SMTP id 36-v6mr4876656wrb.144.1530101372012; Wed, 27 Jun 2018 05:09:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdO9EV9cJE9cHtav8bMl8em4Kv6M/L8UAYU1Oa+uZCulT5e7CDBcQDV+3rqDUP9FFctWh8y X-Received: by 2002:adf:8227:: with SMTP id 36-v6mr4876611wrb.144.1530101371222; Wed, 27 Jun 2018 05:09:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530101371; cv=none; d=google.com; s=arc-20160816; b=08M/YhRIEpW3qG1wOeK0Xnnqj60a3uJNzM5nwzXtFLnq1B9qjcbVTmt015jDg9DUAC F2Gi1PiFcsSJHdF8g7h4OU0KbeE5EdKGbHN1Bic0bPUl14eTumonRJNoZRcbo3P+BpiO czvCpfkgZrBRnyFPtO9t8zMW5WqmOAarssmne7i7w9Vpd5p2qEqkKbp+6JEPrt9D6hGX gUHtULW1VQNOO8QxW1muUp4Q2puTcZk0MjtGYQJcwX5QnmSFKaC4HTSKNPmv0wR7u6Du occJQ64R/7Shr64wTBD8smELmzanRqWba01ojNWdSDpRlQlzCathVrsaXdgn03cqiCS3 enoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=NYxOhpqlcWClbC2y9e5CJK7Uq249r4GM1JrNa0CRv6k=; b=PZz3eL1fhE6JMtWmfM/Xl73lWSXZhVdb5xai/mpYEvhYnUgVY04PCRXjZpyX2PMi/u rZ82XolBfAaZoqHFcjCKGxXWBJvqMRpLLnCiVB7twqO8HrPQoPwoyk91LBjJ8AcWsffu R8dkKL8UZaKupnU5DDVHgaXOHMVITGgZxozi1ugrpslmtuAodYhwsOrn1vbD2LT7Ysgr P10jLxmy3Bs95vTBN6y/3cVnDicfcsDSMofUwXYx4YfuI/NwJpUk1yKxFJyhg9Zp8g68 hMOtoB3F07ilUDTs7jqgK8NZ/Q9Dt7eERuuyC9NDaw1dNwEbkfQ/hD/f6wyS4mH0p55m +hnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 148.163.158.5 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 (mx0b-001b2d01.pphosted.com. [148.163.158.5]) by mx.google.com with ESMTPS id h3-v6si2292534wmi.179.2018.06.27.05.09.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jun 2018 05:09:31 -0700 (PDT) Received-SPF: neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) client-ip=148.163.158.5; Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.158.5 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 (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5RC502M096735 for ; Wed, 27 Jun 2018 08:09:29 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0b-001b2d01.pphosted.com with ESMTP id 2jv9yyh1g7-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 27 Jun 2018 08:09:29 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 27 Jun 2018 13:09:28 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp04.uk.ibm.com (192.168.101.134) 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:09:25 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w5RC9Ogq36503724 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 27 Jun 2018 12:09:24 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C138411C050; Wed, 27 Jun 2018 13:09:15 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3D24711C04C; Wed, 27 Jun 2018 13:09:14 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.8.118]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Wed, 27 Jun 2018 13:09:14 +0100 (BST) Received: by rapoport-lnx (sSMTP sendmail emulation); Wed, 27 Jun 2018 15:09:21 +0300 From: Mike Rapoport To: Mark Salter , Aurelien Jacquiot Cc: Michal Hocko , linux-c6x , linux-mm , lkml , Mike Rapoport Subject: [PATCH] c6x: switch to NO_BOOTMEM Date: Wed, 27 Jun 2018 15:09:20 +0300 X-Mailer: git-send-email 2.7.4 X-TM-AS-GCONF: 00 x-cbid: 18062712-0016-0000-0000-000001E0AC09 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062712-0017-0000-0000-00003234EABC Message-Id: <1530101360-5768-1-git-send-email-rppt@linux.vnet.ibm.com> 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=909 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1806270135 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 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 */