linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Guilherme Piccoli <gpiccoli@canonical.com>
To: David Hildenbrand <david@redhat.com>
Cc: Michal Hocko <mhocko@suse.com>,
	Mike Kravetz <mike.kravetz@oracle.com>,
	linux-mm@kvack.org,  kernel-hardening@lists.openwall.com,
	linux-hardening@vger.kernel.org,
	 linux-security-module@vger.kernel.org,
	 "Guilherme G. Piccoli" <kernel@gpiccoli.net>,
	 Thadeu Lima de Souza Cascardo <cascardo@canonical.com>,
	Alexander Potapenko <glider@google.com>,
	 James Morris <jamorris@linux.microsoft.com>,
	Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH] mm, hugetlb: Avoid double clearing for hugetlb pages
Date: Tue, 20 Oct 2020 17:19:42 -0300	[thread overview]
Message-ID: <CAHD1Q_wQrnSEGOvbCi0uhHZ5bRf=inzPdOhGKJ9PkVms5GSWRA@mail.gmail.com> (raw)
In-Reply-To: <5650dc95-4ae2-05d3-c71a-3828d35bd49b@redhat.com>

When I first wrote that, the design was a bit different, the flag was
called __GFP_HTLB_PAGE or something like that. The design was to
signal/mark the composing pages of hugetlb as exactly this: they are
pages composing a huge page of hugetlb "type". Then, I skipped the
"init_on_alloc" thing for such pages.

If your concern is more about semantics (or giving multiple users,
like drivers, the power to try "optimize" their code and skip this
security feature), I think my first approach was better! This way, the
flag would be restricted to hugetlb usage only.
I've changed my mind about that approach before submitting for 2 reasons:

(a) It feels a waste of resources having a GFP flag *only* to signal
regular pages composing hugetlb pages, it's a single user only,
forever!
(b) Having 2 conditional settings on __GFP_BITS_SHIFT (LOCKDEP and
HUGETLB) started to make this define a bit tricky to code, since we'd
have 2 Kconfig-conditional bits to be set.

So, I've moved to this other approach, hereby submitted.
Cheers,


Guilherme


  reply	other threads:[~2020-10-20 20:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19 18:28 [PATCH] mm, hugetlb: Avoid double clearing for hugetlb pages Guilherme G. Piccoli
2020-10-20  8:20 ` Michal Hocko
2020-10-20 13:36   ` David Hildenbrand
2020-10-20 16:55   ` Mike Kravetz
2020-10-20 19:19   ` Guilherme G. Piccoli
2020-10-20 20:07     ` David Hildenbrand
2020-10-20 20:19       ` Guilherme Piccoli [this message]
2020-10-21  6:25         ` Michal Hocko
2020-10-20 20:28       ` David Hildenbrand
2020-10-21  6:15     ` Michal Hocko
2020-10-21  9:50       ` David Hildenbrand
2020-10-21 11:31         ` Michal Hocko
2020-10-21 23:32           ` Mike Kravetz
2020-10-22  8:04             ` David Hildenbrand
2020-10-22  8:55               ` Michal Hocko
2020-10-23  8:23                 ` David Hildenbrand
2020-11-05 19:37 ` Guilherme G. Piccoli

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='CAHD1Q_wQrnSEGOvbCi0uhHZ5bRf=inzPdOhGKJ9PkVms5GSWRA@mail.gmail.com' \
    --to=gpiccoli@canonical.com \
    --cc=cascardo@canonical.com \
    --cc=david@redhat.com \
    --cc=glider@google.com \
    --cc=jamorris@linux.microsoft.com \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=kernel@gpiccoli.net \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mhocko@suse.com \
    --cc=mike.kravetz@oracle.com \
    /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).