[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aBTCtOXBhUK_FLU6@casper.infradead.org>
Date: Fri, 2 May 2025 14:03:48 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Ignacio.MorenoGonzalez@...a.com
Cc: Liam.Howlett@...cle.com, lorenzo.stoakes@...cle.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: mmap: map MAP_STACK to VM_NOHUGEPAGE only if THP is
enabled
On Fri, May 02, 2025 at 11:31:41AM +0200, Ignacio Moreno Gonzalez via B4 Relay wrote:
> From: Ignacio Moreno Gonzalez <Ignacio.MorenoGonzalez@...a.com>
>
> commit c4608d1bf7c6 ("mm: mmap: map MAP_STACK to VM_NOHUGEPAGE") maps
> the mmap option MAP_STACK to VM_NOHUGEPAGE. This is also done if
> CONFIG_TRANSPARENT_HUGETABLES is not defined. But in that case, the
> VM_NOHUGEPAGE does not make sense. For instance, when calling madvise()
> with MADV_NOHUGEPAGE, an error is always returned.
Isn't that the real problem though?
+++ b/include/linux/huge_mm.h
@@ -596,6 +596,8 @@ static inline bool unmap_huge_pmd_locked(struct vm_area_struct *vma,
static inline int hugepage_madvise(struct vm_area_struct *vma,
unsigned long *vm_flags, int advice)
{
+ if (advice == MADV_NOHUGEPAGE)
+ return 0;
return -EINVAL;
}
Powered by blists - more mailing lists