From patchwork Mon Nov 13 15:22:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13454125 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 7859DC072A2 for ; Mon, 13 Nov 2023 15:22:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1D43F6B024A; Mon, 13 Nov 2023 10:22:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 098B16B024E; Mon, 13 Nov 2023 10:22:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EC8766B024F; Mon, 13 Nov 2023 10:22:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id D7C716B024A for ; Mon, 13 Nov 2023 10:22:38 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id AB5E9C0835 for ; Mon, 13 Nov 2023 15:22:38 +0000 (UTC) X-FDA: 81453297996.07.0CB4066 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf20.hostedemail.com (Postfix) with ESMTP id 3DFBA1C0008 for ; Mon, 13 Nov 2023 15:22:35 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; spf=pass (imf20.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1699888956; 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=2Xf1+dYFJ/681YE359Gl0cbnGwMYe9MnpK3Z+exBUv4=; b=M/OWis3AVl/8mu6DaIfxhGdaD5o8BCYvq3r1RylGi2kefx8YzrVFzaBSPgvKjTzD9lJ0UA w+uxPRTJ7Crr+efj31ruQqzBx0eicDIvPckMqDqtUFOTeaQOB1HkmPUbsin862ST844iGD O0Y3ZXSHQFJzSl8sPO6W6cY56ZziUq4= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; spf=pass (imf20.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1699888956; a=rsa-sha256; cv=none; b=aRH8tj6qCA7rFz6Qb3cbfmfvKmH1Qdvu+HJsOizRFN/sTAriuJHb8eDBQFlCssH16s8czC kGpbaeEyZFBvXEM/YUipKiF2oLv0TXX9Kdd1SXnxTTyIcedmNGPGuHkh5Auwvc1m9UP083 RwPAyq0NwxRaYT8Ruj0E2v/tRkxY0vA= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4STY4G56MqzrV8B; Mon, 13 Nov 2023 23:19:10 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Mon, 13 Nov 2023 23:22:28 +0800 From: Kefeng Wang To: Andrew Morton CC: , , Matthew Wilcox , David Hildenbrand , Sidhartha Kumar , Kefeng Wang Subject: [PATCH v2 0/6] mm: cleanup and use more folio in page fault Date: Mon, 13 Nov 2023 23:22:16 +0800 Message-ID: <20231113152222.3495908-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 3DFBA1C0008 X-Rspam-User: X-Stat-Signature: xhoeonzrbuw533ujac3psb4811umq4z5 X-Rspamd-Server: rspam01 X-HE-Tag: 1699888955-784861 X-HE-Meta: U2FsdGVkX189QG1dMWjv9BdAvUuTFC6s8xoVzkc+gjTDRCG1IBA504WtkJpgIF41r/W2xmIknS1XAQiLuyuUorcg4kqcNah5ToS3pJ69hS90OKszU9lgDRLMjgwlMZyME+T2000DNQbi694bM2jxyG73vIFDn9gA4BDQMyA+3zuSKi1wprF57NAYzDhd3lZ7TXS5FPtZvv78OJjH39cD+3UKytPrEPVJv4X6BOlWezxu0THBFxiDq50OGFcC8oLB5aite7tWaMaNcyaJc8YDIgmx/60aSg0owYrMj0GVhODAscZ/gOoBd/2B3S71NGyFOwJcnnbajsJi5N76FKyGTmbZLVlKHEpnuJzFQ9Z6RIyx4jBDmn7sXcHFGGnbJE4tE5cpDtwrlmfTNnbl6uur1mhYNwQsexEMKQAGRBfRXeG9SGWJw/5jVN69dxxIUfS933nFm95PnSbDC/ae3eBsmLU5v3fT9wSomxfszEyfZLZ9nmAx9GZAJdzWzJVEnL3sHo1K734t4DFddz6vXY8pe0UVvlMSoo9zjK5zkssIwvx/5UchxKmRoeFHN0IFoHsQLqs6iSmQrB97yh24W6gKeNngkt24RraSM8LW7QSmtoDQgE11geSV9GFMMSJqkK8lU6t8eMiDQqGsZxsQy9L8B2/s/H09ZjQCVAtScKQUmVbyAZic56PgFng/mC8fNIcAm9x+ZvmGHBLDuMlu7xD16UfYeOSUQf74mw4jnn8t48FkAtConm3l/N45DzSy8ftinZVNpFSgjIjzT2JtT6lcbFKLoHZVPoSQGBRFb/KyckhEBK84PBKQ5oFJy+jaOqe6V9du//y9kcrk521ZVCVV6V6MoYcsdUQosngZwQl3+pVBUD4lRY6xRzNEl7W/yHLqnRPdFK2AaFctk+kevZNokT8TWzMyYCPqIS+dvcm0s5yY3TZEg/+4XWfdtfGIR9mmzuxH4lznpvkrcpng0My KANtwIY9 gmvw/N9O1NzJvqUsjZx7iGX0OlnxUzAdGsqBNxE5eL3neUJZTXGqcTX1Cs/BWyD9h1wvYxlYceEmbr/sSFF+OFAvsSwLM2niug7kAzF3gFLErSHPnBMRoN/kWlQ== 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: Rename page_copy_prealloc() to folio_prealloc(), which is used by more functions, also do more folio conversion in page fault. v2: - add folio_test_large check in ksm_might_need_to_copy() and replace page->index to folio->index, per David, Matthew - Add RB of Sidhartha Kefeng Wang (6): mm: ksm: use more folio api in ksm_might_need_to_copy() mm: memory: use a folio in validate_page_before_insert() mm: memory: rename page_copy_prealloc() to folio_prealloc() mm: memory: use a folio in do_cow_page() mm: memory: use folio_prealloc() in wp_page_copy() mm: memory: use folio_prealloc() in do_anonymous_page() include/linux/ksm.h | 4 +-- mm/ksm.c | 39 ++++++++++++------------ mm/memory.c | 72 +++++++++++++++++++-------------------------- 3 files changed, 53 insertions(+), 62 deletions(-)