linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Mina Almasry <almasrymina@google.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	linux-kselftest@vger.kernel.org,
	Mario Casquero <mcasquer@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Shuah Khan <shuah@kernel.org>,
	Muchun Song <muchun.song@linux.dev>
Subject: Re: [PATCH v1] selftests/mm: fix charge_reserved_hugetlb.sh test
Date: Wed, 21 Aug 2024 18:04:40 +0200	[thread overview]
Message-ID: <95a7dbfe-d88f-4d8b-898e-87c18e7d5813@redhat.com> (raw)
In-Reply-To: <CAHS8izNyDymXoH94usJTGNHG45HB50m7SSkL6H1C+9pxBEDE+g@mail.gmail.com>

On 21.08.24 17:59, Mina Almasry wrote:
> On Wed, Aug 21, 2024 at 8:31 AM David Hildenbrand <david@redhat.com> wrote:
>>
>> Currently, running the charge_reserved_hugetlb.sh selftest we can
>> sometimes observe something like:
>>
>>    $ ./charge_reserved_hugetlb.sh -cgroup-v2
>>    ...
>>    write_result is 0
>>    After write:
>>    hugetlb_usage=0
>>    reserved_usage=10485760
>>    killing write_to_hugetlbfs
>>    Received 2.
>>    Deleting the memory
>>    Detach failure: Invalid argument
>>    umount: /mnt/huge: target is busy.
>>
>> Both cases are issues in the test.
>>
>> While the unmount error seems to be racy, it will make the test fail:
>>          $ ./run_vmtests.sh -t hugetlb
>>          ...
>>          # [FAIL]
>>          not ok 10 charge_reserved_hugetlb.sh -cgroup-v2 # exit=32
>>
>> The issue is that we are not waiting for the write_to_hugetlbfs process
>> to quit. So it might still have a hugetlbfs file open, about which
>> umount is not happy. Fix that by making "killall" wait for the process
>> to quit.
>>
>> The other error ("Detach failure: Invalid argument") does not seem to
>> result in a test error, but is misleading. Turns out write_to_hugetlbfs.c
>> unconditionally tries to cleanup using shmdt(), even when we only
>> mmap()'ed a hugetlb file. Even worse, shmaddr is never even set for the
>> SHM case. Fix that as well.
>>
>> With this change it seems to work as expected.
>>
>> Fixes: 29750f71a9b4 ("hugetlb_cgroup: add hugetlb_cgroup reservation tests")
>> Reported-by: Mario Casquero <mcasquer@redhat.com>
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> Cc: Shuah Khan <shuah@kernel.org>
>> Cc: Muchun Song <muchun.song@linux.dev>
>> Cc: Mina Almasry <almasrymina@google.com>
>> Signed-off-by: David Hildenbrand <david@redhat.com>
> 
> Initially I thought it could be nice to split fixes for the 2 issues
> in separate patches in case one of them ends up needing a revert or
> something, but probably not worth a respin. Fixes look good to me.

I was debating with myself as well if it should be separated, but 
decided to go the simple route of a single patch :)

> 
> Reviewed-by: Mina Almasry <almasrymina@google.com>

Thanks!

-- 
Cheers,

David / dhildenb



  reply	other threads:[~2024-08-21 16:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-21 12:31 David Hildenbrand
2024-08-21 15:59 ` Mina Almasry
2024-08-21 16:04   ` David Hildenbrand [this message]
2024-08-26 14:16 ` Mario Casquero
2024-08-26 14:18   ` Mario Casquero

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=95a7dbfe-d88f-4d8b-898e-87c18e7d5813@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=almasrymina@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mcasquer@redhat.com \
    --cc=muchun.song@linux.dev \
    --cc=shuah@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