[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <356a4b9a-1f56-ae06-b211-bd32fc93ecda@redhat.com>
Date: Fri, 11 Feb 2022 09:43:46 +0100
From: David Hildenbrand <david@...hat.com>
To: Mike Kravetz <mike.kravetz@...cle.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Cc: Naoya Horiguchi <naoya.horiguchi@...ux.dev>,
Axel Rasmussen <axelrasmussen@...gle.com>,
Mina Almasry <almasrymina@...gle.com>,
Michal Hocko <mhocko@...e.com>, Peter Xu <peterx@...hat.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Shuah Khan <shuah@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v2 1/3] mm: enable MADV_DONTNEED for hugetlb mappings
>>>
>>> I am now rethinking the decision to proceed with b) as described above.
>>>
>>> With the exception of MADV_REMOVE (which we may be able to change for
>>> hugetlb), madvise operations operate on huge page size pages for hugetlb
>>> mappings. If start address is in the middle of a hugetlb page, we essentially
>>> align down to the beginning of the hugetlb page. If length lands in the
>>> middle of a hugetlb page, we essentially round up.
>>
>> Which MADV calls would be affected?
>
> Not sure I understand the question. I was saying that madvise calls which
> operate on hugetlb mappings today only operate on huge pages. So, this is
> essentially align down starting address and align up end address.
Let me clarify:
If you accidentially
MADV_NORMAL/MADV_RANDOM/MADV_SEQUENTIAL/MADV_WILLNEED a range that's
slightly bigger/smaller than the requested one you don't actually care,
because it will only slightly affect the performance of an application,
if at all. MADV_COLD/MADV_PAGEOUT should be similar. I assume these
don't apply to hugetlb at all.
The effects of
MADV_MERGEABLE/MADV_UNMERGEABLE/MADV_HUGEPAGE/MADV_NOHUGEPAGE should in
theory be similar, however, there can be some user-space visible effects
when you get it wrong. I assume these don't apply to hugetlb at all.
However, for
MADV_DONTNEED/MADV_REMOVE/MADV_DONTFORK/MADV_DOFORK/MADV_FREE/MADV_WIPEONFORK/MADV_KEEPONFORK/MADV_DONTDUMP/MADV_DODUMP/....
the application could easily detect the difference of the actual range
handling.
> For example consider the MADV_POPULATE calls you recently added. They will
> only fault in huge pages in a hugetlb vma.
On a related note: I don't see my man page updates upstream yet. And the
last update upstream seems to have happened 5 months ago ... not sure
why the man project seems to have stalled.
https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/
--
Thanks,
David / dhildenb
Powered by blists - more mailing lists