From: Vlastimil Babka <vbabka@suse.cz>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Yang Shi <shy828301@gmail.com>, Linux MM <linux-mm@kvack.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: Memory compaction and mlockall()
Date: Tue, 13 Aug 2019 10:23:50 +0200 [thread overview]
Message-ID: <f6159e12-f682-f2e2-f50e-1afc644ddd5f@suse.cz> (raw)
In-Reply-To: <20190812155411.hpfweuao7uudw5my@linutronix.de>
On 8/12/19 5:54 PM, Sebastian Andrzej Siewior wrote:
> On 2019-08-12 16:59:00 [+0200], Vlastimil Babka wrote:
>> I would say that enabled is a better default wrt benefits for the
>> majority of systems. This was assuming that mlock() is primarily used to
>> prevent sensitive data (crypto keys) from hitting swap, not to give
>> latency guarantees. You could perhaps argue that enabling PREEMPT_RT
>> might change the default, but it's somewhat subtle.
>
> A different behaviour depending on PREEMPT_RT is bad.
> From the mlock(2) page:
>
> |NOTES
> |
> |Memory locking has two main applications: real-time algorithms and
> |high-security data processing. Real-time applications require deterministic
> |timing, and, like scheduling, paging is one major cause of unexpected program
> |execution delays. …
> |
> |Real-time processes that are using mlockall() to prevent delays on page faults
> |should reserve enough locked stack pages before entering the time-critical
> |section, so that no page fault can be caused by function calls. …
Ah, I see, so it is documented for time-critical stuff.
> So if we are not going to revert that, then I would need to update man
> page to reflect that we now have an additional knob to consider in order
> to disable page faults on mlock()ed pages.
If we're going to update man page, then there's also auto NUMA balancing
that can cause minor faults and migrations, AFAIK.
> Sebastian
>
prev parent reply other threads:[~2019-08-13 8:23 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
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 [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=f6159e12-f682-f2e2-f50e-1afc644ddd5f@suse.cz \
--to=vbabka@suse.cz \
--cc=bigeasy@linutronix.de \
--cc=linux-mm@kvack.org \
--cc=shy828301@gmail.com \
--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).