Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3535292pxb; Mon, 24 Jan 2022 11:38:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJx8HNZ29Ua/fKHFIN818pQ0LOBMzS2/X9gAZEkoFB9b91uTiwyWDyct7ZcnZQGOMXqoAs2Y X-Received: by 2002:a17:902:868d:b0:14a:d70d:a29a with SMTP id g13-20020a170902868d00b0014ad70da29amr15846709plo.5.1643053106408; Mon, 24 Jan 2022 11:38:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643053106; cv=none; d=google.com; s=arc-20160816; b=vvCpEbvFA6Gp7bBBIkakUxObJ44GxZGIBJoThyQ+tCRAWsymZUAAcSsZ2nG9kotQ6V 67OlcTJIpEOR1Q4WNWg3GCam00OReDr5+QgDghrxWXGbQ28rXXUI7xeFyb7wXCCq1Pih gc0F1UhcHEgSGF3yXCLXmrnIv6n11nzojWk8v3KxYknt4J4oZA1tidMpv0l2MpM6d1lD x2NjOpHl4AakjD0IDvS68bc8JbvxZvroHEE4WkltTfmFVCIUDE59qN9UzC/q0FqNUNxE 3m75p/62TcVKsF8QbNH0o4yZW93C4ZyodUyP9+AXMFtLRvZrbSOmC2u3m8fPgwXKIxz9 lTtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=oxYXEFeMVLArM40Ugmx4czwpziRn4GBXFXD2IuVXMJU=; b=pGGbLe9jVArMPCEuJBF9Qt1WAVPSQ8/q1s8R8n2JqfPftSIq7v48fBJx6fpi0glKgl nrhULAM0KqXGFQ7V14qLIitEiBrkg6NB6t3wQUvER/73UUFu5RXjSIgsNEXY3AqX7gvn lTYfrrP6Z5piKTIH2N6dPvBcjLso0NPPkOyeBVZ2qCgY4g0/Zv68N/gJFFgB9b9+9MiA JEQe4c4iHfqG1y50ZZ/z18vuXl6b392DHJ37AjM132Q1xTs3z7cuO4CXM1sscV8+vFii ALPPlhNWXEM6RnfVcBeU3+PJyO4eE28vGpHDP0j32FpzcHCgLZsg5X35qbhEQOjonAUE 38OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=K7n6xytu; 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 j63si8609338pgd.54.2022.01.24.11.38.09; Mon, 24 Jan 2022 11:38:26 -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=K7n6xytu; 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 S241329AbiAXRGF (ORCPT + 99 others); Mon, 24 Jan 2022 12:06:05 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:48234 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231960AbiAXRGE (ORCPT ); Mon, 24 Jan 2022 12:06:04 -0500 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 D21A86119C for ; Mon, 24 Jan 2022 17:06:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39F29C340E5; Mon, 24 Jan 2022 17:06:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643043963; bh=O07YupI0AYFRjtSwOnJ9QeNbZU+KNz5x1PyE7VbLSf0=; h=From:To:Cc:Subject:Date:From; b=K7n6xytunBbkNMCJaMqlcZj9uy7ls2UstQ5fHGNbEudbEhI3P29m/dwJaewtzfLVS XfN/sDpmYTsLj0YGdA1UO9SbHUx85uYEuDYVqCt+eYHeEXvBGo06XYVdXi6clnAVuz 0MsqcvkD5aGlylJZn8rMeXrPn8wQQ9qfe3nPQhPd2toUiZNLHL/EoEqMkduw7bIPVV ERZSxup31rgdRLrs38BDsbgFFh2RmDqPfegT1aOR9SAZCaIKGJEJSctL492W225sWV 596Y5XE72YBbCHZfAMZtZZrJIrADvRAd8s4CW9TeTpZmaoZbgEAKi7i++Eox6hnszC GG3TDjeB8WGhg== From: Ard Biesheuvel To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Ard Biesheuvel Subject: [PATCH] mm: make 'highmem' symbol ro_after_init Date: Mon, 24 Jan 2022 18:05:55 +0100 Message-Id: <20220124170555.1054480-1-ardb@kernel.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=681; h=from:subject; bh=O07YupI0AYFRjtSwOnJ9QeNbZU+KNz5x1PyE7VbLSf0=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBh7txyo6jtAOHE1+I/AryJ5nBk6LIn5EsN1sXih4M7 6mXsP4uJAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCYe7ccgAKCRDDTyI5ktmPJLE6DA Cj8IaD/hrKBzzk677LeV6tdJ0ILJ+6Z11g2KScQQ6C17ylXBopOKja1jePt4SduhtEcxZIfAHa6Ife zqPAssSTdAGWbfaCK7H7I0zAuXWa+1vqHiQQAsm0qKRj6mHbxxd5CaY12emXBbTFL2z90F5e1sm3W0 qkVW+Lfbv2RbSani3z8s1aGueI8mho/RqUnCeNHnhitStWXYmwrZRC98GBvI5cs9ataIz3EGjMbVet Qh06GAllexN7thblDw7uKX+81o23lX+4HmgBN7nEkhwyX8sn5u2P4Bzmchrb7WBWlK/ectQDyDCB+p 4P4CpGX0oGfVBoz02dxYbAWEIxj/D4AOv+zxf8DDIElpO9omdSSVSfNlSl6qEECDJWAhlW6ZHP9nHj HhLNkc4N3eJH5zu2S1SGj+wS8mw8c3QwopCKfSJ82CxLJMwAEPnFbr+15YsUqqYirRtGhmAokBV3ro mgOW5LJxJdV5vRbpaZ1XkitR5HjqBo0lnXFaBcvL1jBCQ= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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