From patchwork Mon Jan 24 17:05:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 12722421 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 07E25C433F5 for ; Mon, 24 Jan 2022 17:06:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 61B796B00AB; Mon, 24 Jan 2022 12:06:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5CB066B00AD; Mon, 24 Jan 2022 12:06:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4B9796B00AE; Mon, 24 Jan 2022 12:06:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0070.hostedemail.com [216.40.44.70]) by kanga.kvack.org (Postfix) with ESMTP id 3DC5F6B00AB for ; Mon, 24 Jan 2022 12:06:26 -0500 (EST) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id F03548849E for ; Mon, 24 Jan 2022 17:06:25 +0000 (UTC) X-FDA: 79065809130.31.C54E15B Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf20.hostedemail.com (Postfix) with ESMTP id 76AFB1C0016 for ; Mon, 24 Jan 2022 17:06:25 +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 dfw.source.kernel.org (Postfix) with ESMTPS id D1ECE611AD; 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 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 76AFB1C0016 X-Stat-Signature: dau3gd8hiy334ce38b69nmzmqgzzy1bh Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=K7n6xytu; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf20.hostedemail.com: domain of ardb@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=ardb@kernel.org X-HE-Tag: 1643043985-59260 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: 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); /*