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: 16520 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp1276337vqg; Mon, 13 Nov 2023 07:22:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IEIIFr6cfyEmodee/YjBohetGugj+yZX9iySSqAL7sOCl6dCVIZSMNVM9zmAgXsk3ll0uZ5 X-Received: by 2002:a05:6a20:8421:b0:181:7e88:56f7 with SMTP id c33-20020a056a20842100b001817e8856f7mr6390203pzd.18.1699888968767; Mon, 13 Nov 2023 07:22:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699888968; cv=none; d=google.com; s=arc-20160816; b=KTOk33H8Jw74CDDtZw/PWTJWLoIVRWKDCUJS/fcQoqgrtcD9EDX9KUY9+6aLarMEws J9MZ8NNhYBKEcVkiSBsk8r/s0YpthODxYI8e81iULJhRgwKCMoFcHbuROcva9ZSwgEAj n9f8S2RWopVv0B7HMwMDfq7m2iCxmxcTiFiwl1YYIu9kZuaep6YfNHrEdHBq9jz/TVZa AXAVPU4heZRhzvLRFph6q6LAoUh+CfB3I+a4vtqVUNOZYdgYQTtBmjKUNQLCdY0/JJng D2i6hlW9A6SVRZ1fvcfniaqP62v38SFZJ5XqHfu/j9XY1vX8rIqN+v2Wo+4pf0azb6SS kIoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=2Xf1+dYFJ/681YE359Gl0cbnGwMYe9MnpK3Z+exBUv4=; fh=XlEU0c7GtD3y3c6Cq42Wb1IF2okvB16VXiKMJsE5Xwg=; b=KJbhx2t+fPnCujWGaZGoR66PJiZYqLTDfE45rLWnocaqLYhW/0JxAnKPrdZDdUWy96 gmhFshdvrp6+gWcSrjHijwBUX7jGuAOJk+pSlmbk4BWAnAp9eJguaKDj0R62Q+0iG62N /OZpKR3fl5VKlhtn4q4S99SvBGR9Oo7B0XOxqHyvhD2T/B8wojRQATlyI+lQEquuuKeF JZOlrWRM9sOEv2QJOA69b84zJT+Nb9T19c8SoRoSDw3EwSI4cm9AVEfO9KHgtsk6in5e SaJSBbbjXoHk7mbwi16Ee4kVRT2EVck1wnFrNeD0zQa1kINZUSSVV6uW3R4qf5xYNBHw UbTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id r8-20020a170902be0800b001c61a231d33si5607649pls.292.2023.11.13.07.22.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 07:22:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id D20C280AC8C0; Mon, 13 Nov 2023 07:22:42 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231346AbjKMPWf (ORCPT + 29 others); Mon, 13 Nov 2023 10:22:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbjKMPWd (ORCPT ); Mon, 13 Nov 2023 10:22:33 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2A7610FB for ; Mon, 13 Nov 2023 07:22:30 -0800 (PST) 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-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 13 Nov 2023 07:22:42 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782462775636406603 X-GMAIL-MSGID: 1782462775636406603 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(-)