From: Mike Kravetz <mike.kravetz@oracle.com>
To: Naoya Horiguchi <naoya.horiguchi@linux.dev>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Michal Hocko <mhocko@suse.com>,
Axel Rasmussen <axelrasmussen@google.com>,
Peter Xu <peterx@redhat.com>,
Andrea Arcangeli <aarcange@redhat.com>,
Mina Almasry <almasrymina@google.com>,
Shuah Khan <shuah@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [RFC PATCH 1/3] mm: enable MADV_DONTNEED for hugetlb mappings
Date: Wed, 26 Jan 2022 19:19:15 -0800 [thread overview]
Message-ID: <ee516ae7-03e3-46c1-28a4-940050e56b9b@oracle.com> (raw)
In-Reply-To: <20220127025845.GA3401059@u2004>
On 1/26/22 18:58, Naoya Horiguchi wrote:
> On Thu, Jan 13, 2022 at 10:03:06AM -0800, Mike Kravetz wrote:
>> MADV_DONTNEED is currently disabled for hugetlb mappings. This
>> certainly makes sense in shared file mappings as the pagecache maintains
>> a reference to the page and it will never be freed. However, it could
>> be useful to unmap and free pages in private mappings.
>>
>> The only thing preventing MADV_DONTNEED (and MADV_FREE) from working on
>> hugetlb mappings is a check in can_madv_lru_vma(). To allow support for
>> hugetlb mappings create and use a new routine madvise_dontneed_valid_vma()
>> that will allow hugetlb mappings.
>>
>> Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
>
> I briefly tested the patch and it seems that when calling madvise(MADV_DONTNEED)
> with the range unaligned to hugepage size (like 4kB) triggered the following crash.
> Could you double check around the address range issue?
Thanks Naoya! My bad for not considering this and doing more testing.
--
Mike Kravetz
next prev parent reply other threads:[~2022-01-27 3:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-13 18:03 [RFC PATCH 0/3] Add hugetlb MADV_DONTNEED support Mike Kravetz
2022-01-13 18:03 ` [RFC PATCH 1/3] mm: enable MADV_DONTNEED for hugetlb mappings Mike Kravetz
2022-01-27 2:58 ` Naoya Horiguchi
2022-01-27 3:19 ` Mike Kravetz [this message]
2022-01-13 18:03 ` [RFC PATCH 2/3] selftests/vm: add hugetlb madvise MADV_DONTNEED MADV_REMOVE test Mike Kravetz
2022-01-13 18:03 ` [RFC PATCH 3/3] userfaultfd/selftests: enable huegtlb remap and remove event testing Mike Kravetz
2022-01-27 11:57 ` [RFC PATCH 0/3] Add hugetlb MADV_DONTNEED support David Hildenbrand
2022-01-27 17:52 ` Axel Rasmussen
2022-01-28 9:44 ` David Hildenbrand
2022-01-27 17:55 ` Mike Kravetz
2022-01-28 9:55 ` David Hildenbrand
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=ee516ae7-03e3-46c1-28a4-940050e56b9b@oracle.com \
--to=mike.kravetz@oracle.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=almasrymina@google.com \
--cc=axelrasmussen@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=naoya.horiguchi@linux.dev \
--cc=peterx@redhat.com \
--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;
as well as URLs for NNTP newsgroup(s).