From patchwork Sat Nov 18 02:32:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13459825 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 F05D0C5AD4C for ; Sat, 18 Nov 2023 02:33:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 48B366B0510; Fri, 17 Nov 2023 21:33:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 43C6E6B0524; Fri, 17 Nov 2023 21:33:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2DC526B0549; Fri, 17 Nov 2023 21:33:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 1B5C36B0510 for ; Fri, 17 Nov 2023 21:33:13 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 8639F40702 for ; Sat, 18 Nov 2023 02:33:12 +0000 (UTC) X-FDA: 81469503024.27.705BAD7 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf03.hostedemail.com (Postfix) with ESMTP id 6C27620008 for ; Sat, 18 Nov 2023 02:33:10 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf03.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1700274790; a=rsa-sha256; cv=none; b=txORtXUsvIJcAeHtuTk7Ywzr8cvFCpuBNO7Sut4Nd4vdLue2TRsJkgPHlLKz/2rL+BRC8B ywtVODLksmnvy6RjaF+WObL6YysrBJ2UmzbjfD50cKoGgXfs/kjKPIVdksvIoGYRaiLHdS wPx2VwgGECW4RUezEZGpR2HZyTIz1OU= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf03.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1700274790; 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=vYWrk+V9G1SyAFIe6cY9GAMnE9I3y5o0wB4FznLzzzg=; b=M4RcikaJV3rkousMsQDftkYOwJplHewqjLz9s1fhSdIV7G29pzGybrifxcLIn+wLX+V9nD 6sf03j/HMCqAvO9kMx3hV/qrGdABchguoDNY3JdFmYj66JivehwT+4LEbBUZGg4i9+bShj Y+E6PP6UY3eyChOy7dw4f5aLCJEvvE8= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4SXHl52VTGzNm7S; Sat, 18 Nov 2023 10:28:49 +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; Sat, 18 Nov 2023 10:33:02 +0800 From: Kefeng Wang To: Andrew Morton CC: , , Matthew Wilcox , David Hildenbrand , Sidhartha Kumar , Vishal Moola , Kefeng Wang Subject: [PATCH v3 0/5] mm: cleanup and use more folio in page fault Date: Sat, 18 Nov 2023 10:32:27 +0800 Message-ID: <20231118023232.1409103-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: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 6C27620008 X-Stat-Signature: y7shqibttys6gb63dib66ciz66jsdkyw X-Rspam-User: X-HE-Tag: 1700274790-224793 X-HE-Meta: U2FsdGVkX1+mWd1SbQ53OnyWWGe8Exb4GWGjEdqbfb1D4PK1NNns6pr9z/8O1tWOJ1ykEAMa6M/6BQoUf7SK2ZevN/fagTzKs+01kPV5X9vIQskbZF74UyQ+3BTuZLkVsg1+dIl90MnqjG50gP1+QI4BVpEASPuJbhuQhbv//UCnZzP9Dau1PCrZcfXQpm1zrtT2714ntCiiIzwxguT6ptfQ+IrxA7T+GQ7CPQgSOr4MVeYO8+S9pRGT/OKnZalr7A+Yp3zZ3MYXzIWs6Cmu8Arw5P2eSN5cD4HZIqZ8hyswbX4CdYkuX6zgVgkVi4WwoV+CnXRxxkn5cQCBh1KkaUm8XrfaXg4x+eM7ZCtAhlXIVrlhsWSyXrbBixZ5ht3IuEh98sHobi9g+QUbaNBq7FfvCINtte+VCA3qdpSYK//1WjpRI8AlaaRz5mtmXkH4tEHQY95aQ8W+Q2JfDu4d7ReieobRijmQs8WefPty1ZdHLx5XeeF4OHpRhxT1TXTpCozNoe2gmQbL+ZwRVME58XftBTInFnUTS1ZFzE31v3Msm61nLosKENATnzlS/KEZ8O/heS1XE74KG08pwHRb2W2U9PajLs4v2Qr9ExmvdoNaBmWabWg/efUKT4VEN7bHRpIa6qDpmKqbElSlkbwHKIV1OQb7yE9HEWzWwIohz+La/gTJyizKvBZbQlNrVkDYDK4nuT2kSDreKZG7cm4IDDbb7793fe+P+g30UWrp4pb22u1Q5gH0ApWoolR2otRkdKqd4SK2ijGQ2saS7uoA2PAYBjPTCU/nPOBMGKzdXPUNXZZRzA0cYGezjQHnIS2iLybK+4hOgcrdgwVKQ+qm4RTlU0pgR0EXnkV0exiI+wJwopnSOC6Inh2t8i1Xwjrvhj2y2Km+Hy5Zb1MqCVuU4nUsXCYWnIhClQV9jXhYFT6p7n1Q98Av+XOU/heDfP3V+4V8rURhk0qD77G+cRC AqTF8Ju+ Zy7f7r06kHFRfkBgumtglqQHR9gFz0eqHw6zBC+5HUUktdHTP7qspNO7mqMaTTnNx0GiPLkcxlAssEdxPDpk9dglkhmbY71+hCIfwCdg+9I2qkR9yjiRikgWelDMmn1gQc3CUMVlkVl0f8+0bpv6fUlKLF5B0MX2EbgTOTsLqr+o2FRhrmVKAOT8FX5Ru2dYq1tUq 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. v3: - drop patch6 as Small-sized THP for anon will change anon allocation - correct do_cow_page to do_cow_fault in subject and changlog - add RB of Vishal 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 (5): 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_fault() mm: memory: use folio_prealloc() in wp_page_copy() include/linux/ksm.h | 4 ++-- mm/ksm.c | 39 ++++++++++++++++-------------- mm/memory.c | 58 +++++++++++++++++++++------------------------ 3 files changed, 50 insertions(+), 51 deletions(-)