Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2299925pxb; Sun, 30 Jan 2022 11:13:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJz/Eyyt3HSxGqv3vl/a0G9+nSANN+w+oox74mnq02aGIZetOGm38kWLMKKwBGpDTD5uACYC X-Received: by 2002:a17:907:7f11:: with SMTP id qf17mr14738162ejc.110.1643570015625; Sun, 30 Jan 2022 11:13:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643570015; cv=none; d=google.com; s=arc-20160816; b=m9kFiNPhLkrfOBgPRLQI1xfahDaMYmBEMMPTLPKLMu4UvNWBIzqkQ+tyM6YTekX/dV ktmilvpXebHTOo+P/C3cki+DG7wTXcePaGcLAlGKLOxL82LBxCpBDNEOixx9OYPJqR8J In8jf58Ih9t73Y2eXgrpOI1sfwppLdUNPsd3gYt5S+404L0VQsUbiGFfVy5xP8Ji6A4F 9OKkwpbmT0WqSsN43mmGfZe/Jt9t9V0lkBHHluFtNUCIoARXcS8j3GIEVqiRT5dIMHol p58pwLfGlLqxFDwtW230GCAOezzPTWeyD2VPH9HRapMG7yx32J9elihGI0TcRfz79Xrv xFyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=777mkoiSvsXtKtioXUmA8eU8WjWknzIRkmhF87Rk/rM=; b=LYFECWij0ufPjaTnLsYQ1o4AFWr6lR00jGmydx5N/PPyR+irOe6pYsbZRZzfd2flHb srI+khFYyCGs1im4clDD9v2PG1bjVdADNGOq16RIorwlHz2EYdDbdlZJ/hOxaWJbAU2a Qe4TVlC/FFKSaPVrLOz72tOAMnZHyxH5SetqXv0AJYQ1QHKMTa7/PwfUbLtdOmbYv68n IGty2cYZZnVzMH1IblX4uF+FSiuapHOhu0x/kqAShZHKMVE3meerZopbRlvJYLWZYvst i81zld7NCpJEkmTYM68rGlPYqPnKFrr6wdO/C00Q3Togh/EbllMqcLW6xczElc9okmQ3 fb3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Mvd473Ql; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jg32si7636921ejc.836.2022.01.30.11.13.11; Sun, 30 Jan 2022 11:13:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Mvd473Ql; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347422AbiA1JIK (ORCPT + 99 others); Fri, 28 Jan 2022 04:08:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243205AbiA1JII (ORCPT ); Fri, 28 Jan 2022 04:08:08 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E8E5C061714 for ; Fri, 28 Jan 2022 01:08:08 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3DE3561DD4 for ; Fri, 28 Jan 2022 09:08:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E483C340E6 for ; Fri, 28 Jan 2022 09:08:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643360887; bh=MBPptDMDLXtaR5MsyxmkNUko6KgF89JBb4LWE/5IspQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Mvd473QlfFn4YG9t+8AZ1ZOY9dYFmVntTj4atlc8TjJZyIaiwnC10Eee6mXQW2Iyt agYKYWHhG6dcy/xQrGjtQnE3fDVWHFB2GWHi786hVoiqSnto1pjvtIziSabz4gS09w Mhw7SkFUkNm4PYoPDR3HFDq6ei0VtDlG8XJsCiqbACAW4Qj1T7itBgYP6WnxlzClPq +opLhRlbFrfDCrgJjyD0XZWEVXCg6plz5tAG1NV7qcPaNac2uo/dVCtOizLTNeCV6c PBnTTYpK5qpuRY1jHhmUg8noE+Gw9SUYWBygQcLhl0qO5iDBufTtYu+4YE8km5/kZV +ZIVacsWUVpaw== Received: by mail-wm1-f50.google.com with SMTP id f202-20020a1c1fd3000000b0034dd403f4fbso3594758wmf.1 for ; Fri, 28 Jan 2022 01:08:07 -0800 (PST) X-Gm-Message-State: AOAM5303bXNWyGE3rg/1SNYON36tRWU8tpjkdRmRVbEkOtfTjWxpjvxq lQK7TgR8+wmFoUqqT1EvrqUXXkbE86/MEKFfTO8= X-Received: by 2002:a05:600c:a47:: with SMTP id c7mr6538271wmq.25.1643360885904; Fri, 28 Jan 2022 01:08:05 -0800 (PST) MIME-Version: 1.0 References: <20220124170555.1054480-1-ardb@kernel.org> In-Reply-To: From: Ard Biesheuvel Date: Fri, 28 Jan 2022 10:07:54 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mm: make 'highmem' symbol ro_after_init To: Mike Rapoport Cc: Andrew Morton , Linux Memory Management List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 26 Jan 2022 at 22:38, Mike Rapoport 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 > > Acked-by: Mike Rapoport > > > --- > > 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.