[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <dbf09a6c-4ac6-489e-92f5-7a52b2907d20@linux.microsoft.com>
Date: Wed, 3 Dec 2025 14:01:36 -0800
From: Nuno Das Neves <nunodasneves@...ux.microsoft.com>
To: Stanislav Kinsburskii <skinsburskii@...ux.microsoft.com>,
kys@...rosoft.com, haiyangz@...rosoft.com, wei.liu@...nel.org,
decui@...rosoft.com
Cc: linux-hyperv@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v9 4/6] Drivers: hv: Fix huge page handling in memory
region traversal
On 12/3/2025 1:40 PM, Stanislav Kinsburskii wrote:
> The previous code assumed that if a region's first page was huge, the
> entire region consisted of huge pages and stored this in a large_pages
> flag. This premise is incorrect not only for movable regions (where
> pages can be split and merged on invalidate callbacks or page faults),
> but even for pinned regions: THPs can be split and merged during
> allocation, so a large, pinned region may contain a mix of huge and
> regular pages.
>
> This change removes the large_pages flag and replaces region-wide
> assumptions with per-chunk inspection of the actual page size when
> mapping, unmapping, sharing, and unsharing. This makes huge page
> handling correct for mixed-page regions and avoids relying on stale
> metadata that can easily become invalid as memory is remapped.
>
> Signed-off-by: Stanislav Kinsburskii <skinsburskii@...ux.microsoft.com>
> Reviewed-by: Anirudh Rayabharam (Microsoft) <anirudh@...rudhrb.com>
> ---
> drivers/hv/mshv_regions.c | 219 +++++++++++++++++++++++++++++++++++++++------
> drivers/hv/mshv_root.h | 3 -
> 2 files changed, 191 insertions(+), 31 deletions(-)
>
Reviewed-by: Nuno Das Neves <nunodasneves@...ux.microsoft.com>
Powered by blists - more mailing lists