From patchwork Tue Mar 29 13:09:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Wandun X-Patchwork-Id: 12794828 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 1ACE2C433EF for ; Tue, 29 Mar 2022 12:50:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 892678D0002; Tue, 29 Mar 2022 08:50:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 81A8A8D0001; Tue, 29 Mar 2022 08:50:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6BC458D0002; Tue, 29 Mar 2022 08:50:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id 567208D0001 for ; Tue, 29 Mar 2022 08:50:54 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 16CBE417 for ; Tue, 29 Mar 2022 12:50:54 +0000 (UTC) X-FDA: 79297408428.13.6DB4D9D Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf11.hostedemail.com (Postfix) with ESMTP id 0245640018 for ; Tue, 29 Mar 2022 12:50:52 +0000 (UTC) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4KSTpZ4sXwzBrg5; Tue, 29 Mar 2022 20:46:46 +0800 (CST) Received: from dggpemm500002.china.huawei.com (7.185.36.229) by dggpemm500021.china.huawei.com (7.185.36.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 29 Mar 2022 20:50:49 +0800 Received: from localhost.localdomain (10.175.112.125) by dggpemm500002.china.huawei.com (7.185.36.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 29 Mar 2022 20:50:48 +0800 From: Chen Wandun To: , , Subject: [PATCH 0/2] fix several contiguous memmap assumptions Date: Tue, 29 Mar 2022 21:09:26 +0800 Message-ID: <20220329130928.266323-1-chenwandun@huawei.com> X-Mailer: git-send-email 2.18.0.huawei.25 MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500002.china.huawei.com (7.185.36.229) X-CFilter-Loop: Reflected X-Stat-Signature: gp3o9x81sqrm648foynstaw4gdahgn5r Authentication-Results: imf11.hostedemail.com; dkim=none; spf=pass (imf11.hostedemail.com: domain of chenwandun@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=chenwandun@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 0245640018 X-HE-Tag: 1648558252-350841 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000177, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: It isn't true for only SPARSEMEM configs to assume that a compound page has virtually contiguous page structs, so use nth_page to iterate each page. Inspired by: https://lore.kernel.org/linux-mm/20220204195852.1751729-8-willy@infradead.org/ Chen Wandun (2): mm: fix contiguous memmap assumptions about split page mm: fix contiguous memmap assumptions about alloc/free pages include/linux/mm.h | 2 ++ mm/compaction.c | 6 +++--- mm/huge_memory.c | 2 +- mm/page_alloc.c | 14 ++++++++------ 4 files changed, 14 insertions(+), 10 deletions(-)