From patchwork Mon Dec 2 03:28:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Zhao X-Patchwork-Id: 13889934 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 77C3CD49798 for ; Mon, 2 Dec 2024 03:28:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E18A56B0082; Sun, 1 Dec 2024 22:28:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DC83A6B0083; Sun, 1 Dec 2024 22:28:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CB6AC6B0085; Sun, 1 Dec 2024 22:28:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id AE7DC6B0082 for ; Sun, 1 Dec 2024 22:28:31 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 5C29D161134 for ; Mon, 2 Dec 2024 03:28:31 +0000 (UTC) X-FDA: 82848585582.20.CB0D55C Received: from mail-pg1-f201.google.com (mail-pg1-f201.google.com [209.85.215.201]) by imf17.hostedemail.com (Postfix) with ESMTP id F327C40002 for ; Mon, 2 Dec 2024 03:28:20 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=U4YgZuUH; spf=pass (imf17.hostedemail.com: domain of 3XClNZwYKCCUZVaIBPHPPHMF.DPNMJOVY-NNLWBDL.PSH@flex--yuzhao.bounces.google.com designates 209.85.215.201 as permitted sender) smtp.mailfrom=3XClNZwYKCCUZVaIBPHPPHMF.DPNMJOVY-NNLWBDL.PSH@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=1733110098; 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=Y7BxaTMkVE6X5DOMUP7/Ckq3J2VStDtJd0ubZx4TSrg=; b=P47hrAcTnzWqQaVJGpAsJX4Ao0OgOzHdSddBr0yGyM2dR+hYseTBl7ljtoS+X5LCJO/R7B kf19VPfAJoCgj7mvp3ZnrK3imLfaOUrlouyli2b40Vtni29nE5HPio027r3OIspUUZS8ce 828aNDE3oI75O/MA+9XwSg6vy/5sXPU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733110098; a=rsa-sha256; cv=none; b=G7sir1A2YLTab+vBDKSBg3jc2PE7pwd+GsDWB86ZrcCk1Gl9GQSUqbmpkJRPbj7ltxgyRC qGn2q+z79Rh9AgJ07hXlX4uffiKaznYzFsFpCm7yPkEGE8MnEJ4dMKh2sKsHoeY9RjFBEW DNIayNle7VPFLCasNeeWBKsCiRD/zwQ= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=U4YgZuUH; spf=pass (imf17.hostedemail.com: domain of 3XClNZwYKCCUZVaIBPHPPHMF.DPNMJOVY-NNLWBDL.PSH@flex--yuzhao.bounces.google.com designates 209.85.215.201 as permitted sender) smtp.mailfrom=3XClNZwYKCCUZVaIBPHPPHMF.DPNMJOVY-NNLWBDL.PSH@flex--yuzhao.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-pg1-f201.google.com with SMTP id 41be03b00d2f7-7eb0a32fc5aso2797833a12.2 for ; Sun, 01 Dec 2024 19:28:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1733110108; x=1733714908; darn=kvack.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=Y7BxaTMkVE6X5DOMUP7/Ckq3J2VStDtJd0ubZx4TSrg=; b=U4YgZuUHx7JJns2LbQqKKD8dUY901OZZVsTYpULsOcLf5Z36ysqR4hiUjJerLKbzV2 Yd/66IT44d1xe/hPh37PrSbMxGbCKfI8Z9mS8zMiZOqkr944oPra73YIL1RkOmpr7TMe Lk9k+Xb7DN2oV3Jas4Snwu7wZIpXW/E+vXOnxFEDXDV8yMhxmir/yRNdNiaGc43IP/mW DJiL2CQqpqfpuCu3lpACp/J/wjZRj5YB/zyxQPVJs9ixxH9QhMh0OXdMJYqJWsxxkru/ Y4fuzC8HhVKC88cHjQ1HCLiRDDOMxax51zwL2g7542C8BfmblBnXmSheBT6Yuknpd+mc zjtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733110108; x=1733714908; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Y7BxaTMkVE6X5DOMUP7/Ckq3J2VStDtJd0ubZx4TSrg=; b=teV8hh1+tyXIZWkRfSb5TvNIjiM6W833FrXCkJsxrQ/M7F2teCFS3SVNquSp++mJfE P4MyvXUqlH/nJR+S9BLlv/4hQd7bQFodjRsfMyvB5vU7n7cBKwRP67i3Aev5XjwiSuDZ hoIIl4hCc9hMTKtIbhd8yxSI833Aki4ObfMzkXJYM18gxT24tlh/XBTNo+1cA77yA6Xg cw0L0H+aE+EqvEwQeexGe82I6DmrHho3BiO3d/777Ly9onvqF2VayX9j4e79IFO4+aVX b3NpgKdlLG3CamecCtmcLsbYfwbLo9yS2V0sglqj0NLqGuCkcenYUrXF486ta7d8j8WN noIA== X-Gm-Message-State: AOJu0YyFWg45Vh6mGWUhJnDiv9ckuA1PYuUMRbCv55W7NmyWXDIBX+Pf Tfj7ngNwLIhhlkM1lFScyRxp1nSiA2qw2Xag6hKFQ9jrv0hvd/gXr3Ya6HO+lTp13hhOLpo9zFG 4XQ== X-Google-Smtp-Source: AGHT+IGQEFTqJCfYrkvhV7zpHzSAKSaOya/ZV0CjsMJI82ASy+PAVAGSQD0Zy9K+AP8jSS6ISfvqLjNmk0c= X-Received: from pfbcw27.prod.google.com ([2002:a05:6a00:451b:b0:725:325e:59d5]) (user=yuzhao job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:6d9f:b0:1e0:dcc5:164d with SMTP id adf61e73a8af0-1e0e0afa5eemr31014108637.8.1733110108206; Sun, 01 Dec 2024 19:28:28 -0800 (PST) Date: Sun, 1 Dec 2024 20:28:17 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.47.0.338.g60cca15819-goog Message-ID: <20241202032823.2741019-1-yuzhao@google.com> Subject: [PATCH mm-unstable v1 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: F327C40002 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: 3e48nmjgrgt1gkuuibsnd3911n47ib5p X-HE-Tag: 1733110100-821468 X-HE-Meta: U2FsdGVkX1/zDD0C0xVBwGEYJ1K5v+HgHyvxTePFjtsnkJhcem/ZQR/rXU2FG2UsfxXZom4TUNY5RNI3Y5GGGRxTPJhJxkZQxR+Dx5meDxEXdOdoFLOnKgeLmtig0P5MGbSgRitxsm07bVHmRO6r/uyW0UB5g0T+Qu14X4yPekuvMZUwZw7KY3DBSN1MmjDL7CIECWNttBfKvepOacCYGlKuGrwanEjtw60IFPFp8oOOoRLp1llkFvMXDfurEKfcAWD5gSp6CZZOAeqvPI5jaGEKyCR8ZBIBAGEDVXVZRIkHBUKJzYZ+rI7sf2Q3vaRtFtIStPm4fqDO+ccm7Rx/uh5mBj5n03muYYeAKC9qtugJzDeC+3enBbH1d9pEEPphKJPzzaG3GlZL7L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EzrKU6xAMDV4wdfZZqJbniTdvX15d+fi9edcTtImBzihDscU6mv77QIS9KjqFeb58IlOuqzXmzTnT1GoyNg1lPRc2lfy7Z6dOT17tsMtT4o5RtmeZZ2a9piInvD+Hxho8 X-Bogosity: Ham, tests=bogofilter, spamicity=0.032296, 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 discussed 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 both client and server devices, including Android, FIO, memcached, multiple VMs and MongoDB. [1] https://lore.kernel.org/CAOUHufahuWcKf5f1Sg3emnqX+cODuR=2TQo7T4Gr-QYLujn4RA@mail.gmail.com/ [2] https://lore.kernel.org/CAOUHufawNerxqLm7L9Yywp3HJFiYVrYO26ePUb1jH-qxNGWzyA@mail.gmail.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 | 69 +++---- 5 files changed, 374 insertions(+), 365 deletions(-)