linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: make 'highmem' symbol ro_after_init
@ 2022-01-24 17:05 Ard Biesheuvel
  2022-01-24 18:17 ` David Rientjes
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ard Biesheuvel @ 2022-01-24 17:05 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, Ard Biesheuvel

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@kernel.org>
---
 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



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-01-28  9:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-24 17:05 [PATCH] mm: make 'highmem' symbol ro_after_init Ard Biesheuvel
2022-01-24 18:17 ` David Rientjes
2022-01-24 18:31 ` Matthew Wilcox
2022-01-26 21:38 ` Mike Rapoport
2022-01-28  9:07   ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).