From patchwork Mon Feb 28 13:23:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiezhu Yang X-Patchwork-Id: 12763300 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 913E7C43219 for ; Mon, 28 Feb 2022 13:23:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235756AbiB1NY2 (ORCPT ); Mon, 28 Feb 2022 08:24:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235684AbiB1NYZ (ORCPT ); Mon, 28 Feb 2022 08:24:25 -0500 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3F55226AED; Mon, 28 Feb 2022 05:23:45 -0800 (PST) Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9DxeMjazBxiKEAIAA--.10706S3; Mon, 28 Feb 2022 21:23:38 +0800 (CST) From: Tiezhu Yang To: Thomas Bogendoerfer , Mike Rapoport , Andrew Morton Cc: Xuefeng Li , linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/4] MIPS: Refactor early_parse_mem() to fix mem= parameter Date: Mon, 28 Feb 2022 21:23:34 +0800 Message-Id: <1646054617-16799-2-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1646054617-16799-1-git-send-email-yangtiezhu@loongson.cn> References: <1646054617-16799-1-git-send-email-yangtiezhu@loongson.cn> X-CM-TRANSID: AQAAf9DxeMjazBxiKEAIAA--.10706S3 X-Coremail-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GvfC2KfnxnUUI43ZEXa7VUUTqc7UUUUU== X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org According to Documentation/admin-guide/kernel-parameters.txt, the kernel command-line parameter mem= means "Force usage of a specific amount of memory", but when add "mem=3G" to the command-line, kernel boot hangs in sparse_init(). This commit is similar with the implementation of the other archs such as arm64, powerpc and riscv, refactor the function early_parse_mem() and then use memblock_enforce_memory_limit() to limit the memory size. With this patch, when add "mem=3G" to the command-line, the kernel boots successfully, we can see the following messages: [ 0.000000] Memory limited to 3072MB ... [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000000200000-0x000000000effffff] [ 0.000000] node 0: [mem 0x0000000090200000-0x00000000ffffffff] [ 0.000000] node 0: [mem 0x0000000120000000-0x00000001613fffff] ... [ 0.000000] Memory: 3005280K/3145728K available (...) After login, the output of free command is consistent with the above log. Signed-off-by: Tiezhu Yang Reported-by: kernel test robot --- arch/mips/kernel/setup.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index f979adf..6b6d718 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -339,27 +339,15 @@ static void __init bootmem_init(void) #endif /* CONFIG_SGI_IP27 */ static int usermem __initdata; +static phys_addr_t memory_limit; static int __init early_parse_mem(char *p) { - phys_addr_t start, size; - - /* - * If a user specifies memory size, we - * blow away any automatically generated - * size. - */ - if (usermem == 0) { - usermem = 1; - memblock_remove(memblock_start_of_DRAM(), - memblock_end_of_DRAM() - memblock_start_of_DRAM()); - } - start = 0; - size = memparse(p, &p); - if (*p == '@') - start = memparse(p + 1, &p); + if (!p) + return 1; - memblock_add(start, size); + memory_limit = memparse(p, &p) & PAGE_MASK; + pr_notice("Memory limited to %lldMB\n", memory_limit >> 20); return 0; } @@ -678,6 +666,10 @@ static void __init arch_mem_init(char **cmdline_p) memblock_reserve(__pa_symbol(&__nosave_begin), __pa_symbol(&__nosave_end) - __pa_symbol(&__nosave_begin)); + /* Limit the memory. */ + memblock_enforce_memory_limit(memory_limit); + memblock_allow_resize(); + early_memtest(PFN_PHYS(ARCH_PFN_OFFSET), PFN_PHYS(max_low_pfn)); } From patchwork Mon Feb 28 13:23:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiezhu Yang X-Patchwork-Id: 12763299 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7AE78C433EF for ; Mon, 28 Feb 2022 13:23:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235751AbiB1NY1 (ORCPT ); Mon, 28 Feb 2022 08:24:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235683AbiB1NYZ (ORCPT ); Mon, 28 Feb 2022 08:24:25 -0500 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3F46826AEA; Mon, 28 Feb 2022 05:23:45 -0800 (PST) Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9DxeMjazBxiKEAIAA--.10706S4; Mon, 28 Feb 2022 21:23:39 +0800 (CST) From: Tiezhu Yang To: Thomas Bogendoerfer , Mike Rapoport , Andrew Morton Cc: Xuefeng Li , linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/4] memblock: Introduce memblock_mem_range_remove_map() Date: Mon, 28 Feb 2022 21:23:35 +0800 Message-Id: <1646054617-16799-3-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1646054617-16799-1-git-send-email-yangtiezhu@loongson.cn> References: <1646054617-16799-1-git-send-email-yangtiezhu@loongson.cn> X-CM-TRANSID: AQAAf9DxeMjazBxiKEAIAA--.10706S4 X-Coremail-Antispam: 1UD129KBjvJXoW7CF43XF17ZrWkZFyUKF1DAwb_yoW8CFy7pr n3G3W8CF48GFn7Xa97G3W3ury7A34rCF1fWFW7Cr1q9a4xJr1xuw4kGayUtFyjqF47KFs0 vF1xJayDGFZF9FUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBI14x267AKxVW5JVWrJwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_Jryl82xGYIkIc2 x26xkF7I0E14v26r4j6ryUM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0 Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1l84 ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I2 62IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcV AFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r4j6F4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG 0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lc2xSY4AK67AK6ry8MxAIw28Icx kI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2Iq xVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42 IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY 6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aV CY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7sRiDUU3UUUUU== X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org This is preparation for supporting memmap=limit@base parameter, no functionality change. Signed-off-by: Tiezhu Yang --- include/linux/memblock.h | 1 + mm/memblock.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 50ad196..e558d2c 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h @@ -482,6 +482,7 @@ phys_addr_t memblock_end_of_DRAM(void); void memblock_enforce_memory_limit(phys_addr_t memory_limit); void memblock_cap_memory_range(phys_addr_t base, phys_addr_t size); void memblock_mem_limit_remove_map(phys_addr_t limit); +void memblock_mem_range_remove_map(phys_addr_t base, phys_addr_t limit); bool memblock_is_memory(phys_addr_t addr); bool memblock_is_map_memory(phys_addr_t addr); bool memblock_is_region_memory(phys_addr_t base, phys_addr_t size); diff --git a/mm/memblock.c b/mm/memblock.c index 1018e50..2476d15d 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -1723,7 +1723,7 @@ void __init memblock_cap_memory_range(phys_addr_t base, phys_addr_t size) base + size, PHYS_ADDR_MAX); } -void __init memblock_mem_limit_remove_map(phys_addr_t limit) +void __init memblock_mem_range_remove_map(phys_addr_t base, phys_addr_t limit) { phys_addr_t max_addr; @@ -1736,7 +1736,12 @@ void __init memblock_mem_limit_remove_map(phys_addr_t limit) if (max_addr == PHYS_ADDR_MAX) return; - memblock_cap_memory_range(0, max_addr); + memblock_cap_memory_range(base, max_addr); +} + +void __init memblock_mem_limit_remove_map(phys_addr_t limit) +{ + memblock_mem_range_remove_map(0, limit); } static int __init_memblock memblock_search(struct memblock_type *type, phys_addr_t addr) From patchwork Mon Feb 28 13:23:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiezhu Yang X-Patchwork-Id: 12763297 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC334C433EF for ; Mon, 28 Feb 2022 13:23:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229906AbiB1NY0 (ORCPT ); Mon, 28 Feb 2022 08:24:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235681AbiB1NYZ (ORCPT ); Mon, 28 Feb 2022 08:24:25 -0500 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 22CF926AC0; Mon, 28 Feb 2022 05:23:44 -0800 (PST) Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9DxeMjazBxiKEAIAA--.10706S5; Mon, 28 Feb 2022 21:23:39 +0800 (CST) From: Tiezhu Yang To: Thomas Bogendoerfer , Mike Rapoport , Andrew Morton Cc: Xuefeng Li , linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/4] MIPS: Refactor early_parse_memmap() to fix memmap= parameter Date: Mon, 28 Feb 2022 21:23:36 +0800 Message-Id: <1646054617-16799-4-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1646054617-16799-1-git-send-email-yangtiezhu@loongson.cn> References: <1646054617-16799-1-git-send-email-yangtiezhu@loongson.cn> X-CM-TRANSID: AQAAf9DxeMjazBxiKEAIAA--.10706S5 X-Coremail-Antispam: 1UD129KBjvJXoWxCF17tw4rKFW8Ar18GrWkXrb_yoWrXFyrpr 1xurWSkr48tF9rJFyfJr1ku345Jw1vkF4UGa42krn5Awn8Gr1UA348WFW7KFyaqryUJ3Wj qFs8tFyj9392kw7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBa14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JrWl82xGYIkIc2 x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0 Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Cr0_Gr1UM2 8EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AI xVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20x vE14v26r1j6r18McIj6I8E87Iv67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xv r2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxkIecxEwVAFwVW5GwCF04k20x vY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I 3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIx AIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAI cVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2js IEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUzbyAUUUUU= X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org According to Documentation/admin-guide/kernel-parameters.txt, the kernel command-line parameter memmap= means "Force usage of a specific region of memory", but when add "memmap=3G@64M" to the command-line, kernel boot hangs in sparse_init(). In order to support memmap=limit@base, refactor the function early_parse_memmap() and then use memblock_mem_range_remove_map() to limit the memory region. With this patch, when add "memmap=3G@64M" to the command-line, the kernel boots successfully, we can see the following messages: [ 0.000000] Memory limited to 64MB-3136MB ... [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000004000000-0x000000000effffff] [ 0.000000] node 0: [mem 0x0000000090200000-0x00000000ffffffff] [ 0.000000] node 0: [mem 0x0000000120000000-0x00000001653fffff] ... [ 0.000000] Memory: 3070816K/3147776K available (...) When add "memmap=128M@64M nr_cpus=1 init 3" to the command-line, the kernel also boots successfully, we can see the following messages: [ 0.000000] Memory limited to 64MB-192MB ... [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000004000000-0x000000000c1fffff] ... [ 0.000000] Memory: 95312K/133120K available (...) After login, the output of free command is consistent with the above log. Signed-off-by: Tiezhu Yang Reported-by: kernel test robot --- arch/mips/kernel/setup.c | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index 6b6d718..c940405 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -340,6 +340,7 @@ static void __init bootmem_init(void) static int usermem __initdata; static phys_addr_t memory_limit; +static phys_addr_t memory_base; static int __init early_parse_mem(char *p) { @@ -356,7 +357,6 @@ early_param("mem", early_parse_mem); static int __init early_parse_memmap(char *p) { char *oldp; - u64 start_at, mem_size; if (!p) return -EINVAL; @@ -367,30 +367,38 @@ static int __init early_parse_memmap(char *p) } oldp = p; - mem_size = memparse(p, &p); + memory_limit = memparse(p, &p) & PAGE_MASK; if (p == oldp) return -EINVAL; if (*p == '@') { - start_at = memparse(p+1, &p); - memblock_add(start_at, mem_size); + memory_base = memparse(p + 1, &p) & PAGE_MASK; + } else if (*p == '$') { + memory_base = memparse(p+1, &p) & PAGE_MASK; + memblock_reserve(memory_base, memory_limit); + pr_notice("Memory reserved to %lldMB-%lldMB\n", + memory_base >> 20, (memory_base + memory_limit) >> 20); + memory_base = 0; + memory_limit = 0; + return 0; } else if (*p == '#') { - pr_err("\"memmap=nn#ss\" (force ACPI data) invalid on MIPS\n"); + pr_err("\"memmap=nn#ss\" invalid on MIPS\n"); + memory_limit = 0; + return -EINVAL; + } else if (*p == '!') { + pr_err("\"memmap=nn!ss\" invalid on MIPS\n"); + memory_limit = 0; return -EINVAL; - } else if (*p == '$') { - start_at = memparse(p+1, &p); - memblock_add(start_at, mem_size); - memblock_reserve(start_at, mem_size); } else { - pr_err("\"memmap\" invalid format!\n"); + pr_err("Unrecognized memmap syntax: %s\n", p); + memory_limit = 0; return -EINVAL; } - if (*p == '\0') { - usermem = 1; - return 0; - } else - return -EINVAL; + pr_notice("Memory limited to %lldMB-%lldMB\n", + memory_base >> 20, (memory_base + memory_limit) >> 20); + + return *p == '\0' ? 0 : -EINVAL; } early_param("memmap", early_parse_memmap); @@ -667,7 +675,7 @@ static void __init arch_mem_init(char **cmdline_p) __pa_symbol(&__nosave_end) - __pa_symbol(&__nosave_begin)); /* Limit the memory. */ - memblock_enforce_memory_limit(memory_limit); + memblock_mem_range_remove_map(memory_base, memory_limit); memblock_allow_resize(); early_memtest(PFN_PHYS(ARCH_PFN_OFFSET), PFN_PHYS(max_low_pfn)); From patchwork Mon Feb 28 13:23:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiezhu Yang X-Patchwork-Id: 12763301 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FAA3C433F5 for ; Mon, 28 Feb 2022 13:23:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233037AbiB1NY2 (ORCPT ); Mon, 28 Feb 2022 08:24:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235712AbiB1NYZ (ORCPT ); Mon, 28 Feb 2022 08:24:25 -0500 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A217E26576; Mon, 28 Feb 2022 05:23:45 -0800 (PST) Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9DxeMjazBxiKEAIAA--.10706S6; Mon, 28 Feb 2022 21:23:39 +0800 (CST) From: Tiezhu Yang To: Thomas Bogendoerfer , Mike Rapoport , Andrew Morton Cc: Xuefeng Li , linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 4/4] MIPS: Remove not used variable usermem Date: Mon, 28 Feb 2022 21:23:37 +0800 Message-Id: <1646054617-16799-5-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1646054617-16799-1-git-send-email-yangtiezhu@loongson.cn> References: <1646054617-16799-1-git-send-email-yangtiezhu@loongson.cn> X-CM-TRANSID: AQAAf9DxeMjazBxiKEAIAA--.10706S6 X-Coremail-Antispam: 1UD129KBjvdXoW7XFW7Xw4kJr48CryfXr1rtFb_yoWfJFb_tr 47tF4kZr15Z3Wj9rWDXw4fWFWIyan2qFZa9wnYv3yayw15Jr1UurWYyF9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vger.kernel.org Now, the variable usermem is not used any more, just remove it. Signed-off-by: Tiezhu Yang --- arch/mips/kernel/setup.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index c940405..89fdaae 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -338,7 +338,6 @@ static void __init bootmem_init(void) #endif /* CONFIG_SGI_IP27 */ -static int usermem __initdata; static phys_addr_t memory_limit; static phys_addr_t memory_base; @@ -628,10 +627,6 @@ static void __init arch_mem_init(char **cmdline_p) *cmdline_p = command_line; parse_early_param(); - - if (usermem) - pr_info("User-defined physical RAM map overwrite\n"); - check_kernel_sections_mem(); early_init_fdt_reserve_self();