linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yang Shi <shy828301@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: jirislaby@kernel.org, surenb@google.com, riel@surriel.com,
	cl@linux.com,  akpm@linux-foundation.org,
	yang@os.amperecomputing.com, linux-mm@kvack.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: huge_memory: don't force huge page alignment on 32 bit
Date: Thu, 18 Jan 2024 12:39:55 -0800	[thread overview]
Message-ID: <CAHbLzkotGn9HifF9GQB5W5wMPZpxQviCFTStHcQCD5D37v8UVw@mail.gmail.com> (raw)
In-Reply-To: <ZamGsyJ5JTQ9GYNL@casper.infradead.org>

On Thu, Jan 18, 2024 at 12:14 PM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Thu, Jan 18, 2024 at 05:35:04AM -0800, Yang Shi wrote:
> > It doesn't make too much sense to force huge page alignment on 32 bit
> > system due to the constrained virtual address space.
> >
> > [1] https://lore.kernel.org/linux-mm/CAHbLzkqa1SCBA10yjWTtA2mKCsoK5+M1BthSDL8ROvUq2XxZMw@mail.gmail.com/T/#mf211643a0427f8d6495b5b53f8132f453d60ab95
> > [2] https://lore.kernel.org/linux-mm/CAHbLzkqa1SCBA10yjWTtA2mKCsoK5+M1BthSDL8ROvUq2XxZMw@mail.gmail.com/T/#me93dff2ccbd9902c3e395e1c022fb454e48ecb1d
>
> I feel sure there are shorter URLs for those messages ...

Oh, yeah, I just found.

[1] https://lore.kernel.org/linux-mm/d0a136a0-4a31-46bc-adf4-2db109a61672@kernel.org/
[2] https://lore.kernel.org/linux-mm/CAJuCfpHXLdQy1a2B6xN2d7quTYwg2OoZseYPZTRpU0eHHKD-sQ@mail.gmail.com/

>
> > @@ -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.
> > +      */
>
> I honestly wouldn't even comment this.  But if you must,
>
>         /* Using THP alignment is not as important as address randomisation */

It is not only about address randomization. Removing the comment is fine too.

>
> > +     if (IS_ENABLED(CONFIG_32BIT) || in_compat_syscall())
> > +             return 0;
> > +
> >       if (off_end <= off_align || (off_end - off_align) < size)
> >               return 0;
> >
> > --
> > 2.41.0
> >


  reply	other threads:[~2024-01-18 20:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18 13:35 Yang Shi
2024-01-18 18:05 ` Yang Shi
2024-01-19  0:16   ` Matthew Wilcox
2024-01-18 20:14 ` Matthew Wilcox
2024-01-18 20:39   ` Yang Shi [this message]
2024-01-19 17:16 ` Rik van Riel
2024-01-25  8:53 ` Michal Hocko
2024-01-26  9:36   ` Jiri Slaby
2024-01-26  9:41     ` Jiri Slaby
2024-01-26 10:51       ` Michal Hocko
2024-02-03  9:24 ` Thorsten Leemhuis
2024-02-05 17:07   ` Yang Shi
2024-02-05 17:53     ` Linux regression tracking (Thorsten Leemhuis)
2024-02-12 13:45       ` Thorsten Leemhuis
2024-02-18  9:26         ` Greg KH
2024-07-11 20:10 ` Yves-Alexis Perez
2024-07-11 20:47   ` Yang Shi
2024-07-11 20:50     ` Matthew Wilcox
2024-07-11 20:53       ` Yang Shi
2024-07-12 14:41         ` Yves-Alexis Perez
2024-07-12 15:31           ` Yang Shi
2024-07-11 20:52   ` Ben Hutchings

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=CAHbLzkotGn9HifF9GQB5W5wMPZpxQviCFTStHcQCD5D37v8UVw@mail.gmail.com \
    --to=shy828301@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=riel@surriel.com \
    --cc=surenb@google.com \
    --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