[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d8a413037b0f6db6a3834f596bba3d038c2a62b6.camel@surriel.com>
Date: Fri, 19 Jan 2024 12:16:03 -0500
From: Rik van Riel <riel@...riel.com>
To: Yang Shi <shy828301@...il.com>, jirislaby@...nel.org, surenb@...gle.com,
willy@...radead.org, cl@...ux.com, akpm@...ux-foundation.org
Cc: yang@...amperecomputing.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: huge_memory: don't force huge page alignment on 32
bit
On Thu, 2024-01-18 at 05:35 -0800, Yang Shi wrote:
> From: Yang Shi <yang@...amperecomputing.com>
>
> The commit efa7df3e3bb5 ("mm: align larger anonymous mappings on THP
> boundaries") caused two issues [1] [2] reported on 32 bit system or
> compat
> userspace.
>
> It doesn't make too much sense to force huge page alignment on 32 bit
> system due to the constrained virtual address space.
>
> +++ b/mm/huge_memory.c
>
> @@ -811,6 +812,14 @@ static unsigned long
> __thp_get_unmapped_area(struct file *filp,
> loff_t off_align = round_up(off, size);
> unsigned long len_pad, ret;
>
> + /*
> + * It doesn't make too much sense to froce huge page
> alignment on
> + * 32 bit system or compat userspace due to the contrained
> virtual
> + * address space and address entropy.
> + */
> + if (IS_ENABLED(CONFIG_32BIT) || in_compat_syscall())
> + return 0;
> +
> if (off_end <= off_align || (off_end - off_align) < size)
> return 0;
>
Reviewed-by: Rik van Riel <riel@...riel.com>
--
All Rights Reversed.
Powered by blists - more mailing lists