linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yang Shi <shy828301@gmail.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Linux MM <linux-mm@kvack.org>, Thomas Gleixner <tglx@linutronix.de>
Subject: Re: Memory compaction and mlockall()
Date: Wed, 10 Jul 2019 11:21:19 -0700	[thread overview]
Message-ID: <CAHbLzkpME1oT2=-TNPm9S_iZ2nkGsY6AXo7iVgDUhg8WysDpZw@mail.gmail.com> (raw)
In-Reply-To: <20190710144138.qyn4tuttdq6h7kqx@linutronix.de>

On Wed, Jul 10, 2019 at 7:41 AM Sebastian Andrzej Siewior
<bigeasy@linutronix.de> wrote:
>
> 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?

compaction should not isolate unevictable pages unless you have
/proc/sys/vm/compact_unevictable_allowed set.

>
> Sebastian
>


  parent reply	other threads:[~2019-07-10 18:21 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 [this message]
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='CAHbLzkpME1oT2=-TNPm9S_iZ2nkGsY6AXo7iVgDUhg8WysDpZw@mail.gmail.com' \
    --to=shy828301@gmail.com \
    --cc=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).