From patchwork Mon Nov 6 15:49:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 16302 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp2750433vqu; Mon, 6 Nov 2023 07:51:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IHixwfhzI2I291fhLE3PLZp9pkjwqkesRVI5nEDEMXEnfZ2gsxnHhKrqzFwwhsjS9EbgPxC X-Received: by 2002:a05:6e02:1523:b0:359:398d:7c31 with SMTP id i3-20020a056e02152300b00359398d7c31mr95492ilu.4.1699285904553; Mon, 06 Nov 2023 07:51:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699285904; cv=none; d=google.com; s=arc-20160816; b=KTpeWszk1Py/JaeGrxWE5uQpPyNdd7woyapRmHFkj0cvvDQz7+Qs6U1J0vnb3AkBGM r61W9g/9IJtnJFOz8RK89aNTEipbB7PIw+rliMoxFQIPE5OQ0R3aJU3MamcUW47dnY2m ox4CrKd4dQPSqFK7zO0thGjiHV9dYIcvDMnWTjaGRnh/rSXMr7/2I7xFs1WZtdysBABG rdMPCDZL3ghyC4tt9XJca1443tEyWniry4q+H+6WpfZ6Df3uZjU6gsPKMwRqw4eDRQaP lbYW3EySYnUOFYbm0dNKBsHh60xq8xpXUxn4drIyN6M8EKdCqWS0vCrTN4xlMmGJJBHy aWCA== 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=R1OFK54ZTt1+lbhtEO4snTF+moSHr5i6nFLhH4ythgw=; fh=kUj/5waaepfljbNx30rj2BALdV0u/mUCTaFWThlgquQ=; b=D0VPS4UcOonQxGGIK+LfXNrTT8DLByem1mx59nVF3cbhALjSOKN/T/fiT35FNNqTMI ySY/VHw4wg91Q+XA3fpgqezW6SvzC2oFGtGLaE3AuImQYAPAz2gKu/q8qWiCyk+Bzm+S Zxa8hkL7509awiT9PXSl+5CpuyY+WF5+oeHx5dGC6yTMSKlKMHQntGkkWyEYWH0igyA4 xx2zLIxJhAqOrsdPR0e1/ysfpyjHWGPxioqlzIbiCBUXaGGNC6VhUrUcIZNFLSUifiyA hNDxOXWNNpnINOr+olOEIwjq7kR2LbBzGRAF8VMC1prDZi5WLhdT5UZngdtqKCmqvXng w96g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id h64-20020a638343000000b005bd3cf5fd1esi8263340pge.389.2023.11.06.07.51.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 07:51:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 778318068957; Mon, 6 Nov 2023 07:51:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232375AbjKFPuF (ORCPT + 35 others); Mon, 6 Nov 2023 10:50:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232329AbjKFPuD (ORCPT ); Mon, 6 Nov 2023 10:50:03 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF3EA134; Mon, 6 Nov 2023 07:50:00 -0800 (PST) Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4SPG1Q1TyzzrTbB; Mon, 6 Nov 2023 23:46:50 +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, 6 Nov 2023 23:49:58 +0800 From: Kefeng Wang To: Andrew Morton CC: , , Matthew Wilcox , David Hildenbrand , , Kefeng Wang Subject: [PATCH 00/10] mm: convert mm counter to take a folio Date: Mon, 6 Nov 2023 23:49:40 +0800 Message-ID: <20231106154950.3399469-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: dggems703-chm.china.huawei.com (10.3.19.180) 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 groat.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 (groat.vger.email [0.0.0.0]); Mon, 06 Nov 2023 07:51:22 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781830416857018834 X-GMAIL-MSGID: 1781830416857018834 Make all mm_counter() and mm_counter_file() callers to use a folio, then convert mm counter functions to take a folio, which saves lots of compound_head() calls. v1: - rename should_zap_page() to should_zap_folio(), per Matthew Wilcox - pass page to page_remove_rmap/page_try_dup_anon_rmap for device private page, per Matthew Wilcox Kefeng Wang (10): mm: swap: introduce pfn_swap_entry_to_folio() s390: pgtable: use a folio in ptep_zap_swap_entry() mm: huge_memory: use a folio in __split_huge_pmd_locked() mm: huge_memory: use a folio in zap_huge_pmd() mm: memory: use a folio in copy_nonpresent_pte() mm: memory: use a folio in zap_pte_range() mm: memory: use a folio in do_set_pmd() mm: memory: use a folio in insert_page_into_pte_locked() mm: convert mm_counter() to take a folio mm: convert mm_counter_file() to take a folio arch/s390/mm/pgtable.c | 4 +- include/linux/mm.h | 12 +++--- include/linux/swapops.h | 13 +++++++ kernel/events/uprobes.c | 2 +- mm/huge_memory.c | 34 +++++++++-------- mm/khugepaged.c | 4 +- mm/memory.c | 81 ++++++++++++++++++++++++----------------- mm/rmap.c | 10 ++--- mm/userfaultfd.c | 2 +- 9 files changed, 96 insertions(+), 66 deletions(-)