linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: David Hildenbrand <david@redhat.com>,
	Matthew Wilcox <willy@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Alexander Duyck <alexander.h.duyck@linux.intel.com>,
	Mel Gorman <mgorman@techsingularity.net>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Andrea Arcangeli <aarcange@redhat.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Dave Hansen <dave.hansen@intel.com>,
	Michal Hocko <mhocko@kernel.org>,
	Alex Williamson <alex.williamson@redhat.com>
Subject: Re: [RFC PATCH 4/4] mm: Add PG_zero support
Date: Fri, 24 Apr 2020 09:55:29 +0200	[thread overview]
Message-ID: <09885eda-9772-4228-dece-3dfd42840580@suse.cz> (raw)
In-Reply-To: <d15623f5-5c89-b9e5-1787-61ad70519774@redhat.com>

On 4/24/20 9:28 AM, David Hildenbrand wrote:
> On 24.04.20 02:41, Matthew Wilcox wrote:
>> On Thu, Apr 23, 2020 at 05:37:00PM -0700, Andrew Morton wrote:
>>> On Wed, 22 Apr 2020 16:09:00 +0200 Vlastimil Babka <vbabka@suse.cz> wrote:
>>>> Heh, I was quite sure that this is not the first time background zeroing is
>>>> proposed, so I went to google for it... and found that one BSD kernel actually
>>>> removed this functionality in 2016 [1] and this was one of the reasons.
>>>>
>>>> [1]
>>>> https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/afd2da4dc9056ea79cdf15e8a9386a3d3998f33e
>>>
>>> Interesting.
>>>
>>> However this:
>>>
>>>   - Pre-zeroing a page leads to a cold-cache case on-use, forcing the fault
>>>     source (e.g. a userland program) to actually get the data from main
>>>     memory in its likely immediate use of the faulted page, reducing
>>>     performance.
>>>
>>> implies that BSD was zeroing with non-temporal stores which bypass the
>>> CPU cache.  And which presumably invalidate any part of the target
>>> memory which was already in cache.  We wouldn't do it that way so
>>> perhaps the results would differ.
>> 
>> Or just that the page was zeroed far enough in advance that it fell out
>> of cache naturally.

Agreed.

>> I know Arjan looked at zeroing on free instead of zeroing on alloc,
>> and that didn't get merged (or even submitted afaik), so presumably the
>> results weren't good.
> 
> We do have INIT_ON_FREE_DEFAULT_ON
> 
> via
> 
> commit 6471384af2a6530696fc0203bafe4de41a23c9ef
> Author: Alexander Potapenko <glider@google.com>
> Date:   Thu Jul 11 20:59:19 2019 -0700
> 
>     mm: security: introduce init_on_alloc=1 and init_on_free=1 boot options
> 
> which seems to do exactly that (although for a different use case)

Yeah, except the security use case wants to do that immediately, while the
proposal here is a background thread.


  reply	other threads:[~2020-04-24  7:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-12  9:09 [RFC PATCH 4/4] mm: Add PG_zero support liliangleo
2020-04-12 10:12 ` Matthew Wilcox
2020-04-13 15:11   ` Alexander Duyck
2020-04-13 21:05     ` Andrew Morton
2020-04-22 14:09       ` Vlastimil Babka
2020-04-24  0:37         ` Andrew Morton
2020-04-24  0:41           ` Matthew Wilcox
2020-04-24  7:28             ` David Hildenbrand
2020-04-24  7:55               ` Vlastimil Babka [this message]
2020-04-24  7:57                 ` David Hildenbrand
2020-04-15  5:15 ` [mm] 5ae8a9d7c8: will-it-scale.per_thread_ops -2.1% regression kernel test robot

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=09885eda-9772-4228-dece-3dfd42840580@suse.cz \
    --to=vbabka@suse.cz \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex.williamson@redhat.com \
    --cc=alexander.h.duyck@linux.intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@kernel.org \
    --cc=willy@infradead.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).