All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mina Almasry <almasrymina@google.com>
To: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Yosry Ahmed <yosryahmed@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Shuah Khan <shuah@kernel.org>,
	linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm, hugepages: fix size in hugetlb mremap() test
Date: Wed, 24 Nov 2021 13:03:36 -0800	[thread overview]
Message-ID: <CAHS8izNi0uY5LY2_jF6m0hzJHz87dK2AZ+Y=ggAkMNpW7kaonQ@mail.gmail.com> (raw)
In-Reply-To: <a87c5768-9bd3-a2f5-7eb5-d2813b958514@oracle.com>

On Tue, Nov 23, 2021 at 7:42 PM Mike Kravetz <mike.kravetz@oracle.com> wrote:
>
> On 11/23/21 18:19, Yosry Ahmed wrote:
> > On Tue, Nov 23, 2021 at 5:08 PM Mike Kravetz <mike.kravetz@oracle.com> wrote:
> >>
> >> On 11/23/21 12:46, Yosry Ahmed wrote:
> >>> The hugetlb vma mremap() test mentions in the header comment that it
> >>> uses 10MB worth of huge pages, when it actually uses 1GB. This causes
> >>> the test to fail on devices with smaller memories.
> >>>
> >>> Signed-off-by: Yosry Ahmed <yosryahmed@google.com>
> >>> ---
> >>>  tools/testing/selftests/vm/hugepage-mremap.c | 2 +-
> >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> I'll let Mina comment, but I think I know what happened.
> >
> > Thanks for taking the time to review this and explain what happened.
> >
> >>
> >>
> >> The original version of the test did indeed use 10MB.  However, the mremap
> >> code must 'unshare' and shared pmd mappings before remapping.  Since sharing
> >> requires mappings of at least 1GB, the size was changed to make sure unsharing
> >> worked.
> >>
> >> In the end, I believe I suggested adding hugepage-mremap to run_vmtests.sh.
> >> The script does not try to configure a GB worth of huge pages.  And, I think
> >> it is somewhat unreasonable to suggest users gave a spare GB to run the test.
> >
> > Alternatively, we can pass an optional argument to the test that makes it use
> > 1GB instead of 10MB. This way, if the test is run with run_vmtests.sh the
> > default behavior would be to use 10MB, making sure users do not run out of
> > memory. Otherwise, an interested user could run the test without run_vmtest.sh
> > and provide the extra argument to make the test use 1GB and make sure that
> > unsharing works correctly. Thoughts?
> >
>
> Passing a 'mapping size' argument as you suggest would be best.  That way
> run_vmtest.sh can pass in a size such as 10MB, but the test could be used
> independently with arbitrary size mappings.
>
> If you have the time to do this, go for it!

Yes, Mike's recollection of events makes sense to me. I think that was
the mistake that happened (sorry!)

Making it configurable makes sense to me. I'm out for the rest of the
week but I'll try to review sooner if possible.

Thanks for looking into this Yosry!

  reply	other threads:[~2021-11-24 21:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23 20:46 [PATCH] mm, hugepages: fix size in hugetlb mremap() test Yosry Ahmed
2021-11-24  1:08 ` Mike Kravetz
2021-11-24  2:19   ` Yosry Ahmed
2021-11-24  3:42     ` Mike Kravetz
2021-11-24 21:03       ` Mina Almasry [this message]
2021-11-24 20:38 ` [PATCH] mm, hugepages: make memory size variable in hugepage-mremap selftest Yosry Ahmed

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='CAHS8izNi0uY5LY2_jF6m0hzJHz87dK2AZ+Y=ggAkMNpW7kaonQ@mail.gmail.com' \
    --to=almasrymina@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    --cc=shuah@kernel.org \
    --cc=yosryahmed@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.