From: David Hildenbrand <david@redhat.com>
To: Peter Collingbourne <pcc@google.com>
Cc: John Hubbard <jhubbard@nvidia.com>,
Matthew Wilcox <willy@infradead.org>,
"Kirill A . Shutemov" <kirill@shutemov.name>,
Andrew Morton <akpm@linux-foundation.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Evgenii Stepanov <eugenis@google.com>,
Michal Hocko <mhocko@kernel.org>, Jann Horn <jannh@google.com>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
Linux Memory Management List <linux-mm@kvack.org>,
kernel test robot <lkp@intel.com>,
Linux API <linux-api@vger.kernel.org>,
linux-doc@vger.kernel.org
Subject: Re: [PATCH v4] mm: introduce reference pages
Date: Tue, 20 Jul 2021 09:28:31 +0200 [thread overview]
Message-ID: <0345cd7b-0196-1c67-6b6c-a5638a66171b@redhat.com> (raw)
In-Reply-To: <CAMn1gO529Ua1LJBM=vdwT8Cz+CXSvJcuGhuqotSuiUyjTBDfAQ@mail.gmail.com>
>>> --- a/include/linux/gfp.h
>>> +++ b/include/linux/gfp.h
>>> @@ -55,8 +55,9 @@ struct vm_area_struct;
>>> #define ___GFP_ACCOUNT 0x400000u
>>> #define ___GFP_ZEROTAGS 0x800000u
>>> #define ___GFP_SKIP_KASAN_POISON 0x1000000u
>>> +#define ___GFP_NOZERO 0x2000000u
>>
>> Oh god, please no. We've discussed this a couple of times already:
>> whatever leaves the page allcoator shall be zeroed. No exceptions, not
>> even for other allocators (like hugetlb).
>>
>> Introducing something like that to the whole system, including random
>> drivers, destroys the whole purpose of the security feature. Please
>> don't burry something so controversial in your patch.
>
> Got it -- I was unaware that this was controversial.
>
> Avoiding the double initialization does help a bit in benchmarks, at
> least for the fully faulted case. The alternative approach that I was
> thinking of was to somehow plumb the required pattern into the page
> allocator (which would maintain the invariant that the pages are
> initialized, but not necessarily with zeroes), but this would require
> touching several layers of the allocator. I suppose that this doesn't
> need to be done immediately though -- we can deal with the double
> initialization for now and avoid it somehow in a followup.
As it's a clear optimization, it should definitely be separated from
this "introduction" patch.
I agree that the logic for optimizing initialization of a page in this
case should best reside in page_alloc.c, for example providing a helper
for optimizing the initialization in there. We already pass alloc_flags
internally, maybe we can then reuse that to minimize changes.
--
Thanks,
David / dhildenb
prev parent reply other threads:[~2021-07-20 7:28 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-19 9:20 [PATCH v4] mm: introduce reference pages Peter Collingbourne
2021-06-28 12:24 ` Kirill A. Shutemov
2021-07-17 2:58 ` Peter Collingbourne
2021-06-28 13:10 ` Matthew Wilcox
2021-07-17 2:58 ` Peter Collingbourne
2021-06-28 19:33 ` Matthew Wilcox
2021-06-28 19:44 ` John Hubbard
2021-06-28 19:56 ` Matthew Wilcox
2021-07-17 2:58 ` Peter Collingbourne
2021-06-29 7:19 ` John Hubbard
2021-06-29 11:58 ` Matthew Wilcox
2021-06-29 17:48 ` John Hubbard
2021-06-29 18:21 ` Matthew Wilcox
2021-06-29 18:28 ` John Hubbard
2021-07-17 2:59 ` Peter Collingbourne
2021-07-19 20:47 ` David Hildenbrand
2021-07-19 20:50 ` David Hildenbrand
2021-07-19 22:26 ` Peter Collingbourne
2021-07-19 22:30 ` John Hubbard
2021-07-20 7:28 ` David Hildenbrand [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=0345cd7b-0196-1c67-6b6c-a5638a66171b@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=catalin.marinas@arm.com \
--cc=eugenis@google.com \
--cc=jannh@google.com \
--cc=jhubbard@nvidia.com \
--cc=kirill@shutemov.name \
--cc=linux-api@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=mhocko@kernel.org \
--cc=pcc@google.com \
--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).