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 X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6CCE2C11F66 for ; Wed, 14 Jul 2021 12:37:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 02E5A613D2 for ; Wed, 14 Jul 2021 12:37:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 02E5A613D2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2BB796B0083; Wed, 14 Jul 2021 08:37:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 277B46B0085; Wed, 14 Jul 2021 08:37:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 133D86B0088; Wed, 14 Jul 2021 08:37:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0022.hostedemail.com [216.40.44.22]) by kanga.kvack.org (Postfix) with ESMTP id E54E96B0083 for ; Wed, 14 Jul 2021 08:37:47 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B5DF982F3CC7 for ; Wed, 14 Jul 2021 12:37:46 +0000 (UTC) X-FDA: 78361144932.14.D6AD1A2 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf28.hostedemail.com (Postfix) with ESMTP id 7114E900009F for ; Wed, 14 Jul 2021 12:37:46 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id EA3FA613B2; Wed, 14 Jul 2021 12:37:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626266265; bh=MyPP3ysLnfTJLvyibD3l2UlFIkzFdXWBmuEZG/TSVPk=; h=From:To:Cc:Subject:Date:From; b=HLXH1K30fK5FCwC5EXrm1k4OgLay4d4qd027S0BgGNFmI6CRmAg4Iqaxv1EX6Rg7B LgEomgvD5TucICoERiWzby1PiLf779f5ri3KJZLLmJVbykiD2bzRtUZs/z2/cbGg2A WsUzLOVfq3aHS2grHWyDHdzURJbOFhAB0qPBDS19LxbdEKpKZSV5cDJk4GMC8i50qm phoXbyadDg/N52auD39g9iOh6QwHfXLgx9U4sGA2bkiHDViUrZd8Az76ltdKB/nTau 1eZLOn3/ALZ37UB3PBrSYxscFkfCv5PJ8x4vAn5bnDglEJkC7KaVp2BRVq8Cqfq7lC dJvEMEAOnOn7A== From: Mike Rapoport To: Andrew Morton Cc: Michal Simek , Mike Rapoport , Mike Rapoport , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 0/4] mm: ensure consistency of memory map poisoning Date: Wed, 14 Jul 2021 15:37:35 +0300 Message-Id: <20210714123739.16493-1-rppt@kernel.org> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=HLXH1K30; spf=pass (imf28.hostedemail.com: domain of rppt@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Stat-Signature: 4a8xmk88im15t5a6eyoarj3a8omtybat X-Rspamd-Queue-Id: 7114E900009F X-Rspamd-Server: rspam01 X-HE-Tag: 1626266266-514722 Content-Transfer-Encoding: quoted-printable 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: From: Mike Rapoport Hi, Currently memory map allocation for FLATMEM case does not poison the stru= ct pages regardless of CONFIG_PAGE_POISON setting. This happens because allocation of the memory map for FLATMEM and SPARSME= M use different memblock functions and those that are used for SPARSMEM cas= e (namely memblock_alloc_try_nid_raw() and memblock_alloc_exact_nid_raw()) implicitly poison the allocated memory. Another side effect of this implicit poisoning is that early setup code that uses the same functions to allocate memory burns cycles for the memo= ry poisoning even if it was not intended. These patches introduce memmap_alloc() wrapper that ensure that the memor= y map allocation is consistent for different memory models. Mike Rapoport (4): mm/page_alloc: always initialize memory map for the holes microblaze: simplify pte_alloc_one_kernel() mm: introduce memmap_alloc() to unify memory map allocation memblock: stop poisoning raw allocations arch/microblaze/include/asm/pgtable.h | 2 -- arch/microblaze/mm/init.c | 12 ---------- arch/microblaze/mm/pgtable.c | 17 +++++++------- mm/internal.h | 4 ++++ mm/memblock.c | 20 ++++------------- mm/page_alloc.c | 32 ++++++++++++++++++--------- mm/sparse.c | 6 ++--- 7 files changed, 40 insertions(+), 53 deletions(-) base-commit: e73f0f0ee7541171d89f2e2491130c7771ba58d3 --=20 2.28.0