From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A2E3C433EF for ; Fri, 28 Jan 2022 09:08:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 974056B0071; Fri, 28 Jan 2022 04:08:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9223F6B0072; Fri, 28 Jan 2022 04:08:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 811306B0073; Fri, 28 Jan 2022 04:08:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0232.hostedemail.com [216.40.44.232]) by kanga.kvack.org (Postfix) with ESMTP id 711EB6B0071 for ; Fri, 28 Jan 2022 04:08:11 -0500 (EST) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 1EE158F6FB for ; Fri, 28 Jan 2022 09:08:11 +0000 (UTC) X-FDA: 79079119182.05.AA2BB55 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf07.hostedemail.com (Postfix) with ESMTP id AB0C440047 for ; Fri, 28 Jan 2022 09:08:10 +0000 (UTC) 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 ams.source.kernel.org (Postfix) with ESMTPS id C747FB824CF for ; Fri, 28 Jan 2022 09:08:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A37F2C340EC 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-f45.google.com with SMTP id q141-20020a1ca793000000b00347b48dfb53so3615365wme.0 for ; Fri, 28 Jan 2022 01:08:07 -0800 (PST) X-Gm-Message-State: AOAM533tAtNWqGfr5FrrP/s39coz8U1T226lNmL0GvX7Ze01m0ifBDW0 95ytpEgc4zhwVcF+BymJlKGQ5btZJ3tWoLCC8oM= X-Google-Smtp-Source: ABdhPJxjT5/5vck5qJabBN55fX7BJ0vvbma1AuCDsJeN+RrvQ2LQEWctCgqI5L+HxoJd55ca5kY53enpOFJeSAdY2ZY= 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" X-Rspam-User: nil X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: AB0C440047 X-Stat-Signature: dxqku36p39yqqysqpfqbas48wcx9xb6f Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Mvd473Ql; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf07.hostedemail.com: domain of ardb@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=ardb@kernel.org X-HE-Tag: 1643360890-855921 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.