linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: Ignacio.MorenoGonzalez@kuka.com
Cc: Liam.Howlett@oracle.com, akpm@linux-foundation.org,
	yang@os.amperecomputing.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Matthew Wilcox <willy@infradead.org>
Subject: Re: [PATCH v2 0/2] Map MAP_STACK to VM_NOHUGEPAGE only if THP is enabled
Date: Tue, 6 May 2025 15:28:37 +0100	[thread overview]
Message-ID: <5ebcdd05-1c82-428c-a013-b7757998ed47@lucifer.local> (raw)
In-Reply-To: <20250506-map-map_stack-to-vm_nohugepage-only-if-thp-is-enabled-v2-0-f11f0c794872@kuka.com>

On Tue, May 06, 2025 at 03:44:31PM +0200, Ignacio Moreno Gonzalez via B4 Relay wrote:
> ... and make setting MADV_NOHUGEPAGE with madvise() into a no-op if THP
> is not enabled.

This bit probably belongs after the rest without ellipses :P but it's not
important.

>
> I discovered this issue when trying to use the tool CRIU to checkpoint
> and restore a container. Our running kernel is compiled without
> CONFIG_TRANSPARENT_HUGETABLES. CRIU parses the output of
> /proc/<pid>/smaps and saves the "nh" flag. When trying to restore the
> container, CRIU fails to restore the "nh" mappings, since madvise()
> MADV_NOHUGEPAGE always returns an error because
> CONFIG_TRANSPARENT_HUGETABLES is not defined.
>
> These patches:
> - Avoid mapping MAP_STACK to VM_NOHUGEPAGE if !THP
> - Avoid returning an error when calling madvise() with MADV_NOHUGEPAGE
>   if !THP
>
> Signed-off-by: Ignacio Moreno Gonzalez <Ignacio.MorenoGonzalez@kuka.com>

The series looks good to me, thanks!

Applies cleanly, builds fine, all selftests tests passing etc.

> ---
> Changes in v2:
> - [Patch 1/2] Use '#ifdef' instead of '#if defined(...)'
> - [Patch 1/2] Add 'Fixes: c4608d1bf7c6...'
> - Create [Patch 2/2]
>
> - Link to v1: https://lore.kernel.org/r/20250502-map-map_stack-to-vm_nohugepage-only-if-thp-is-enabled-v1-1-113cc634cd51@kuka.com

Thanks for the summary!

>
> ---
> Ignacio Moreno Gonzalez (2):
>       mm: mmap: map MAP_STACK to VM_NOHUGEPAGE only if THP is enabled
>       mm: madvise: no-op for MADV_NOHUGEPAGE if THP is disabled
>
>  include/linux/huge_mm.h | 6 ++++++
>  include/linux/mman.h    | 2 ++
>  2 files changed, 8 insertions(+)
> ---
> base-commit: fc96b232f8e7c0a6c282f47726b2ff6a5fb341d2
> change-id: 20250428-map-map_stack-to-vm_nohugepage-only-if-thp-is-enabled-ce40a1de095d
>
> Best regards,
> --
> Ignacio Moreno Gonzalez <Ignacio.MorenoGonzalez@kuka.com>
>
>


  parent reply	other threads:[~2025-05-06 14:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-06 13:44 Ignacio Moreno Gonzalez via B4 Relay
2025-05-06 13:44 ` [PATCH v2 1/2] mm: mmap: map " Ignacio Moreno Gonzalez via B4 Relay
2025-05-06 16:00   ` Liam R. Howlett
2025-05-06 23:43   ` Andrew Morton
2025-05-06 13:44 ` [PATCH v2 2/2] mm: madvise: no-op for MADV_NOHUGEPAGE if THP is disabled Ignacio Moreno Gonzalez via B4 Relay
2025-05-06 16:00   ` Liam R. Howlett
2025-05-06 23:40   ` Andrew Morton
2025-05-07 11:44     ` Ignacio Moreno Gonzalez
2025-05-07 15:57       ` Yang Shi
2025-05-07 16:11         ` Ignacio Moreno Gonzalez
2025-05-07 22:38           ` Yang Shi
2025-05-06 14:28 ` Lorenzo Stoakes [this message]
2025-05-06 15:12   ` [PATCH v2 0/2] Map MAP_STACK to VM_NOHUGEPAGE only if THP is enabled Ignacio Moreno Gonzalez
2025-05-06 15:14     ` Lorenzo Stoakes

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=5ebcdd05-1c82-428c-a013-b7757998ed47@lucifer.local \
    --to=lorenzo.stoakes@oracle.com \
    --cc=Ignacio.MorenoGonzalez@kuka.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=stable@vger.kernel.org \
    --cc=willy@infradead.org \
    --cc=yang@os.amperecomputing.com \
    /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