From patchwork Fri Dec 6 00:31:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Zhao X-Patchwork-Id: 13896154 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 D4FADE77170 for ; Fri, 6 Dec 2024 00:31:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 480A16B011E; Thu, 5 Dec 2024 19:31:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 430716B0121; Thu, 5 Dec 2024 19:31:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2D1096B0122; Thu, 5 Dec 2024 19:31:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 0D9F06B011E for ; Thu, 5 Dec 2024 19:31:35 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 91EF042B33 for ; Fri, 6 Dec 2024 00:31:34 +0000 (UTC) X-FDA: 82862654742.09.CC5BC66 Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.202]) by imf16.hostedemail.com (Postfix) with ESMTP id 64EE118000C for ; Fri, 6 Dec 2024 00:31:16 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=k3Ap5Ym4; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf16.hostedemail.com: domain of 340VSZwYKCPg3z4mftlttlqj.htrqnsz2-rrp0fhp.twl@flex--yuzhao.bounces.google.com designates 209.85.210.202 as permitted sender) smtp.mailfrom=340VSZwYKCPg3z4mftlttlqj.htrqnsz2-rrp0fhp.twl@flex--yuzhao.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733445085; 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:in-reply-to: references:dkim-signature; bh=hticglYA+AY6G/VbzEo5oWORL0uTnFc4cL9bY6hALNU=; b=AyQVjs+NsKY/FvpEYrUPf32/Xynki644en4YNEMLvpXU4MXi0bhyNk7dnrw6E81izdsWuc PsnMQMrus7NwGiaAOaQl4s+XGIYAjq5dUh/cGy7yDnSUWrZ7Dl1YcijC4tEZXpzjoJYbpK G2iGRs3u9w7wJbhj8Ej/m67LgmN3iiY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733445085; a=rsa-sha256; cv=none; b=nGat887DKWUb9+tAsYkIcIZjY3+OC3TSsbo4Vp70rgj8mxH57ico2ms9mhG9q5SodURJVe LTfvoCjvh/2AD56j9bS1L9biK1VQsV1JeV2kq6vM0U5LGwu/wGYWO9QLBeTQWrNbgV/bY8 W0UaDah5ih/g2JXgf0p5SOqvH94aeX8= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=k3Ap5Ym4; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf16.hostedemail.com: domain of 340VSZwYKCPg3z4mftlttlqj.htrqnsz2-rrp0fhp.twl@flex--yuzhao.bounces.google.com designates 209.85.210.202 as permitted sender) smtp.mailfrom=340VSZwYKCPg3z4mftlttlqj.htrqnsz2-rrp0fhp.twl@flex--yuzhao.bounces.google.com Received: by mail-pf1-f202.google.com with SMTP id d2e1a72fcca58-7251424982fso1339273b3a.0 for ; Thu, 05 Dec 2024 16:31:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1733445091; x=1734049891; darn=kvack.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=hticglYA+AY6G/VbzEo5oWORL0uTnFc4cL9bY6hALNU=; b=k3Ap5Ym4AivQUI7hK/VyGV6scfLYjGCtr10S62BWp9rbVB2MzbI/PcftXOU3xGiP4O K0ZJ94jITgWgdM7lACsyNyIqK+MDxzF+gKli/9+4dE2lZJ9duP4LJXkQVPS0vO3ovSVz Ia7YCqedyJLwX7Wxfhj8W60HBjYOrEA3R7w3tdoE0wmHiRG9sPnG3MDwjZAwVUoYHKSL U0R3950CVDLM30fGzvOeMqdQb3i0HK3uDx7K1NSfrlQXzwJ5ncppMaf1tuJE/Eb1pFoH SdH3m5Kf2jTXk1a/fdU8nVtmBgMFsMpH/PgVzXFVw5nOSTPYaT60na+Y07NoOEtB2NQO C30w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733445091; x=1734049891; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=hticglYA+AY6G/VbzEo5oWORL0uTnFc4cL9bY6hALNU=; b=BW71nS4sSnwdTQz88JZ/XxrZWNAUPrEIm9jIiPPSn749wfBzgdz1JDfITThXvuY+GK Bpumg92vjdNCxtoPGnvjtRT4syrV2hVyXJ38okyte7IzlEULmkn7d4A8P6TACSwjxGCF 5fKp9QzTyeX6X1RcuE5eW28QgfEa98EAr/QGzDX9GZkhMDAq4sAKbXeeKFhdtFB6si0E sG94npB6aBnA2wC7Aaaov5XEbDagqOV3SfDTg8g4reacysjTX7Y9gc+jFNOrqI/mzqV1 jO2rH4DUTDN2idlttLmYMZhPtPnm0HlO2pswzEGMlBEWKqkGdCvjHZ/1dCYu4c/dvJES jloA== X-Gm-Message-State: AOJu0YzubRjNvikYiW1sqVMrU+hwJrUWAYYIFnVLPicsG2J8ugxeQPVz VlDSlEgSDmZv1v9nPwSxd54zqlA46GzrZh+oACLc02ZgXdUDqFZVj5QUG68Ha4hFqjZouIh/f5q V3g== X-Google-Smtp-Source: AGHT+IFbK6okF2l0G44yN8zS8lq/AKk4+Mkz1tjM8/kCKyXgGKAWjsg3D2qTDCp9YQPUhwRItmhx8mZ3R24= X-Received: from pllq4.prod.google.com ([2002:a17:902:7884:b0:212:5134:8485]) (user=yuzhao job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:ea0d:b0:215:8847:435b with SMTP id d9443c01a7336-21614d2ec47mr12408445ad.9.1733445091459; Thu, 05 Dec 2024 16:31:31 -0800 (PST) Date: Thu, 5 Dec 2024 17:31:20 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.47.0.338.g60cca15819-goog Message-ID: <20241206003126.1338283-1-yuzhao@google.com> Subject: [PATCH mm-unstable v2 0/6] mm/mglru: performance optimizations From: Yu Zhao To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yu Zhao X-Stat-Signature: pptbxqpqcufxamjmqifuisk815uo5438 X-Rspamd-Queue-Id: 64EE118000C X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1733445076-879729 X-HE-Meta: U2FsdGVkX19AQoEJRNaHtTWKnl/AbJ5ypwVba0eOtT2Q61PuytyHTf5/1wXnJxUTrovkKCHJUOEFptZB8Wz/WtR8O+upNiW9F5BJEUUI5p7nB/pNTo5T5yRLIO+8sXk8ASx0dl2bzc2ychGFKAkgs2gdYCaiTjFNcp4sIZ9LfxyY/tybalE4vVQPKXs69Hy8nxEWiNNr8Ni+eRYd97JC1mzK3PnxV2osEb+Nq3RHs+4TexO8ZaafPFLdf7ETO1VzfbzKyAfv2AymqEo8zryxiv/o/ZXu5yXPUadchJPim2Paz/A5G0S8myJP+pgQrxKLCZES1zWe7M6pXIE4IoNeMrlWkUeDrDtFoXqTBohnXk1gvUIor1XCiWynkhrCeNxuyyTYXBvoo9Cw4Awrv3UumVYKHwTBIgpw6kVeO6p/FAXrL5KNb/ASXqHULAeVDTAl3Lyjkw8NYKYO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JrpXrqxyjycsAIHhGKEOkMMElH4ONwaUhyLGrKothB0jv3QmNuAYCNRdQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000420, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: This series improves performance for some previously reported test cases. Most of the code changes gathered here has been floating on the mailing list [1][2]. They are now properly organized and have gone through various benchmarks on client and server devices, including Android, FIO, memcached, multiple VMs and MongoDB. This v2 mainly fixes a warning reported by syzbot [3]. [1] https://lore.kernel.org/CAOUHufahuWcKf5f1Sg3emnqX+cODuR=2TQo7T4Gr-QYLujn4RA@mail.gmail.com/ [2] https://lore.kernel.org/CAOUHufawNerxqLm7L9Yywp3HJFiYVrYO26ePUb1jH-qxNGWzyA@mail.gmail.com/ [3] https://lore.kernel.org/linux-mm/67294349.050a0220.701a.0010.GAE@google.com/ Yu Zhao (6): mm/mglru: clean up workingset mm/mglru: optimize deactivation mm/mglru: rework aging feedback mm/mglru: rework type selection mm/mglru: rework refault detection mm/mglru: rework workingset protection include/linux/mm_inline.h | 94 +++++---- include/linux/mmzone.h | 88 +++++--- mm/swap.c | 65 ++++-- mm/vmscan.c | 423 +++++++++++++++++--------------------- mm/workingset.c | 67 +++--- 5 files changed, 372 insertions(+), 365 deletions(-)