From: Dan Williams <dan.j.williams@intel.com>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, keescook@chromium.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] [-mm only] mm/shuffle: Default enable all shuffling
Date: Tue, 05 Feb 2019 23:12:15 -0800 [thread overview]
Message-ID: <154943713572.3858443.11206307988382889377.stgit@dwillia2-desk3.amr.corp.intel.com> (raw)
In-Reply-To: <154943712485.3858443.4491117952728936852.stgit@dwillia2-desk3.amr.corp.intel.com>
Per Andrew's request arrange for all memory allocation shuffling code to
be enabled by default.
The page_alloc.shuffle command line parameter can still be used to
disable shuffling at boot, but the kernel will default enable the
shuffling if the command line option is not specified.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
init/Kconfig | 4 ++--
mm/shuffle.c | 4 ++--
mm/shuffle.h | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/init/Kconfig b/init/Kconfig
index cfa199f3e9be..12557e12be4c 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1697,7 +1697,7 @@ config SLAB_MERGE_DEFAULT
command line.
config SLAB_FREELIST_RANDOM
- default n
+ default y
depends on SLAB || SLUB
bool "SLAB freelist randomization"
help
@@ -1716,7 +1716,7 @@ config SLAB_FREELIST_HARDENED
config SHUFFLE_PAGE_ALLOCATOR
bool "Page allocator randomization"
- default SLAB_FREELIST_RANDOM && ACPI_NUMA
+ default y
help
Randomization of the page allocator improves the average
utilization of a direct-mapped memory-side-cache. See section
diff --git a/mm/shuffle.c b/mm/shuffle.c
index 3ce12481b1dc..a979b48be469 100644
--- a/mm/shuffle.c
+++ b/mm/shuffle.c
@@ -9,8 +9,8 @@
#include "internal.h"
#include "shuffle.h"
-DEFINE_STATIC_KEY_FALSE(page_alloc_shuffle_key);
-static unsigned long shuffle_state __ro_after_init;
+DEFINE_STATIC_KEY_TRUE(page_alloc_shuffle_key);
+static unsigned long shuffle_state __ro_after_init = 1 << SHUFFLE_ENABLE;
/*
* Depending on the architecture, module parameter parsing may run
diff --git a/mm/shuffle.h b/mm/shuffle.h
index fc1e327ae22d..466a5620e0aa 100644
--- a/mm/shuffle.h
+++ b/mm/shuffle.h
@@ -19,7 +19,7 @@ enum mm_shuffle_ctl {
#define SHUFFLE_ORDER (MAX_ORDER-1)
#ifdef CONFIG_SHUFFLE_PAGE_ALLOCATOR
-DECLARE_STATIC_KEY_FALSE(page_alloc_shuffle_key);
+DECLARE_STATIC_KEY_TRUE(page_alloc_shuffle_key);
extern void page_alloc_shuffle(enum mm_shuffle_ctl ctl);
extern void __shuffle_free_memory(pg_data_t *pgdat);
static inline void shuffle_free_memory(pg_data_t *pgdat)
prev parent reply other threads:[~2019-02-06 7:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-06 7:12 [PATCH 0/2] mm/shuffle: Fix + default enable Dan Williams
2019-02-06 7:12 ` [PATCH 1/2] mm/shuffle: Fix shuffle enable Dan Williams
2019-02-06 7:12 ` Dan Williams [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=154943713572.3858443.11206307988382889377.stgit@dwillia2-desk3.amr.corp.intel.com \
--to=dan.j.williams@intel.com \
--cc=akpm@linux-foundation.org \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).