linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: linux-mm@kvack.org
Cc: tglx@linutronix.de
Subject: Memory compaction and mlockall()
Date: Wed, 10 Jul 2019 16:41:38 +0200	[thread overview]
Message-ID: <20190710144138.qyn4tuttdq6h7kqx@linutronix.de> (raw)

Hi,

I've been looking at the following trace:
| cyclicte-526     0d...2.. 6876070 603us : finish_task_switch <-__schedule
| cyclicte-526     0....2.. 6876070 605us : preempt_count_sub <-finish_task_switch
| cyclicte-526     0....1.. 6876070 607us : preempt_count_sub <-schedule
| cyclicte-526     0....... 6876070 610us : finish_wait <-put_and_wait_on_page_locked

I see put_and_wait_on_page_locked after schedule and didn't expect that.
cyclictest then blocks on a lock and switches to `kcompact'. Once it
finishes, it switches back to cyclictest:
| cyclicte-526     0....... 6876070 853us : rt_spin_unlock <-put_and_wait_on_page_locked
| cyclicte-526     0....... 6876070 854us : migrate_enable <-rt_spin_unlock
| cyclicte-526     0....... 6876070 860us : up_read <-do_page_fault
| cyclicte-526     0....... 6876070 861us : __up_read <-do_page_fault
| cyclicte-526     0d...... 6876070 867us : do_PrefetchAbort <-ret_from_exception
| cyclicte-526     0d...... 6876070 868us : do_page_fault <-do_PrefetchAbort
| cyclicte-526     0....... 6876070 870us : down_read_trylock <-do_page_fault
| cyclicte-526     0....... 6876070 872us : __down_read_trylock <-do_page_fault
…
| cyclicte-526     0....... 6876070 914us : __up_read <-do_page_fault
| cyclicte-526     0....... 6876070 923us : sys_clock_gettime32 <-ret_fast_syscall
| cyclicte-526     0....... 6876070 925us : posix_ktime_get_ts <-sys_clock_gettime32

I did not expect a pagefault with mlockall(). I assume it has to do with
memory compaction. I have
| CONFIG_COMPACTION=y
| CONFIG_MIGRATION=y

and Kconfig says:
|config COMPACTION
…
|                                                       You shouldn't
|           disable this option unless there really is a strong reason for
|           it and then we would be really interested to hear about that at
|           linux-mm@kvack.org.

Shouldn't COMPACTION avoid touching/moving mlock()ed pages?

Sebastian


             reply	other threads:[~2019-07-10 14:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-10 14:41 Sebastian Andrzej Siewior [this message]
2019-07-10 16:20 ` Memory compaction and mlockall() 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

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=20190710144138.qyn4tuttdq6h7kqx@linutronix.de \
    --to=bigeasy@linutronix.de \
    --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).