[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200424004152.GD13910@bombadil.infradead.org>
Date: Thu, 23 Apr 2020 17:41:52 -0700
From: Matthew Wilcox <willy@...radead.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Vlastimil Babka <vbabka@...e.cz>,
Alexander Duyck <alexander.h.duyck@...ux.intel.com>,
Mel Gorman <mgorman@...hsingularity.net>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Andrea Arcangeli <aarcange@...hat.com>,
Dan Williams <dan.j.williams@...el.com>,
Dave Hansen <dave.hansen@...el.com>,
David Hildenbrand <david@...hat.com>,
Michal Hocko <mhocko@...nel.org>,
Alex Williamson <alex.williamson@...hat.com>
Subject: Re: [RFC PATCH 4/4] mm: Add PG_zero support
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@...e.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.
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.
When I was at Microsoft, there was a usecase that made sense, and that
was virtualisation. If the hypervisor has zeroed the page before giving
it to the guest, then there's no need for the guest to zero it again.
It's already cache hot, and can be given straight to userspace.
Powered by blists - more mailing lists