Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Wen Jiang" <jiangwenxiaomi@gmail.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Uladzislau Rezki" <urezki@gmail.com>,
	linux-mm@kvack.org
Cc: "Barry Song" <baohua@kernel.org>,
	"Ryan Roberts" <ryan.roberts@arm.com>,
	"Dev Jain" <dev.jain@arm.com>,
	"Anshuman Khandual" <anshuman.khandual@arm.com>,
	"David Hildenbrand" <david@kernel.org>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Will Deacon" <will@kernel.org>, "Leo Yan" <leo.yan@arm.com>,
	"Xueyuan Chen" <xueyuan.chen21@gmail.com>,
	"Mike Rapoport" <rppt@kernel.org>,
	"Pasha Tatashin" <pasha.tatashin@soleen.com>,
	"Pratyush Yadav" <pratyush@kernel.org>,
	"Alexander Graf" <graf@amazon.com>,
	kexec@lists.infradead.org, "Wen Jiang" <jiangwen6@xiaomi.com>
Subject: Re: [RFC PATCH 2/4] mm/vmalloc: add VM_HAS_HUGE_VMAP
Date: Thu, 03 Dec 2026 09:26:40 +0000	[thread overview]
Message-ID: <sashiko-outbox-247456@kernel.org> (raw)
In-Reply-To: <20261202091212.363755-3-jiangwenxiaomi@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] kho: missing VM_HAS_HUGE_VMAP and page_order in
  kho_restore_vmalloc()
--

commit d2fc3c17bc7bc213d515a16185a8e014dcf7b7c0
Author: Wen Jiang <jiangwen6@xiaomi.com>

mm/vmalloc: add VM_HAS_HUGE_VMAP

This commit introduces the VM_HAS_HUGE_VMAP flag to indicate that at least
part of a vmalloc area has huge page table mappings, and updates
is_vm_area_hugepages(), vrealloc(), and KHO to use it.

> diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_handover.c
> index 42c6609a1766a..c2d5823b498a3 100644
> --- a/kernel/liveupdate/kexec_handover.c
> +++ b/kernel/liveupdate/kexec_handover.c
> @@ -1288,7 +1288,8 @@ void kho_unpreserve_pages(struct page *page, unsigned long nr_pages)
>  EXPORT_SYMBOL_GPL(kho_unpreserve_pages);
>  
>  /* vmalloc flags KHO supports */
> -#define KHO_VMALLOC_SUPPORTED_FLAGS	(VM_ALLOC | VM_ALLOW_HUGE_VMAP)
> +#define KHO_VMALLOC_SUPPORTED_FLAGS	(VM_ALLOC | VM_ALLOW_HUGE_VMAP | \
> +					 VM_HAS_HUGE_VMAP)
>  
>  /* KHO internal flags for vmalloc preservations */
>  #define KHO_VMALLOC_ALLOC	0x0001

[Severity: Medium]
Should kho_restore_vmalloc() also set VM_HAS_HUGE_VMAP and area->page_order
when restoring an area with order > 0?

kho_restore_vmalloc() maps the restored range with vmap_pages_range(...,
PAGE_SHIFT + order), creating huge page table entries when order > 0, but
never sets VM_HAS_HUGE_VMAP in area->flags or restores area->page_order.
After restore, is_vm_area_hugepages() returns false and shrinking the area
with vrealloc() attempts to unmap tail base pages inside a huge mapping,
triggering a warning in the vunmap path and clearing the entire huge entry.

Exposing and calling set_vm_area_page_order(area, order) in
kho_restore_vmalloc() would restore both fields.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261202091212.363755-1-jiangwenxiaomi@gmail.com?part=2


  reply	other threads:[~2026-12-03  9:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  9:12 [RFC PATCH 0/4] mm/vmalloc: Reduce memory usage and speed up huge vmalloc Wen Jiang
2026-12-02  9:12 ` [RFC PATCH 1/4] mm/vmalloc: extract vmalloc_area_map_range() Wen Jiang
2026-12-02  9:12 ` [RFC PATCH 2/4] mm/vmalloc: add VM_HAS_HUGE_VMAP Wen Jiang
2026-12-03  9:26   ` sashiko-bot [this message]
2026-12-02  9:12 ` [RFC PATCH 3/4] mm/vmalloc: try smaller block sizes before base pages Wen Jiang
2026-12-02  9:12 ` [RFC PATCH 4/4] mm/vmalloc: page align huge vmalloc sizes Wen Jiang
2026-12-02 12:09 ` [RFC PATCH 0/4] mm/vmalloc: Reduce memory usage and speed up huge vmalloc Dev Jain
2026-12-03  2:36   ` Wen Jiang

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=sashiko-outbox-247456@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=baohua@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=david@kernel.org \
    --cc=dev.jain@arm.com \
    --cc=graf@amazon.com \
    --cc=jiangwen6@xiaomi.com \
    --cc=jiangwenxiaomi@gmail.com \
    --cc=kexec@lists.infradead.org \
    --cc=leo.yan@arm.com \
    --cc=linux-mm@kvack.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=pratyush@kernel.org \
    --cc=rppt@kernel.org \
    --cc=ryan.roberts@arm.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=urezki@gmail.com \
    --cc=will@kernel.org \
    --cc=xueyuan.chen21@gmail.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