From patchwork Mon Jul 2 02:48:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 10500363 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 89FCA60284 for ; Mon, 2 Jul 2018 02:48:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76711288BC for ; Mon, 2 Jul 2018 02:48:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A8AF288C3; Mon, 2 Jul 2018 02:48:43 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID 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 A41A0288BC for ; Mon, 2 Jul 2018 02:48:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BC7F06B000D; Sun, 1 Jul 2018 22:48:41 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B75586B000E; Sun, 1 Jul 2018 22:48: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 A669F6B0010; Sun, 1 Jul 2018 22:48:41 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f71.google.com (mail-pl0-f71.google.com [209.85.160.71]) by kanga.kvack.org (Postfix) with ESMTP id 650A86B000D for ; Sun, 1 Jul 2018 22:48:41 -0400 (EDT) Received: by mail-pl0-f71.google.com with SMTP id x2-v6so9103788plv.0 for ; Sun, 01 Jul 2018 19:48:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:to:from:subject:message-id:date :user-agent:mime-version:content-language:content-transfer-encoding; bh=YPmY+4W/Im7B4FIrSYU1YENE0GzKHJQbWBkrMIZr8fU=; b=es8XfUgLB+e+eRZn0bwW+aKSCru81sDQuNiHPW80apVKP07d2znhpHKlChhu3HvG62 D8UWgB3d/cx+di7hGx9ZiQvNKrVvhaTFJfDMBuGyj3p2VmPq4v9eVMhWZ/KdKRk7Tqlv 8EHotANsX7jnjL5te0AR/hYcy50wrta2Zln5tdsbUkjcvGrPQFU1+fmMoQzmIw7AhhHh pEelxUUxUNxaUDfLKMxmpuASsh+Ox+oxWLZFUYiiSpxwNCpBlOJByP8xqsQkveDlb3am AZXbaJ3e1bAcU5Lk/pIwfvsW3Xk+h0mioSj0FsCwDp4I96krceUMaJWsNlTTpr1028+U MKag== X-Gm-Message-State: APt69E1fbEgJe2nKShmCK/SdcEWjIcv61qE20xzD94FiX7vqI27QRFRB L6wK3WXouh2ChSZgCYFZRrwwOxNEwzyAuA5mHXydZCJz8VFxypz7ROABi8GI8KdGec9f5GpRp5C xO3KPJ3deAkvpFS5vdGWgezns+aj1mKTc+kdVKTU8UssjvBDqyoDjAs53aA18bSl52A== X-Received: by 2002:a62:b94:: with SMTP id 20-v6mr23075425pfl.234.1530499721057; Sun, 01 Jul 2018 19:48:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc9Q9r78grxB9pG0VvCwxptThwqD7aLtO9oNlMIu3wdB6hGDUonxvPYI8IThYMrtMxxChe2 X-Received: by 2002:a62:b94:: with SMTP id 20-v6mr23075377pfl.234.1530499719856; Sun, 01 Jul 2018 19:48:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530499719; cv=none; d=google.com; s=arc-20160816; b=GWyjSTw90DlD1L4c77tVv5MxXk/djNAe+sKUxRBVdf9TpQgbgQ0fljLgeidsfaGxvD Mc+/kK7d/hBDczvwAEcWdOndQwcwebDtnvv3z3Y/xGwqa732Sy+QRoAzilkMVyAGTZQX qA8GjKmrvIEXP1WrDePjNkCxQyEGJEdP3C254OXSQavm1F/pchc6gNNL8DVYm/1MRlN8 e/LhMvkXje1m9mIoZR6RziRwAVCaDA6HJk3Qpx2+MBz94Zy8Wm46tULLwKVhqFBMQQsE HdQvOPk8WgetQM2d0NyKkRLrftgPlbpC7QuNUt6kUq2hyZL6vRUTJ11BS6z9qrnPVv71 pjCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:mime-version:user-agent :date:message-id:subject:from:to:dkim-signature :arc-authentication-results; bh=YPmY+4W/Im7B4FIrSYU1YENE0GzKHJQbWBkrMIZr8fU=; b=teLpXdJvI/XLtz41InYqWT+KLozFkixL24brnAQX3Bo8DdGHsblG8Jma6+UcMMMQ2H IP8FZvXK8g9biQEqMEIHT4T1d5+bp+k9//tyqgKePVyjhiJPUF9KzB9t7ijIa2D3JxnA QAG9zBBEFzpXqMgB+5hPCbTuM82aWASh8iwSdkFfyD7ifPudlfJkyTrAQiFJadW4K1fl Qx3sa4Q22nAwNUR7thnDTD+lczWB4p7UOnnmW00cqB2QpK6wsHbvJj/2EBYXrE52+N8Y DaIC3S2hPwrPJZBdu1r7Mbw06peTJNJMaU2rFYbwtYOTplYkSSuitFWu/cArJuhqCkqA j+Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=oRgCL8Ap; spf=pass (google.com: best guess record for domain of rdunlap@infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=rdunlap@infradead.org Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id s65-v6si13637228pgb.486.2018.07.01.19.48.39 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 01 Jul 2018 19:48:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of rdunlap@infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=oRgCL8Ap; spf=pass (google.com: best guess record for domain of rdunlap@infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=rdunlap@infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:MIME-Version:Date:Message-ID:Subject:From:To:Sender:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=YPmY+4W/Im7B4FIrSYU1YENE0GzKHJQbWBkrMIZr8fU=; b=oRgCL8AprQuz/3HLzVkizoOcp VL8nZsNdoRmRn2pbrGvRK/0EoEPXF4iUrFzpwi2OFWui5RHIuIqgbnBHx46/NSLdXo+Iy+Gbawz9W LCePychuSxIYdWmtx1ss2so42skD5KK47n9ia9QSKrl5uegvzFtYeAq86aTiJMZ4QOc29HlifChHu mkBASIaumpPmKikgTcFPzVtZJ7zEK1R+WtWzEzhjfrkAB7aEU0GBcn9Cy2ApnKQfDiUn5aX/RsPQl G5wEAo5bTLSWsWmJvG+vqfmO+MyegJdv1pwD9iWm/MDSGEKb8+SfOXmg6COqXbbG9m2AUSf8JkSfy HOTGPQwzg==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=dragon.dunlab) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fZotL-00016E-8Z; Mon, 02 Jul 2018 02:48:39 +0000 To: LKML , Linux MM , X86 ML From: Randy Dunlap Subject: [PATCH] x86: make Memory Management options more visible Message-ID: Date: Sun, 1 Jul 2018 19:48:38 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 Content-Language: en-US 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 From: Randy Dunlap Currently for x86, the "Memory Management" kconfig options are displayed under "Processor type and features." This tends to make them hidden or difficult to find. This patch makes Memory Managment options a first-class menu by moving it away from "Processor type and features" and into the main menu. Also clarify "endmenu" lines with '#' comments of their respective menu names, just to help people who are reading or editing the Kconfig file. Signed-off-by: Randy Dunlap Acked-by: Ingo Molnar --- arch/x86/Kconfig | 186 ++++++++++++++++++++++----------------------- 1 file changed, 95 insertions(+), 91 deletions(-) --- lnx-418-rc3.orig/arch/x86/Kconfig +++ lnx-418-rc3/arch/x86/Kconfig @@ -1638,93 +1638,6 @@ config ILLEGAL_POINTER_VALUE default 0 if X86_32 default 0xdead000000000000 if X86_64 -source "mm/Kconfig" - -config X86_PMEM_LEGACY_DEVICE - bool - -config X86_PMEM_LEGACY - tristate "Support non-standard NVDIMMs and ADR protected memory" - depends on PHYS_ADDR_T_64BIT - depends on BLK_DEV - select X86_PMEM_LEGACY_DEVICE - select LIBNVDIMM - help - Treat memory marked using the non-standard e820 type of 12 as used - by the Intel Sandy Bridge-EP reference BIOS as protected memory. - The kernel will offer these regions to the 'pmem' driver so - they can be used for persistent storage. - - Say Y if unsure. - -config HIGHPTE - bool "Allocate 3rd-level pagetables from highmem" - depends on HIGHMEM - ---help--- - The VM uses one page table entry for each page of physical memory. - For systems with a lot of RAM, this can be wasteful of precious - low memory. Setting this option will put user-space page table - entries in high memory. - -config X86_CHECK_BIOS_CORRUPTION - bool "Check for low memory corruption" - ---help--- - Periodically check for memory corruption in low memory, which - is suspected to be caused by BIOS. Even when enabled in the - configuration, it is disabled at runtime. Enable it by - setting "memory_corruption_check=1" on the kernel command - line. By default it scans the low 64k of memory every 60 - seconds; see the memory_corruption_check_size and - memory_corruption_check_period parameters in - Documentation/admin-guide/kernel-parameters.rst to adjust this. - - When enabled with the default parameters, this option has - almost no overhead, as it reserves a relatively small amount - of memory and scans it infrequently. It both detects corruption - and prevents it from affecting the running system. - - It is, however, intended as a diagnostic tool; if repeatable - BIOS-originated corruption always affects the same memory, - you can use memmap= to prevent the kernel from using that - memory. - -config X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK - bool "Set the default setting of memory_corruption_check" - depends on X86_CHECK_BIOS_CORRUPTION - default y - ---help--- - Set whether the default state of memory_corruption_check is - on or off. - -config X86_RESERVE_LOW - int "Amount of low memory, in kilobytes, to reserve for the BIOS" - default 64 - range 4 640 - ---help--- - Specify the amount of low memory to reserve for the BIOS. - - The first page contains BIOS data structures that the kernel - must not use, so that page must always be reserved. - - By default we reserve the first 64K of physical RAM, as a - number of BIOSes are known to corrupt that memory range - during events such as suspend/resume or monitor cable - insertion, so it must not be used by the kernel. - - You can set this to 4 if you are absolutely sure that you - trust the BIOS to get all its memory reservations and usages - right. If you know your BIOS have problems beyond the - default 64K area, you can set this to 640 to avoid using the - entire low memory range. - - If you have doubts about the BIOS (e.g. suspend/resume does - not work or there's kernel crashes after certain hardware - hotplug events) then you might want to enable - X86_CHECK_BIOS_CORRUPTION=y to allow the kernel to check - typical corruption patterns. - - Leave this to the default value of 64 if you are unsure. - config MATH_EMULATION bool depends on MODIFY_LDT_SYSCALL @@ -2392,7 +2305,98 @@ config MODIFY_LDT_SYSCALL source "kernel/livepatch/Kconfig" -endmenu +endmenu # Processor type and features + +menu "Memory Management options" + +source "mm/Kconfig" + +config X86_PMEM_LEGACY_DEVICE + bool + +config X86_PMEM_LEGACY + tristate "Support non-standard NVDIMMs and ADR protected memory" + depends on PHYS_ADDR_T_64BIT + depends on BLK_DEV + select X86_PMEM_LEGACY_DEVICE + select LIBNVDIMM + help + Treat memory marked using the non-standard e820 type of 12 as used + by the Intel Sandy Bridge-EP reference BIOS as protected memory. + The kernel will offer these regions to the 'pmem' driver so + they can be used for persistent storage. + + Say Y if unsure. + +config HIGHPTE + bool "Allocate 3rd-level pagetables from highmem" + depends on HIGHMEM + ---help--- + The VM uses one page table entry for each page of physical memory. + For systems with a lot of RAM, this can be wasteful of precious + low memory. Setting this option will put user-space page table + entries in high memory. + +config X86_CHECK_BIOS_CORRUPTION + bool "Check for low memory corruption" + ---help--- + Periodically check for memory corruption in low memory, which + is suspected to be caused by BIOS. Even when enabled in the + configuration, it is disabled at runtime. Enable it by + setting "memory_corruption_check=1" on the kernel command + line. By default it scans the low 64k of memory every 60 + seconds; see the memory_corruption_check_size and + memory_corruption_check_period parameters in + Documentation/admin-guide/kernel-parameters.rst to adjust this. + + When enabled with the default parameters, this option has + almost no overhead, as it reserves a relatively small amount + of memory and scans it infrequently. It both detects corruption + and prevents it from affecting the running system. + + It is, however, intended as a diagnostic tool; if repeatable + BIOS-originated corruption always affects the same memory, + you can use memmap= to prevent the kernel from using that + memory. + +config X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK + bool "Set the default setting of memory_corruption_check" + depends on X86_CHECK_BIOS_CORRUPTION + default y + ---help--- + Set whether the default state of memory_corruption_check is + on or off. + +config X86_RESERVE_LOW + int "Amount of low memory, in kilobytes, to reserve for the BIOS" + default 64 + range 4 640 + ---help--- + Specify the amount of low memory to reserve for the BIOS. + + The first page contains BIOS data structures that the kernel + must not use, so that page must always be reserved. + + By default we reserve the first 64K of physical RAM, as a + number of BIOSes are known to corrupt that memory range + during events such as suspend/resume or monitor cable + insertion, so it must not be used by the kernel. + + You can set this to 4 if you are absolutely sure that you + trust the BIOS to get all its memory reservations and usages + right. If you know your BIOS have problems beyond the + default 64K area, you can set this to 640 to avoid using the + entire low memory range. + + If you have doubts about the BIOS (e.g. suspend/resume does + not work or there's kernel crashes after certain hardware + hotplug events) then you might want to enable + X86_CHECK_BIOS_CORRUPTION=y to allow the kernel to check + typical corruption patterns. + + Leave this to the default value of 64 if you are unsure. + +endmenu # MM options config ARCH_HAS_ADD_PAGES def_bool y @@ -2566,7 +2570,7 @@ source "drivers/cpuidle/Kconfig" source "drivers/idle/Kconfig" -endmenu +endmenu # Power management and ACPI options menu "Bus options (PCI etc.)" @@ -2862,7 +2866,7 @@ config X86_SYSFB If unsure, say Y. -endmenu +endmenu # Bus options menu "Executable file formats / Emulations" @@ -2919,7 +2923,7 @@ config SYSVIPC_COMPAT depends on SYSVIPC endif -endmenu +endmenu # Executable file formats config HAVE_ATOMIC_IOMAP