From patchwork Tue Dec 31 04:35:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Zhao X-Patchwork-Id: 13923612 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 B3EFAE77188 for ; Tue, 31 Dec 2024 04:35:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2A8856B007B; Mon, 30 Dec 2024 23:35:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 232116B0082; Mon, 30 Dec 2024 23:35:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0D3046B0083; Mon, 30 Dec 2024 23:35:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id E2EE56B007B for ; Mon, 30 Dec 2024 23:35:47 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 61F39A082E for ; Tue, 31 Dec 2024 04:35:47 +0000 (UTC) X-FDA: 82953989580.21.D556CED Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) by imf02.hostedemail.com (Postfix) with ESMTP id AF7CD8000B for ; Tue, 31 Dec 2024 04:34:14 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=j7IlFNzx; spf=pass (imf02.hostedemail.com: domain of 3oHRzZwYKCJkRNSA3H9HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--yuzhao.bounces.google.com designates 209.85.216.74 as permitted sender) smtp.mailfrom=3oHRzZwYKCJkRNSA3H9HH9E7.5HFEBGNQ-FFDO35D.HK9@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=1735619724; 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=ecuY/Hw7C4K7W6o4BvA/hjrdWJOX8V8p6rJ1OHpdMAE=; b=uoC4A/ZccpHNAeqR73ZoDIRKNChGhmlSuF7j6KZoHeRX51UUYCeiGKlRoaMSxZiq7Lq0AJ aIrGc5U+CTbTBNObSXlnSSCLOTOgahXFwLM51BuOVaYydOPBoYYR8WXsx3j2+ja7jAn/jO jhcT/GonfqKmT0rU9AfsmZmh05NpWtQ= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=j7IlFNzx; spf=pass (imf02.hostedemail.com: domain of 3oHRzZwYKCJkRNSA3H9HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--yuzhao.bounces.google.com designates 209.85.216.74 as permitted sender) smtp.mailfrom=3oHRzZwYKCJkRNSA3H9HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--yuzhao.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1735619724; a=rsa-sha256; cv=none; b=8azyYTxEExtuUN7LzSpQjNugx5D/7iKEOGs06XMHNlwqYQHNhebt+hmnROOfaFm4z6cnfQ //wlLSBtMx0Sim/H+q2Q0KiTo/Xmcy6qrh5E1TqPJHRt/L3UHx8uGtECJm7Apl87e49jaG y7l/Va6RbHD8IaSQKYDwrPu0jLpX1J4= Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-2ee8ced572eso13429553a91.0 for ; Mon, 30 Dec 2024 20:35:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1735619744; x=1736224544; darn=kvack.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=ecuY/Hw7C4K7W6o4BvA/hjrdWJOX8V8p6rJ1OHpdMAE=; b=j7IlFNzxe19KG23M/nvvothJr2vnIxwl7ERV3r/pXDQFfxYdE2cTTuboPXAPCT8fhv jo0go8MvGoZdgZfxP1coaGiM5ZyfmLz8IJ9Yhk6rCFQltafTVKchlxqJ5nbL3c5foxWq oAquWoPyCcrTFGZ1vMa6aP9vXWk3PiWrE220hx4KLn79oGGfrXERQP0+kGJCg9HSJkjr /o1eardlz3qn76utGCSg/KORV7OW1UpIqhqtvlkmKO4Mv6KB88zJUP1gKej0yLm7v5hx MNjwLw0CJR8EKPE57JWbtC6Zk/HbEsLGN8gXsw9F8zPzR73MRkpqFDh7VX6fFegBKz4J K+XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735619744; x=1736224544; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ecuY/Hw7C4K7W6o4BvA/hjrdWJOX8V8p6rJ1OHpdMAE=; b=IzujFobTXeIaEmv9Kyec16vzX9DcpoaZjPSDzKkggPOEMcyh03UlCaeobgu8wAKfRi A9i8aY3uvjh8v4W0cZ2yuVhit70svS3SJn27boNPhHcAnoNdzDpFy85gEVLWBBt27Rsl cAI5MoRFLp0jvyW0Vr2n49Qew3ScTdudr3fGhWHPemY8b5Je0QuvMS5WG4Z86Lg5A2s+ PtKBJQTebR86CNzeycjsQrcaSGDjpnDdNzncHcFdg+U2hwdvyImjI4P3EHHojrO6n4Ui EirV4fkZam9oh/njHCEJkzMBBG+SLAdCNDiGyZVImUjA4/P2G5tkV8ATtFZWxo0qFiC5 s2iQ== X-Gm-Message-State: AOJu0YxB3ouARo6/S3C97uwtcqSYGouN9KhoQvO7h+srIKaJM1ZBomb0 mTJZ2avM8OKLNmtBN1+Y6sl8j1Te7p9SRGEZ0rdcVIlu6OA4wWcFp5/aqLkjonAL3i9MouXT9nh tzA== X-Google-Smtp-Source: AGHT+IE+6c7bwL1/eEGrUc5ZmNW2IaaxbIL0TH8SHChKNZBSg0mMqDqiMho/5ammNjRKDuD1jtg3aF5Chmo= X-Received: from pjbsc9.prod.google.com ([2002:a17:90b:5109:b0:2e0:aba3:662a]) (user=yuzhao job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90a:e18f:b0:2ee:aa28:79aa with SMTP id 98e67ed59e1d1-2f452dfcd7fmr52855174a91.6.1735619744314; Mon, 30 Dec 2024 20:35:44 -0800 (PST) Date: Mon, 30 Dec 2024 21:35:31 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog Message-ID: <20241231043538.4075764-1-yuzhao@google.com> Subject: [PATCH mm-unstable v4 0/7] 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: AF7CD8000B X-Stat-Signature: ypiez5e71fph1esyerj665789493wpsx X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1735619654-726924 X-HE-Meta: U2FsdGVkX19y3M2X5F+f+wwcaQ+w9utkVl6T6KgJAUQOEQXhnpHMb5p/4Vkw+Xmls3TrKWGjukALDdfZWsK9DT3L/Hpb+mtxK5rRQxKnZYGFFJ7ToVIssyMzUkr/4flqDr339O114g21vr5rQ1lsF+WBeTw7SOMnGuftdhI7APZ90ZJ4fwrbXaXZDo1wi7AwLuE6msy9K2X8LdLAw4V9O/CBJlmw+DGxRRbpfhYtCIEDaWHRTYpLjJmkVv49pU5xpK7kSViCWuOn0dD7EOzzVlISXMzrhNilk2Dj9pYicYmAx55DbYMK5Mj11NPhfiNQ0G30yAmTI0GF5mKNsXKQTFFYPgawsofdObpbzB3iFaf2/McVU4dJ66eBlGGlgNts6PkGMly+zPjhyk2P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LazIkdQuynBd+NHBryZhtl4he3sAzaIzr9SqVqey7DSdVSuswf/eC/TajEUFfQkVjATimxHZkJK/vm8Dgz9guFci4OsHJSflQ8m3O/Wug6hp+7ZsG3iBSJPlYT6ObZhrKXt65s= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000122, 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 syzbot regressions fixed in v2 [3] and v3 [4], this version fixes two more regressions: one reported by Oliver Sang [5] and the other by Barry Song. [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/ [5] https://lore.kernel.org/202412231601.f1eb8f84-lkp@intel.com/ Yu Zhao (7): 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 mm/mglru: fix PTE-mapped large folios include/linux/mm_inline.h | 88 ++++--- include/linux/mmzone.h | 99 +++++--- mm/swap.c | 70 ++++-- mm/vmscan.c | 515 +++++++++++++++++++------------------- mm/workingset.c | 67 +++-- 5 files changed, 445 insertions(+), 394 deletions(-)