public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Hugh Dickins <hughd@google.com>
To: Mike Galbraith <efault@gmx.de>
Cc: LKML <linux-kernel@vger.kernel.org>, Hugh Dickins <hughd@google.com>
Subject: Re: new ltp memcg gripe bisects to b67bf49ce7aa ("post mm/munlock: delete FOLL_MLOCK and FOLL_POPULATE")
Date: Fri, 25 Mar 2022 12:51:44 -0700 (PDT)	[thread overview]
Message-ID: <90eb31fa-69f7-e320-d8a6-6227fecb780@google.com> (raw)
In-Reply-To: <969a2030a492f3cecdb7d0095478f1b779c643c3.camel@gmx.de>

On Fri, 25 Mar 2022, Mike Galbraith wrote:

> Greetings,
> 
> $subject bisected in a kvm ala:
> 
> leap153:/usr/local/ltp # cat testme
> export PATH=$PATH:`pwd`/testcases/bin
> memcg_stat_test.sh
> leap153:/usr/local/ltp # . ./testme
> 
> Usually leads to...
> memcg_stat_test 3 TINFO: Test unevictable with MAP_LOCKED
> memcg_stat_test 3 TINFO: Running memcg_process --mmap-lock1 -s 135168
> memcg_stat_test 3 TINFO: Warming up pid: 3460
> memcg_stat_test 3 TINFO: Process is still here after warm up: 3460
> memcg_stat_test 3 TFAIL: unevictable is 122880, 135168 expected
> ...but may lead to...
> memcg_stat_test 4 TINFO: Test unevictable with mlock
> memcg_stat_test 4 TINFO: Running memcg_process --mmap-lock2 -s 135168
> memcg_stat_test 4 TINFO: Warming up pid: 4271
> memcg_stat_test 4 TINFO: Process is still here after warm up: 4271
> memcg_stat_test 4 TFAIL: unevictable is 122880, 135168 expected
> ...or both.  A wee bit flaky.
> 
> I wanted to verify with a revert on top of 85c7000fda00, but while the
> revert patch applied, the result didn't boot.  Config is full distro.

Thanks a lot for spotting that.  I'll have no trouble reproducing it here,
looking through my old LTP test results.  I never noticed because I'm used
to memcg_stat failing - but looking closer, that's been because I'm usually
running with THP shmem_enabled "force", which causes memcg_stat_test 1 to
fail with a bigger number than expected (understandably): memcg_stat_test
3 and 4 failures are new to mlock/munlock changes.

It will (almost certainly) be a pagevec draining issue, to be fixed by a
strategically placed lru_add_drain() or mlock_page_drain().  I did have
more of those in for a while, before understanding and arriving at
b74355078b65 ("mm/munlock: page migration needs mlock pagevec drained");
and with that fix, hadn't noticed the need for more, so left them out
until proven desirable.

If it's as I expect, then it's worth doing: not just to pass an LTP test,
but more generally a good thing.  I'll play around in the next few days
and post a patch once I'm satisfied.

Regarding your bisection and revert of b67bf49ce7aa ("mm/munlock: delete
FOLL_MLOCK and FOLL_POPULATE").  I'm glad to hear that you got a build
error trying to revert that one commit: not a supported combination!
Maybe not too far wrong, but I wouldn't trust it.

But yes, I can see that the revert will bring in an lru_add_drain()
per page, so that fits with my guess above.

Thanks!
Hugh

  parent reply	other threads:[~2022-03-25 20:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25 10:32 new ltp memcg gripe bisects to b67bf49ce7aa ("post mm/munlock: delete FOLL_MLOCK and FOLL_POPULATE") Mike Galbraith
2022-03-25 11:24 ` Mike Galbraith
2022-03-25 19:51 ` Hugh Dickins [this message]
2022-03-28 21:39   ` Hugh Dickins

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=90eb31fa-69f7-e320-d8a6-6227fecb780@google.com \
    --to=hughd@google.com \
    --cc=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.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