From patchwork Sat Dec 7 22:15:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Zhao X-Patchwork-Id: 13898421 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 A2705E7717D for ; Sat, 7 Dec 2024 22:15:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 394256B0360; Sat, 7 Dec 2024 17:15:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 343186B0362; Sat, 7 Dec 2024 17:15:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 20AB96B0363; Sat, 7 Dec 2024 17:15:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 032376B0360 for ; Sat, 7 Dec 2024 17:15:28 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 7D3A0A0301 for ; Sat, 7 Dec 2024 22:15:28 +0000 (UTC) X-FDA: 82869569958.04.41A52E9 Received: from mail-oa1-f74.google.com (mail-oa1-f74.google.com [209.85.160.74]) by imf24.hostedemail.com (Postfix) with ESMTP id 7E59B18000F for ; Sat, 7 Dec 2024 22:15:24 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=wmGSTKb6; spf=pass (imf24.hostedemail.com: domain of 3_chUZwYKCCQYUZHAOGOOGLE.COMLINUX-MMKVACK.ORG@flex--yuzhao.bounces.google.com designates 209.85.160.74 as permitted sender) smtp.mailfrom=3_chUZwYKCCQYUZHAOGOOGLE.COMLINUX-MMKVACK.ORG@flex--yuzhao.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733609712; 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=iYMLMKsYjKvyEkJr7+KniMm5yM50yZLPEaf04bZG/TI=; b=VkHyA3zUVBpzqnru+wYhFjkrs7g9ssjON1q+VzNj3IGqUVhygIxpNjojHIo48al8+Slm+o VVeYz+lQTW58aOXAsg2GlvH3h4iKVLsqgLGEftI/lh2QcWMUSm+fYSX87bGfeKjdiUcA+C VZ/beLPRRf6Nk41bNuawcf5nzW+b9o8= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=wmGSTKb6; spf=pass (imf24.hostedemail.com: domain of 3_chUZwYKCCQYUZHAOGOOGLE.COMLINUX-MMKVACK.ORG@flex--yuzhao.bounces.google.com designates 209.85.160.74 as permitted sender) smtp.mailfrom=3_chUZwYKCCQYUZHAOGOOGLE.COMLINUX-MMKVACK.ORG@flex--yuzhao.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733609712; a=rsa-sha256; cv=none; b=ObSkYMmXsd9A5hGWFRwHjZ5imgE29bL1RJwM8/TDH2/LGz4H01HcepuqYZ5I/tJZNFfxWs F7m058Iu9EcqTJAhxZwHuZR4ZjyFQBdKrdLcREZij3j0gMa6xxfkH9uG/kiXOIlXbE0LaP gS2/c/+s6+toPnHs90X2WIl7zWQW/BA= Received: by mail-oa1-f74.google.com with SMTP id 586e51a60fabf-29e7156abeeso2825913fac.2 for ; Sat, 07 Dec 2024 14:15:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1733609725; x=1734214525; darn=kvack.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=iYMLMKsYjKvyEkJr7+KniMm5yM50yZLPEaf04bZG/TI=; b=wmGSTKb6H+4V4406xpHjes4jLxZ73fA3cQ/z4QggIvz/V6M1quMKJsaCEwSvkdLsrC 4GKkBalIqyVE1tv5FGR5Sy8KrS5OGkCdMC2VnAcUU660ivtqSc4a47F4LQiSgY/d1pYS 9aWw08Xi1Bm/w16rRdWJQ6dIohll11udC5EQeWuJWizL6iki/0WRauiyZ5y8UbVXcO8B 4Do3BI5zKU5uQcanhvuAX3K80sc7JZ/h0TYamzV4WAj2qdKM2UJgSZr5b085EM+eXwl+ kEcKW3hves4JTboxC+EkZM3mlUMHkIQKUUsMKqWQsiYgAe5OcW7/qW96wUq7Wy1/xj6X GXeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733609725; x=1734214525; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=iYMLMKsYjKvyEkJr7+KniMm5yM50yZLPEaf04bZG/TI=; b=wFHkJ+nshbUhNqgfzNqFrfAmksKam7/AEbieq5gBaV9ymQ2rdrqqWLcB1NS0xbQEbY ALaUvHiQ+qZ/ffDwzEtNb7XY+11Yl7ZKVuIn0E1UIOxPHfHt8/HKoujXhZlV6BbWaT6C WxGvu69JGskZo4w6Ovh2svRD07p+HyunKwqOXGjuY8JC1r6nS7ZyygNUDfmqpIbHEmH6 YnDAPGpHYXTiGniGgiA+7RS1+SN4WMxvmD5d9Hs0TUMSKnDcaPRjpoBmjgN8P4Qxw7Iy QnqY+HSxyzLYDos6q49DpTg3l67A1KSolDe3GOU3WqM2woT+sPcA+Y72H72ayX2RYyIu y6/Q== X-Gm-Message-State: AOJu0YwPUQroTf4uoRZd0HVCGRGYn8rOLfk/FJ9AME1hCtn/eshncLjK 9TeKWfe1CoFJHPBnI2J31ZOy5DIl9UAnhO3lLzWdr5fr7nnMMsbHG/CRsxmi11EUOXfpovwZvCB C1w== X-Google-Smtp-Source: AGHT+IGkmSZBHwFVqtrTFBOi3OdNPxu1qwCT2x7Nl6fMyRUN+dhlfJDvko1xurBMQvNmKLZtB9t2kbRHEBE= X-Received: from oabpq6.prod.google.com ([2002:a05:6870:9c86:b0:295:f44d:8dfa]) (user=yuzhao job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6870:be89:b0:29e:6c6a:e7e7 with SMTP id 586e51a60fabf-29f733478a9mr7584044fac.21.1733609725715; Sat, 07 Dec 2024 14:15:25 -0800 (PST) Date: Sat, 7 Dec 2024 15:15:16 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.47.0.338.g60cca15819-goog Message-ID: <20241207221522.2250311-1-yuzhao@google.com> Subject: [PATCH mm-unstable v3 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-Rspamd-Queue-Id: 7E59B18000F X-Rspamd-Server: rspam12 X-Stat-Signature: jmj1moppaquotoirmy9qyfjkm9k7sfuo X-Rspam-User: X-HE-Tag: 1733609724-278859 X-HE-Meta: U2FsdGVkX19/OTQyLgWKPlFLH7Y70pioNkE601K0+92xWP9s10MzXq74M9FFHS0ykudCt9ZAM1GaNC6H2Vmd8oPymNQB6KLBl46BULdfmVv6vAQSkYe7n3OIZTKsV8QTbE3L2TX7OZSiz2XcXUdT8zrhZr1d6sqRKpxWrC+5I6on7zHEdX0ChjdukXpcoDH+xJOKKFKEbUorC6H0C1/3p2vipahmqSjj7lN9veQ1pRDBOgkA5+tCBS/Lfmq3Mc4IV6gNvVGp1UpHwASOGRYGKVo4Bsc83RUUYdCfnkidypP1fUe0CuPLJg1ttWvCsW8nkJN7RCiOhlKpCkBqd6xn43deM0SDWvkbdDJNVtldCUIKDK3TiuKHyLnzTs+jThAQ4iDz7FmYn40YT6SulNps2doJdPScvThamqs154mX9+hSCILZ9U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IKEE+jP5RyTSLz1jgR0aMXoZLY9ZF4FNuZgRJ1O3WM0GOjqK85O1rQ== X-Bogosity: Unsure, tests=bogofilter, spamicity=0.488326, 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. In addition to the warning [3] fixed in v2, this version fixes another warning [4] reported by syzbot. [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/67294349.050a0220.701a.0010.GAE@google.com/ [4] https://lore.kernel.org/67549eca.050a0220.2477f.001b.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 | 70 +++++-- mm/vmscan.c | 426 +++++++++++++++++--------------------- mm/workingset.c | 67 +++--- 5 files changed, 375 insertions(+), 370 deletions(-)