From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Dave Hansen <dave.hansen@intel.com>
Cc: linux-mm@kvack.org, tglx@linutronix.de
Subject: Re: Memory compaction and mlockall()
Date: Wed, 10 Jul 2019 18:45:21 +0200 [thread overview]
Message-ID: <20190710164521.vlcrrfovphd5fp7f@linutronix.de> (raw)
In-Reply-To: <66785c4b-b1cc-7b5a-a756-041068e3bec6@intel.com>
On 2019-07-10 09:20:47 [-0700], Dave Hansen wrote:
> On 7/10/19 7:41 AM, Sebastian Andrzej Siewior wrote:
> > I did not expect a pagefault with mlockall(). I assume it has to do with
> > memory compaction.
>
> mlock() doesn't technically prevent faults. From the manpage:
>
> > mlock(), mlock2(), and mlockall() lock part or all of the
> > calling process's virtual address space into RAM, preventing that
> > memory from being paged to the swap area.
> I read that as basically saying there will be no major faults, but minor
> faults are possible.
It says "lock virtual address space into into RAM". I assumed that there
will be no page faults because everything is locked.
The problem (besides the delay caused by the context switch and fix up)
is that a major fault (with might have happened at the same time in
another thread) will block this minor fault even longer.
Sebastian
next prev parent reply other threads:[~2019-07-10 16:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-10 14:41 Memory compaction and mlockall() Sebastian Andrzej Siewior
2019-07-10 16:20 ` Dave Hansen
2019-07-10 16:45 ` Sebastian Andrzej Siewior [this message]
2019-07-10 17:02 ` Dave Hansen
2019-07-10 18:21 ` Yang Shi
2019-07-11 9:43 ` Sebastian Andrzej Siewior
2019-07-11 16:23 ` Yang Shi
2019-08-12 14:59 ` Vlastimil Babka
2019-08-12 15:54 ` Sebastian Andrzej Siewior
2019-08-13 8:23 ` Vlastimil Babka
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=20190710164521.vlcrrfovphd5fp7f@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=dave.hansen@intel.com \
--cc=linux-mm@kvack.org \
--cc=tglx@linutronix.de \
/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).