linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yang Shi <yang.shi@linux.alibaba.com>
To: emunson@akamai.com, "linux-mm@kvack.org" <linux-mm@kvack.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: [QUESTION] About VM_LOCKONFAULT for file page
Date: Mon, 4 Jun 2018 11:55:56 -0700	[thread overview]
Message-ID: <aff10e88-8755-b163-8965-3f8065c0c971@linux.alibaba.com> (raw)

Hi folks,


I did a quick test with mlock2 + VM_LOCKONFAULT flag. The test just does 
an 1MB anonymous map and 1MB file map with VM_LOCKONFAULT respectively. 
Then it tries to access one page of each mapping.


 From /proc/meminfo, I can see 1 page marked mlocked from anonymous 
mapping. But, the page from file mapping is *not* marked as mlocked.


I can see the do_anonymous_page() calls 
lru_cache_add_active_or_unevictable() to set the page's PG_mlocked flag. 
But, do_read_fault()/do_shared_fault()/do_cow_fault() don't do it, it 
looks they just do it for COW page.


I'm a little bit confused. Does VM_LOCKONFAULT work for anonymous map 
only? Or did I miss something? Any hint is appreciated.


Thanks,

Yang

                 reply	other threads:[~2018-06-04 18:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=aff10e88-8755-b163-8965-3f8065c0c971@linux.alibaba.com \
    --to=yang.shi@linux.alibaba.com \
    --cc=emunson@akamai.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