linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Michal Hocko <mhocko@suse.com>, Kees Cook <keescook@chromium.org>,
	Linux MM <linux-mm@kvack.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Keith Busch <keith.busch@intel.com>
Subject: Re: [PATCH v10 1/3] mm: Shuffle initial free memory to improve memory-side-cache utilization
Date: Fri, 31 May 2019 07:59:28 -0700	[thread overview]
Message-ID: <CAPcyv4g-g=Gyf0T1rENCEH_2KyLtt74kiLydxO=__tM71_bYww@mail.gmail.com> (raw)
In-Reply-To: <cddd43de-62f6-6a91-83aa-da02ff17254d@suse.cz>

On Fri, May 31, 2019 at 12:33 AM Vlastimil Babka <vbabka@suse.cz> wrote:
>
> On 2/1/19 6:15 AM, Dan Williams wrote:
> > --- a/init/Kconfig
> > +++ b/init/Kconfig
> > @@ -1714,6 +1714,29 @@ config SLAB_FREELIST_HARDENED
> >         sacrifies to harden the kernel slab allocator against common
> >         freelist exploit methods.
> >
> > +config SHUFFLE_PAGE_ALLOCATOR
> > +     bool "Page allocator randomization"
> > +     default SLAB_FREELIST_RANDOM && ACPI_NUMA
> > +     help
> > +       Randomization of the page allocator improves the average
> > +       utilization of a direct-mapped memory-side-cache. See section
> > +       5.2.27 Heterogeneous Memory Attribute Table (HMAT) in the ACPI
> > +       6.2a specification for an example of how a platform advertises
> > +       the presence of a memory-side-cache. There are also incidental
> > +       security benefits as it reduces the predictability of page
> > +       allocations to compliment SLAB_FREELIST_RANDOM, but the
> > +       default granularity of shuffling on 4MB (MAX_ORDER) pages is
> > +       selected based on cache utilization benefits.
> > +
> > +       While the randomization improves cache utilization it may
> > +       negatively impact workloads on platforms without a cache. For
> > +       this reason, by default, the randomization is enabled only
> > +       after runtime detection of a direct-mapped memory-side-cache.
> > +       Otherwise, the randomization may be force enabled with the
> > +       'page_alloc.shuffle' kernel command line parameter.
> > +
> > +       Say Y if unsure.
>
> It says "Say Y if unsure", yet if I run make oldconfig, the default is
> N. Does that make sense?

The default is due to the general policy of not forcing users into new
kernel functionality (i.e. the common Linus objection when a new
config symbol is default 'y') . However, if someone is actively
considering whether to enable it I think there's no harm in
recommending 'y' because the facility currently needs to be paired
with the page_alloc.shuffle=1 command line option.

  reply	other threads:[~2019-05-31 14:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-01  5:15 [PATCH v10 0/3] mm: Randomize free memory Dan Williams
2019-02-01  5:15 ` [PATCH v10 1/3] mm: Shuffle initial free memory to improve memory-side-cache utilization Dan Williams
2019-02-05 22:04   ` Andrew Morton
2019-02-05 23:11     ` Kees Cook
2019-02-05 23:29       ` Matthew Wilcox
2019-05-31  7:33   ` Vlastimil Babka
2019-05-31 14:59     ` Dan Williams [this message]
2019-02-01  5:15 ` [PATCH v10 2/3] mm: Move buddy list manipulations into helpers Dan Williams
2019-02-19 15:24   ` Vlastimil Babka
2019-02-19 17:21     ` Dan Williams
2019-02-01  5:15 ` [PATCH v10 3/3] mm: Maintain randomization of page free lists Dan Williams
2019-02-01  9:58   ` Michal Hocko

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='CAPcyv4g-g=Gyf0T1rENCEH_2KyLtt74kiLydxO=__tM71_bYww@mail.gmail.com' \
    --to=dan.j.williams@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=keescook@chromium.org \
    --cc=keith.busch@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=vbabka@suse.cz \
    --subject='Re: [PATCH v10 1/3] mm: Shuffle initial free memory to improve memory-side-cache utilization' \
    /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

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).