From patchwork Sat Sep 14 01:53:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13804145 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 EDE68FC6189 for ; Sat, 14 Sep 2024 01:59:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 485536B007B; Fri, 13 Sep 2024 21:59:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 435686B0082; Fri, 13 Sep 2024 21:59:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 323E26B0083; Fri, 13 Sep 2024 21:59:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 1414E6B007B for ; Fri, 13 Sep 2024 21:59:14 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 8489D812BC for ; Sat, 14 Sep 2024 01:59:13 +0000 (UTC) X-FDA: 82561686186.04.67C6C85 Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by imf08.hostedemail.com (Postfix) with ESMTP id BBBCB160012 for ; Sat, 14 Sep 2024 01:59:10 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf08.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.35 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1726279073; a=rsa-sha256; cv=none; b=xrNjaprGOoHOKYsNkNXiURW5FQSFzxvlxr7+ngZbSRh/6+Y8jwfYtVJCyf+L54/LR8Q9b3 QzNsY0xhPN8gM5RZwDvF9vmPBe6scFRMzjhLXkLQ91p6SWJEzJFPz0rUqAFkY6yL3HqCJ7 Fkce5vKLOM/fOTsKPX3NG8DUz91iRU4= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf08.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.35 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1726279073; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=LxTRqYRt7MmYkitnEaWP31sSTjqP/AFi0+AU+2SN/eU=; b=bm4xRBovuSJzaws6hl2eHy5igobLvMizpz5gwsA6Watywvlhv3smrVd/VsQ0k3v8kiJByo TviVcKUz4ThuUIThuLBI8MelGuha1NZSvh8alYASOCFHeRMq49eKk0v+/JnHx0OQhEPcfK LOJxAcdYMaxE2dxV6mqR/HhmlUbQRKY= Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4X5DqD4K1xz1S9vR; Sat, 14 Sep 2024 09:58:32 +0800 (CST) Received: from kwepemd200019.china.huawei.com (unknown [7.221.188.193]) by mail.maildlp.com (Postfix) with ESMTPS id E0CA21401F4; Sat, 14 Sep 2024 09:59:05 +0800 (CST) Received: from huawei.com (10.173.127.72) by kwepemd200019.china.huawei.com (7.221.188.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Sat, 14 Sep 2024 09:59:05 +0800 From: Miaohe Lin To: CC: , , , , Subject: [PATCH] mm/huge_memory: ensure huge_zero_folio won't have large_rmappable flag set Date: Sat, 14 Sep 2024 09:53:06 +0800 Message-ID: <20240914015306.3656791-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-Originating-IP: [10.173.127.72] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemd200019.china.huawei.com (7.221.188.193) X-Rspamd-Queue-Id: BBBCB160012 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 8k6oxfkicbpjy6tn7jmas8sdkdcupcf5 X-HE-Tag: 1726279150-659486 X-HE-Meta: U2FsdGVkX1+igIKRhStakS4e+bS0vAug7sL4kco/WizYacngZXLmvfLHaD+YBnHiM4FiVwaWKJSNqWUSGGAK6m1+/pWjbl8N4qecnngnsqaMiiBobqA8PxPwBvmchba4zSuiSXavB56WkJtfw3DfS17FxHOodmDK2oQOidH7PbV6MOwTv2bE8jURBupCjTz7Xsrk1BUTlwyy7uDWHCXKUHtv6l0AOiyI2hVOK73PRFCCGt4bIKZbMMLrUTkSboBS/mYjMRPnX9aVofTCbuTiE+KzFkjK/T/1arW6cnmXJUR4S+bwA6gkk82KfVTPvSr3R0ULC08jgyAvKch1QNKvjeUqpRt3bwfLUcDfkO4SiqZsjvKgmQyu3qjJCr3CqpNV93yvsUv3mv3T+w/6ofYEJcIC7qB1kSjhyTwZYOaRL2QLMZDw3WOeCPS5qzWZI6WIrsCgpxQi1/romNjia5WVv70buVhISvlN3Fjo68fTcofmDRP0UIZVc5KvxSpHLg5m4LHn/mOPHN7Gq+zPF/GSuBGiCl8hrnJmsMNBvIrdCw/i8nKX+idBUg5hx9xJjzno7+jFIGlosOH+JVamy+B3C/BWCVLW2KpLiekLUtZ3BxelwX2H3/rvRnZ4l8HAJgA2oWOsG6NDID3yvyNI5XjnC4BLh79WBTvYqeNNdxRgyjAKlTTGLVvyaMZmAx0Z618o3Buj55y49vIKnLKgjgUZ3d20MT/mjuLS3P8S5bMIEP03xYO58ADR22tDpANec7gxYvjUe7G2yS4rk3dqAJ/xJe6bk0SoA2x6WcA2XijgTel2P3YIsZXD3celaSKrA0HxGmp6p43tuwKkQI08m0g5Hu5X4wA5hpDkl5+ZjeL3iEAc23g6HzaixuL+fRxkZswJkj+gWYN42otKS3UmgizUsVIK88PsPTNIU3g3fafLEfd4o4sNT2LBfW/eUhajgiPf2WURBTHPHHIATBy3PV5 yJK8AzJG lq8Yk4cxuXAzxA3FskT86Ab1t/pO2CRpjVxDV61w+gEbtXvsM0N7zAeapvy6awRiCa7cI3J7elcOPNKJY7lIvBURis0SRANmhrw31Kcw8XXMbGJpB4cUi8qYcFck0EAOPC0BhsfV6Zzr52xtJsf9/ef3yw+XqSmLPZ4Vhy0IqKu4wK3+DoazlWo4hTw== 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: List-Subscribe: List-Unsubscribe: Ensure huge_zero_folio won't have large_rmappable flag set. So it can be reported as thp,zero correctly through stable_page_flags(). Fixes: 5691753d73a2 ("mm: convert huge_zero_page to huge_zero_folio") Signed-off-by: Miaohe Lin --- mm/huge_memory.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 2a73efea02d7..4e34b7f89daf 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -218,6 +218,8 @@ static bool get_huge_zero_page(void) count_vm_event(THP_ZERO_PAGE_ALLOC_FAILED); return false; } + /* Ensure zero folio won't have large_rmappable flag set. */ + folio_clear_large_rmappable(zero_folio); preempt_disable(); if (cmpxchg(&huge_zero_folio, NULL, zero_folio)) { preempt_enable();