All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: "Nam Cao" <namcao@linutronix.de>,
	"Björn Töpel" <bjorn@kernel.org>,
	"Christian Brauner" <brauner@kernel.org>,
	"Andreas Dilger" <adilger@dilger.ca>,
	"Al Viro" <viro@zeniv.linux.org.uk>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	"Jan Kara" <jack@suse.cz>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	linux-riscv@lists.infradead.org, "Theodore Ts'o" <tytso@mit.edu>,
	"Ext4 Developers List" <linux-ext4@vger.kernel.org>,
	"Conor Dooley" <conor@kernel.org>,
	"Anders Roxell" <anders.roxell@linaro.org>,
	"Alexandre Ghiti" <alex@ghiti.fr>
Subject: Re: riscv32 EXT4 splat, 6.8 regression?
Date: Tue, 16 Apr 2024 21:34:51 +0300	[thread overview]
Message-ID: <Zh7Ey507KXIak8NW@kernel.org> (raw)
In-Reply-To: <Zh6urRin2-wVxNeq@casper.infradead.org>

On Tue, Apr 16, 2024 at 06:00:29PM +0100, Matthew Wilcox wrote:
> On Tue, Apr 16, 2024 at 07:31:54PM +0300, Mike Rapoport wrote:
> > > @@ -238,17 +237,9 @@ static void __init setup_bootmem(void)
> > >  	/*
> > >  	 * memblock allocator is not aware of the fact that last 4K bytes of
> > >  	 * the addressable memory can not be mapped because of IS_ERR_VALUE
> > > -	 * macro. Make sure that last 4k bytes are not usable by memblock
> > > -	 * if end of dram is equal to maximum addressable memory.  For 64-bit
> > > -	 * kernel, this problem can't happen here as the end of the virtual
> > > -	 * address space is occupied by the kernel mapping then this check must
> > > -	 * be done as soon as the kernel mapping base address is determined.
> > > +	 * macro. Make sure that last 4k bytes are not usable by memblock.
> > >  	 */
> > 
> > It's not only memblock, but buddy as well, so maybe
> > 
> > 	/*
> > 	 * The last 4K bytes of the addressable memory can not be used
> > 	 * because of IS_ERR_VALUE macro. Make sure that last 4K bytes are
> > 	 * not usable by kernel memory allocators.
> > 	 */
> > 
> > > -	if (!IS_ENABLED(CONFIG_64BIT)) {
> > > -		max_mapped_addr = __pa(~(ulong)0);
> > > -		if (max_mapped_addr == (phys_ram_end - 1))
> > > -			memblock_set_current_limit(max_mapped_addr - 4096);
> > > -	}
> > > +	memblock_reserve(__pa(-PAGE_SIZE), PAGE_SIZE);
> > 
> > Ack.
> 
> Can this go to generic code instead of letting architecture maintainers
> fall over it?

Yes, it's just have to happen before setup_arch() where most architectures
enable memblock allocations.

-- 
Sincerely yours,
Mike.

WARNING: multiple messages have this Message-ID (diff)
From: Mike Rapoport <rppt@kernel.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: "Nam Cao" <namcao@linutronix.de>,
	"Björn Töpel" <bjorn@kernel.org>,
	"Christian Brauner" <brauner@kernel.org>,
	"Andreas Dilger" <adilger@dilger.ca>,
	"Al Viro" <viro@zeniv.linux.org.uk>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	"Jan Kara" <jack@suse.cz>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	linux-riscv@lists.infradead.org, "Theodore Ts'o" <tytso@mit.edu>,
	"Ext4 Developers List" <linux-ext4@vger.kernel.org>,
	"Conor Dooley" <conor@kernel.org>,
	"Anders Roxell" <anders.roxell@linaro.org>,
	"Alexandre Ghiti" <alex@ghiti.fr>
Subject: Re: riscv32 EXT4 splat, 6.8 regression?
Date: Tue, 16 Apr 2024 21:34:51 +0300	[thread overview]
Message-ID: <Zh7Ey507KXIak8NW@kernel.org> (raw)
In-Reply-To: <Zh6urRin2-wVxNeq@casper.infradead.org>

On Tue, Apr 16, 2024 at 06:00:29PM +0100, Matthew Wilcox wrote:
> On Tue, Apr 16, 2024 at 07:31:54PM +0300, Mike Rapoport wrote:
> > > @@ -238,17 +237,9 @@ static void __init setup_bootmem(void)
> > >  	/*
> > >  	 * memblock allocator is not aware of the fact that last 4K bytes of
> > >  	 * the addressable memory can not be mapped because of IS_ERR_VALUE
> > > -	 * macro. Make sure that last 4k bytes are not usable by memblock
> > > -	 * if end of dram is equal to maximum addressable memory.  For 64-bit
> > > -	 * kernel, this problem can't happen here as the end of the virtual
> > > -	 * address space is occupied by the kernel mapping then this check must
> > > -	 * be done as soon as the kernel mapping base address is determined.
> > > +	 * macro. Make sure that last 4k bytes are not usable by memblock.
> > >  	 */
> > 
> > It's not only memblock, but buddy as well, so maybe
> > 
> > 	/*
> > 	 * The last 4K bytes of the addressable memory can not be used
> > 	 * because of IS_ERR_VALUE macro. Make sure that last 4K bytes are
> > 	 * not usable by kernel memory allocators.
> > 	 */
> > 
> > > -	if (!IS_ENABLED(CONFIG_64BIT)) {
> > > -		max_mapped_addr = __pa(~(ulong)0);
> > > -		if (max_mapped_addr == (phys_ram_end - 1))
> > > -			memblock_set_current_limit(max_mapped_addr - 4096);
> > > -	}
> > > +	memblock_reserve(__pa(-PAGE_SIZE), PAGE_SIZE);
> > 
> > Ack.
> 
> Can this go to generic code instead of letting architecture maintainers
> fall over it?

Yes, it's just have to happen before setup_arch() where most architectures
enable memblock allocations.

-- 
Sincerely yours,
Mike.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2024-04-16 18:36 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-12 14:57 riscv32 EXT4 splat, 6.8 regression? Björn Töpel
2024-04-12 14:57 ` Björn Töpel
2024-04-12 15:43 ` Theodore Ts'o
2024-04-12 15:43   ` Theodore Ts'o
2024-04-12 16:59   ` Björn Töpel
2024-04-12 16:59     ` Björn Töpel
2024-04-13  4:35     ` Theodore Ts'o
2024-04-13  4:35       ` Theodore Ts'o
2024-04-13 10:01       ` Conor Dooley
2024-04-13 10:01         ` Conor Dooley
2024-04-13 14:43 ` Nam Cao
2024-04-13 14:43   ` Nam Cao
2024-04-14  0:24   ` Theodore Ts'o
2024-04-14  0:24     ` Theodore Ts'o
2024-04-14  1:46   ` Andreas Dilger
2024-04-14  1:46     ` Andreas Dilger
2024-04-14  2:04     ` Theodore Ts'o
2024-04-14  2:04       ` Theodore Ts'o
2024-04-14  2:18       ` Al Viro
2024-04-14  2:18         ` Al Viro
2024-04-14  2:15     ` Al Viro
2024-04-14  2:15       ` Al Viro
2024-04-14  4:16       ` Andreas Dilger
2024-04-14  4:16         ` Andreas Dilger
2024-04-14 14:08         ` Björn Töpel
2024-04-14 14:08           ` Björn Töpel
2024-04-15 13:04           ` Christian Brauner
2024-04-15 13:04             ` Christian Brauner
2024-04-15 16:04             ` Björn Töpel
2024-04-15 16:04               ` Björn Töpel
2024-04-16  6:44               ` Nam Cao
2024-04-16  6:44                 ` Nam Cao
2024-04-16  8:25                 ` Christian Brauner
2024-04-16  8:25                   ` Christian Brauner
2024-04-16 11:02                   ` Björn Töpel
2024-04-16 11:02                     ` Björn Töpel
2024-04-16 14:24                     ` Mike Rapoport
2024-04-16 14:24                       ` Mike Rapoport
2024-04-16 15:17                       ` Nam Cao
2024-04-16 15:17                         ` Nam Cao
2024-04-16 15:30                         ` Nam Cao
2024-04-16 15:30                           ` Nam Cao
2024-04-16 15:56                           ` Björn Töpel
2024-04-16 15:56                             ` Björn Töpel
2024-04-16 16:19                             ` Nam Cao
2024-04-16 16:19                               ` Nam Cao
2024-04-16 16:31                               ` Mike Rapoport
2024-04-16 16:31                                 ` Mike Rapoport
2024-04-16 17:00                                 ` Matthew Wilcox
2024-04-16 17:00                                   ` Matthew Wilcox
2024-04-16 18:34                                   ` Mike Rapoport [this message]
2024-04-16 18:34                                     ` Mike Rapoport
2024-04-16 22:36                                     ` Nam Cao
2024-04-16 22:36                                       ` Nam Cao
2024-04-17 15:31                                       ` Theodore Ts'o
2024-04-17 15:31                                         ` Theodore Ts'o
2024-04-17 18:06                                         ` Nam Cao
2024-04-17 18:06                                           ` Nam Cao
2024-04-17 19:34                                       ` Mike Rapoport
2024-04-17 19:34                                         ` Mike Rapoport
2024-04-17 22:09                                       ` Andreas Dilger
2024-04-17 22:09                                         ` Andreas Dilger
2024-04-18  9:17                                         ` Nam Cao
2024-04-18  9:17                                           ` Nam Cao
2024-04-16 18:05                               ` Björn Töpel
2024-04-16 18:05                                 ` Björn Töpel
2024-04-16 18:09                                 ` Nam Cao
2024-04-16 18:09                                   ` Nam Cao
2024-04-16 16:19                         ` Mike Rapoport
2024-04-16 16:19                           ` Mike Rapoport
2024-04-16 16:31                           ` Matthew Wilcox
2024-04-16 16:31                             ` Matthew Wilcox
2024-04-16 18:18                             ` Mike Rapoport
2024-04-16 18:18                               ` Mike Rapoport

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=Zh7Ey507KXIak8NW@kernel.org \
    --to=rppt@kernel.org \
    --cc=adilger@dilger.ca \
    --cc=alex@ghiti.fr \
    --cc=anders.roxell@linaro.org \
    --cc=bjorn@kernel.org \
    --cc=brauner@kernel.org \
    --cc=conor@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=namcao@linutronix.de \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    /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.