Re: [PATCH] mm: make 'highmem' symbol ro_after_init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 26 Jan 2022 at 22:38, Mike Rapoport <rppt@xxxxxxxxxx> wrote:
>
> On Mon, Jan 24, 2022 at 06:05:55PM +0100, Ard Biesheuvel wrote:
> > The 'highmem' variable is only set at boot, so we can make it
> > ro_after_init and prevent it from being corrupted inadvertently, or from
> > ending up in a contended cacheline.
> >
> > Signed-off-by: Ard Biesheuvel <ardb@xxxxxxxxxx>
>
> Acked-by: Mike Rapoport <rppt@xxxxxxxxxxxxx>
>
> > ---
> >  mm/memory.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/mm/memory.c b/mm/memory.c
> > index c125c4969913..50e82cb94ccc 100644
> > --- a/mm/memory.c
> > +++ b/mm/memory.c
> > @@ -106,7 +106,7 @@ EXPORT_SYMBOL(mem_map);
> >   * highstart_pfn must be the same; there must be no gap between ZONE_NORMAL
> >   * and ZONE_HIGHMEM.
> >   */
> > -void *high_memory;
> > +void *high_memory __ro_after_init;
> >  EXPORT_SYMBOL(high_memory);
> >
> >  /*
> > --
> > 2.30.2
> >
> >
>


This turns out to break CONFIG_MEMORY_HOTPLUG on x86, as it updates
max_pfn, max_low_pfn and high_memory after init.

So probably best to make all of those __read_mostly instead.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux