lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200423173700.b2c954b3960e4379a4f82e80@linux-foundation.org>
Date:   Thu, 23 Apr 2020 17:37:00 -0700
From:   Andrew Morton <akpm@...ux-foundation.org>
To:     Vlastimil Babka <vbabka@...e.cz>
Cc:     Alexander Duyck <alexander.h.duyck@...ux.intel.com>,
        Matthew Wilcox <willy@...radead.org>,
        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 Wed, 22 Apr 2020 16:09:00 +0200 Vlastimil Babka <vbabka@...e.cz> wrote:

> On 4/13/20 11:05 PM, Andrew Morton wrote:
> > On Mon, 13 Apr 2020 08:11:59 -0700 Alexander Duyck <alexander.h.duyck@...ux.intel.com> wrote:
> > 
> >> In addition, unlike madvising the page away there is a pretty 
> >> significant performance penalty for having to clear the page a second 
> >> time when the page is split or merged.
> > 
> > I wonder if there might be an issue with increased memory traffic (and
> > increased energy consumption, etc).  If a page is zeroed immediately
> > before getting data written into it (eg, plain old file write(),
> > anonymous pagefault) then we can expect that those 4096 zeroes will be
> > in CPU cache and mostly not written back.  But if that page was zeroed
> > a "long" time ago, the caches will probably have been written back. 
> > Net result: we go from 4k of memory traffic for a 4k page up to 8k of
> > memory traffic?
> 
> 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.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ