From: Kefeng Wang Date: Mon, 12 Jan 2026 15:09:54 +0000 (+0800) Subject: mm: hugetlb_cma: mark hugetlb_cma{_only} as __ro_after_init X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae85e5610813c9904ea4a111bf47edd1940ebf63;p=thirdparty%2Fkernel%2Flinux.git mm: hugetlb_cma: mark hugetlb_cma{_only} as __ro_after_init hugetlb_cma and hugetlb_cma_only are initialized once during init and never changed. Link: https://lkml.kernel.org/r/20260112150954.1802953-6-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Acked-by: Zi Yan Acked-by: Muchun Song Cc: Brendan Jackman Cc: David Hildenbrand Cc: Jane Chu Cc: Johannes Weiner Cc: Matthew Wilcox (Oracle) Cc: Oscar Salvador Cc: Sidhartha Kumar Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- diff --git a/mm/hugetlb_cma.c b/mm/hugetlb_cma.c index d8fa93825992f..f83ae4998990f 100644 --- a/mm/hugetlb_cma.c +++ b/mm/hugetlb_cma.c @@ -13,9 +13,9 @@ #include "hugetlb_cma.h" -static struct cma *hugetlb_cma[MAX_NUMNODES]; +static struct cma *hugetlb_cma[MAX_NUMNODES] __ro_after_init; static unsigned long hugetlb_cma_size_in_node[MAX_NUMNODES] __initdata; -static bool hugetlb_cma_only; +static bool hugetlb_cma_only __ro_after_init; static unsigned long hugetlb_cma_size __ro_after_init; void hugetlb_cma_free_frozen_folio(struct folio *folio)