linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
To: Hugh Dickins <hughd@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Josef Bacik <jbacik@fb.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/shmem: Zero out unused vma fields in shmem_pseudo_vma_init()
Date: Mon, 4 Jun 2018 14:32:36 +0300	[thread overview]
Message-ID: <20180604113236.oewgy7jb7frsawg5@black.fi.intel.com> (raw)
In-Reply-To: <alpine.LSU.2.11.1805311522380.13187@eggly.anvils>

On Thu, May 31, 2018 at 10:50:36PM +0000, Hugh Dickins wrote:
> On Thu, 31 May 2018, Kirill A. Shutemov wrote:
> 
> > shmem/tmpfs uses pseudo vma to allocate page with correct NUMA policy.
> > 
> > The pseudo vma doesn't have vm_page_prot set. We are going to encode
> > encryption KeyID in vm_page_prot. Having garbage there causes problems.
> > 
> > Zero out all unused fields in the pseudo vma.
> > 
> > Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> 
> I won't go so far as to say NAK, but personally I much prefer that we
> document what fields actually get used, by initializing only those,
> rather than having such a blanket memset.

I recognize value of documentation here. But I still think leaving garbage
in the fields is not a great idea.

> 
> And you say "We are going to ...": so this should really be part of
> some future patchset, shouldn't it?

Yeah. It's for MKTME. I just try to push easy patches first.

> My opinion might be in the minority: you remind me of a similar
> request from Josef some while ago, Cc'ing him.
> 
> (I'm very ashamed, by the way, of shmem's pseudo-vma, I think it's
> horrid, and just reflects that shmem was an afterthought when NUMA
> mempolicies were designed.  Internally, we replaced alloc_pages_vma()
> throughout by alloc_pages_mpol(), which has no need for pseudo-vmas,
> and the advantage of dropping mmap_sem across the bulk of NUMA page
> migration. I shall be updating that work in coming months, and hope
> to upstream, but no promise from me on the timing - your need for
> vm_page_prot likely much sooner.)

I will try to look at how we can get alloc_pages_mpol() implemented.
(Although interleave bias is kinda confusing. I'll need to wrap my head
around the thing.)

-- 
 Kirill A. Shutemov

  reply	other threads:[~2018-06-04 11:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31 13:56 Kirill A. Shutemov
2018-05-31 22:50 ` Hugh Dickins
2018-06-04 11:32   ` Kirill A. Shutemov [this message]
2018-05-31 22:52 ` Andrew Morton
2018-05-31 23:37   ` Hugh Dickins

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=20180604113236.oewgy7jb7frsawg5@black.fi.intel.com \
    --to=kirill.shutemov@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=jbacik@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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