From patchwork Mon Apr 29 07:24:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13646410 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 B8160C4345F for ; Mon, 29 Apr 2024 07:24:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A785E6B0089; Mon, 29 Apr 2024 03:24:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 909DC6B008C; Mon, 29 Apr 2024 03:24:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 588656B008A; Mon, 29 Apr 2024 03:24:36 -0400 (EDT) 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 37B006B0085 for ; Mon, 29 Apr 2024 03:24:36 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id EAD7DC08F7 for ; Mon, 29 Apr 2024 07:24:35 +0000 (UTC) X-FDA: 82061731710.11.9BDB8E9 Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by imf30.hostedemail.com (Postfix) with ESMTP id D828A80016 for ; Mon, 29 Apr 2024 07:24:32 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf30.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.35 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=1714375473; 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=tzMyQYObRziRsQkc9dxLahPps7AMkBijbRRKN58MQAA=; b=CFT94c/Vl9sGhYTnUTi6qeNjKKhRoufxc1xxpgORu0hzgsPzXfz2CJLiMSvQgpOWLFw03k HDERgQrdhzMK/MTOMCuVj6iikr2xWy6S7uBcmWQeWy9n2PHhriQChvwP+ZqGdONlQp3RMa RuPbwQjBRWn4f3agg7dnbwld2dTq6Iw= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf30.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.35 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714375473; a=rsa-sha256; cv=none; b=7qLpUrxRAL8jKbgQK1appY3sHPJTH6OqgBNLbZMGBoRRnZl/+FXrAanHpNsjp1QHk3jkq4 gPCvR/lCfPjc7vEhP2rFm5FYJ5B8BIzAASozDC8mtHEJBMe60QQocfPV0C4lEIs16hRAJG RPJne+j/Y8y7ikajB7Mgmhk3pMjxkio= Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4VSZWM4BYqz1RDTr; Mon, 29 Apr 2024 15:21:19 +0800 (CST) Received: from dggpemm100001.china.huawei.com (unknown [7.185.36.93]) by mail.maildlp.com (Postfix) with ESMTPS id 73978140390; Mon, 29 Apr 2024 15:24:28 +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_256_GCM_SHA384) id 15.1.2507.35; Mon, 29 Apr 2024 15:24:28 +0800 From: Kefeng Wang To: Andrew Morton CC: "Matthew Wilcox (Oracle)" , , , Kefeng Wang Subject: [PATCH rfc 0/4] mm: filemap: try to batch lruvec stat updating Date: Mon, 29 Apr 2024 15:24:13 +0800 Message-ID: <20240429072417.2146732-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: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm100001.china.huawei.com (7.185.36.93) X-Rspamd-Server: rspam01 X-Stat-Signature: duragks3mp4ndth59megg7c3wihxbuxe X-Rspam-User: X-Rspamd-Queue-Id: D828A80016 X-HE-Tag: 1714375472-257746 X-HE-Meta: U2FsdGVkX1/zgFRlagXUVf1EVvYzmW+piSeV2ricIDEGQU99YLa6Z/zuhIHZU2Zcz3ijBqsG+sx7a3iQLGpnZNTe1oZLWkjvpFCqd9yxB9kulc6W4eIeoBMT0jWXd6ZZgaRZ1Zh0yZWUPModuOWZVqeAlHHYojHgsMUjFSNzTyuTm7KtKBxJZ9opaYvy5BEvonTE3OHty6Wqw3NjCtzrqFcitVvbz+KfsnTGQtSURCulSetYbxp/ad91Ojod2+3ay79V7gDrzmgDxoO6I9lWcpkaCJOXInPlvSuIXYHzTbIQFWB40omjEls2V2lTUeTbAvNZkjU+8jt4COzQ41qgU1RT4E/jOxlS2ayr7XVTNtLWGH5OG/uLT6PO74oQ5v9D+D3etgb4xgn9L4O4SczxVzY5BzeqLR9aXipGxYYflwn3NfaCf/yvwUSRqxIn6Gdfv5tl6HZvhCsoFHy98LFr+UHvWcwAuuHTN3ZUvW0A+fkdeZv8QOhOufPGVGm+SI6ZvGibj8wCBIxOAN/xYiiWLTHV9YcqhYiOSZ6A5cI+3WAoRemm3rrpUMXS/C8G52Ms8Q0YT3FWI/njb9PXyYSSI0PnofCgjlo6Ac034NmJoyxQ9qa097DoS7e5YPU92uAfAiKRgiUe+csKBPXE/VI4fJGQw2TUC3oCZd6FGwRCDcFll9HBzlnPJNNadDEMU0Z/vUldx3bHC8Ke9OSWrrKgmOtIiSDhfB3+Mkeq0eTwd/7EJr4nW+PM6jq5vXjbR2waLlBTAUB6NkmoiiNZYtL5d94uIO/UMLmFxGKsvXZ3B8MpoP3geKLhY8qFQ8eojAIUTDllCBhj5bJ/C+dQ7jlY6IlYF0g4BUPPg/Cxi4m5qseMF9z9xLSnLAHJ+U2MD/zMlxQ71yKPskRbklTjuIjAS8zQbJqG0dE8M5ESRWSBIFxHDQhZpdRF24Vxdh+2+1iK+S06aEm9xI/VcATv4Wr O0vKlvoH LwTEqXJLZLL28TlPcdg9fhvuefMiBwqOQ+H5wsJJdHUGVxz7i6gwWv0rg5nTGCnNawnldfAO/T45BhvsMiu1qdUgp87GV455Cvya0BVy0ykzLuYU= 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: It is similar to mm counter updating, try to batch lruvec stat updating, which could save most of time when all folios in same memcg/padat, lat_pagefault shows 3~4% improvement. Kefeng Wang (4): mm: memory: add prepare_range_pte_entry() mm: filemap: add filemap_set_pte_range() mm: filemap: move __lruvec_stat_mod_folio() out of filemap_set_pte_range() mm: filemap: try to batch lruvec stat updating include/linux/mm.h | 2 ++ include/linux/rmap.h | 2 ++ mm/filemap.c | 75 ++++++++++++++++++++++++++++++++++++-------- mm/memory.c | 33 ++++++++++++------- mm/rmap.c | 16 ++++++++++ 5 files changed, 104 insertions(+), 24 deletions(-)