All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yves-Alexis Perez <corsac@debian.org>
To: Yang Shi <shy828301@gmail.com>
Cc: Matthew Wilcox <willy@infradead.org>,
	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,
	Salvatore Bonaccorso <carnil@debian.org>,
	Ben Hutchings <ben@decadent.org.uk>
Subject: Re: [PATCH] mm: huge_memory: don't force huge page alignment on 32 bit
Date: Fri, 12 Jul 2024 16:41:59 +0200	[thread overview]
Message-ID: <ZpFAt6ha2KbFRoFn@corsac.net> (raw)
In-Reply-To: <CAHbLzkpitWRK2q3JidRdyQxajz+MixiO1bX08btVu9Ch0i6Kxw@mail.gmail.com>

On Thu, Jul 11, 2024 at 01:53:04PM -0700, Yang Shi wrote:
> On Thu, Jul 11, 2024 at 1:50 PM Matthew Wilcox <willy@infradead.org> wrote:
> >
> > On Thu, Jul 11, 2024 at 01:47:00PM -0700, Yang Shi wrote:
> > > +++ b/mm/huge_memory.c
> > > @@ -857,7 +857,8 @@ static unsigned long
> > > __thp_get_unmapped_area(struct file *filp,
> > >         loff_t off_align = round_up(off, size);
> > >         unsigned long len_pad, ret, off_sub;
> > >
> > > -       if (IS_ENABLED(CONFIG_32BIT) || in_compat_syscall())
> > > +       if (IS_ENABLED(CONFIG_32BIT) || IS_ENABLED(CONFIG_X86_32) ||
> > > +           in_compat_syscall())
> >
> > Why not:
> >
> >         if (!IS_ENABLED(CONFIG_64BIT) || in_compat_syscall())
> 
> Nothing specific, just didn't think of it, sigh...
> 
> Thanks for the suggestion. Definitely preferable way.
> 
And I just did a quick test rebuilding a kernel with
!IS_ENABLED(CONFIG_64BIT) and running on an i386 Debian sid
installation.

I can confirm it seems to work as intended:

Before:
root@testvm:~# uname -a
Linux testvm 6.9.8-686-pae #1 SMP PREEMPT_DYNAMIC Debian 6.9.8-1 (2024-07-07) i686 GNU/Linux
root@testvm:~# for i in {0..9}; do cat /proc/self/maps |grep libc.so |head -n1; done
b7c00000-b7c22000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
b7c00000-b7c22000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
b7c00000-b7c22000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
b7c00000-b7c22000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
b7c00000-b7c22000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
b7c00000-b7c22000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
b7c00000-b7c22000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
b7c00000-b7c22000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
b7c00000-b7c22000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
b7c00000-b7c22000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6


After:

root@testvm:~# uname -a
Linux testvm 6.9.8+ #1 SMP PREEMPT_DYNAMIC Fri Jul 12 15:23:07 CEST 2024 i686 GNU/Linux
root@testvm:~# for i in {0..9}; do cat /proc/self/maps |grep libc.so |head -n1; done
b7cf3000-b7d15000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
b7d7a000-b7d9c000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
b7d8b000-b7dad000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
b7d4b000-b7d6d000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
b7d64000-b7d86000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
b7d15000-b7d37000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
b7c9e000-b7cc0000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
b7d68000-b7d8a000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
b7cf6000-b7d18000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6
b7ce6000-b7d08000 r--p 00000000 fe:00 933        /usr/lib/i386-linux-gnu/libc.so.6

So:
Tested-By: Yves-Alexis Perez <corsac@debian.org>

I didn't try on other 32b architectures though.

Regards,
-- 
Yves-Alexis Perez


  reply	other threads:[~2024-07-12 14:43 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18 13:35 [PATCH] mm: huge_memory: don't force huge page alignment on 32 bit 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
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 [this message]
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=ZpFAt6ha2KbFRoFn@corsac.net \
    --to=corsac@debian.org \
    --cc=akpm@linux-foundation.org \
    --cc=ben@decadent.org.uk \
    --cc=carnil@debian.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=shy828301@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.