From: David Hildenbrand <david@redhat.com>
To: Kefeng Wang <wangkefeng.wang@huawei.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Hugh Dickins <hughd@google.com>, Barry Song <baohua@kernel.org>,
Ryan Roberts <ryan.roberts@arm.com>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
Matthew Wilcox <willy@infradead.org>,
linux-mm@kvack.org
Subject: Re: [PATCH 2/3] mm: huge_memory: add thp_vma_disabled()
Date: Fri, 11 Oct 2024 12:00:30 +0200 [thread overview]
Message-ID: <c690d3cc-469c-4dce-a4ca-09b20c3f0c62@redhat.com> (raw)
In-Reply-To: <ac986217-3e8d-4474-83db-30cdd4b11c21@huawei.com>
On 11.10.24 02:40, Kefeng Wang wrote:
>
>
> On 2024/10/10 22:53, David Hildenbrand wrote:
>> On 10.10.24 16:41, David Hildenbrand wrote:
>>> On 10.10.24 08:10, Kefeng Wang wrote:
>>>> Add thp_vma_disabled() helper to shared by shmem_allowable_huge_orders()
>>>> and __thp_vma_allowable_orders().
>>>>
>>>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>>>> ---
>>>> include/linux/huge_mm.h | 19 +++++++++++++++++++
>>>> mm/huge_memory.c | 13 +------------
>>>> mm/shmem.c | 7 +------
>>>> 3 files changed, 21 insertions(+), 18 deletions(-)
>>>>
>>>> diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
>>>> index 795df660efa5..d77891332b35 100644
>>>> --- a/include/linux/huge_mm.h
>>>> +++ b/include/linux/huge_mm.h
>>>> @@ -309,6 +309,25 @@ struct thpsize {
>>>> (transparent_hugepage_flags & \
>>>> (1<<TRANSPARENT_HUGEPAGE_USE_ZERO_PAGE_FLAG))
>>>> +static inline bool thp_vma_disabled(struct vm_area_struct *vma,
>>>> + unsigned long vm_flags)
>>>> +{
>>>>
>>>
>>> I might need a patch like this for an independent fix, and the more I
>>> look at this the more I hate the separate vm_flags and the optional vma
>>> argument.
>
> Yes, it is a little strange when made this changes, a separate vm_flags
> and another vma argument, most vm_flags is just vma->vm_flags(madvise is
> a special case).
>
Yes, we should be able to handle the madvise stuff in a better way
(simply check after the vma->vm_flags where modified).
>>>
>>> Let me try to improve things.
>>>
>>> Long term we can get rid of the vm_flags, it just needs some madvise()
>>> massaging.
>>
>
> Thanks for your improvement, it is more accurate.
I will include that in my next small fix-series and CC you.
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2024-10-11 10:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-10 6:10 [PATCH 0/3] mm: cleanup thp and shmem allowable order check Kefeng Wang
2024-10-10 6:10 ` [PATCH 1/3] mm: huge_memory: move file_thp_enabled() into huge_memory.c Kefeng Wang
2024-10-10 12:56 ` David Hildenbrand
2024-10-12 3:27 ` Baolin Wang
2024-10-10 6:10 ` [PATCH 2/3] mm: huge_memory: add thp_vma_disabled() Kefeng Wang
2024-10-10 12:58 ` David Hildenbrand
2024-10-10 14:41 ` David Hildenbrand
2024-10-10 14:53 ` David Hildenbrand
2024-10-11 0:40 ` Kefeng Wang
2024-10-11 10:00 ` David Hildenbrand [this message]
2024-10-10 6:10 ` [PATCH 3/3] mm: shmem: remove __shmem_huge_global_enabled() Kefeng Wang
2024-10-12 3:38 ` Baolin Wang
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=c690d3cc-469c-4dce-a4ca-09b20c3f0c62@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=hughd@google.com \
--cc=linux-mm@kvack.org \
--cc=ryan.roberts@arm.com \
--cc=wangkefeng.wang@huawei.com \
--cc=willy@infradead.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