From mboxrd@z Thu Jan 1 00:00:00 1970 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 90AE3C4167B for ; Sat, 2 Dec 2023 04:52:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0BF0E6B046C; Fri, 1 Dec 2023 23:52:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 06B1B6B046D; Fri, 1 Dec 2023 23:52:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E26206B046E; Fri, 1 Dec 2023 23:52:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id CFB206B046C for ; Fri, 1 Dec 2023 23:52:05 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id AFF7E14041E for ; Sat, 2 Dec 2023 04:52:05 +0000 (UTC) X-FDA: 81520656210.22.E9CA3B3 Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) by imf04.hostedemail.com (Postfix) with ESMTP id D7A754000D for ; Sat, 2 Dec 2023 04:52:03 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=lU3lveqp; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf04.hostedemail.com: domain of bagasdotme@gmail.com designates 209.85.210.46 as permitted sender) smtp.mailfrom=bagasdotme@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701492723; 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:in-reply-to:references:references:dkim-signature; bh=U2qcgHioeM3UqyvMPr3V1bhPDDu62MtFokimKSIjeVM=; b=LD7P5cDrCn/YqNVrchY2TpfUzwqeshfeoCg4svhYnA9npHNUSCT2l6uqD6WxzV3Jid/O2R /wok2PiclXIta5XJiAIBRWGw8Fb+gTB2bOzyAXIxonkAEc2via8Y5HNorDsfAGJaJHU4Pr cSSikOmZ+7wZoJ8LaukMkouqwOORZoA= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=lU3lveqp; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf04.hostedemail.com: domain of bagasdotme@gmail.com designates 209.85.210.46 as permitted sender) smtp.mailfrom=bagasdotme@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701492723; a=rsa-sha256; cv=none; b=N9a336MBMbKFeqT4np7qPe36M92pMzs47njEg8coodNKq6KNDtVGnu7iEg8QreGc2ppCN4 y+xnjYtr4JjuKIXkM+wrQM2quX04JyZxq2+iHPBSIey3tGKQ1dN445aYp1eKMi17TtU9mG 8DA6c5Fm2qIh0VerVBmGTztC7XqxmTY= Received: by mail-ot1-f46.google.com with SMTP id 46e09a7af769-6d7e56f6845so913438a34.0 for ; Fri, 01 Dec 2023 20:52:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701492723; x=1702097523; darn=kvack.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=U2qcgHioeM3UqyvMPr3V1bhPDDu62MtFokimKSIjeVM=; b=lU3lveqpe3AoK4IoqSXatRMtNrqpLDy5KBvMsFimRussgVOch6l1OwbDVQNDIWyOuP YcIQo10JPIXx02vpaL5aP7eX/V7SrYV+Bi6oINf6Bk2ekx6nLQyjIgty/D3utzWBUGft iFZ4wpPG2scQVwbYB9hBXEDd5XnGEZo7FKTlW5iGcDKdwUj9q6IqmeWFT1bQJFBNwoXC ILsUnqajHWGcH2HpZF0DqpxGs9I3wtMkQJlBv2FzO26nlc+T3PtqfpnvK8tnffHtC86q mPexrsKgcMCj97Ue79xNnxDO5abdOyeb4uiUN2MbJIC8hnfORHfes1GBUmmjFb34mgZE qkdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701492723; x=1702097523; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=U2qcgHioeM3UqyvMPr3V1bhPDDu62MtFokimKSIjeVM=; b=ntQPykrK0fXy55wxu5gln/p6Dx9BR6TP5qEY2QP7PD1rext96gSOrGyACh8HYw0I+2 JOqQsyjOzk5JownQuLj7Iaz3tVgSdE9E5xpX7hIGw9ezr3I90CHkJaLC+rwlht3F2e2g YFVQwQZVW3kPeSF1Xh9WCnAPqw2A54PqXuN0gucsTzRVk73YEk6eINYnkiJjSuqYvEOC 6ZyfcujjixPF9Nq0bUGcZIVQyQcvz+GbUkr9LudqSUPDUwbC9aVE6JdMMl6zwq6rgNBu sPDVb4j8chKeCqIqpYPDr5zl7I6FQg2iSsZCI8/x9suCRFULcXorhCgTga3EQsLWtjXr cZWw== X-Gm-Message-State: AOJu0YyuHl7yBb7v4QK2Ac3+myC538TkNAmBdt/kx0mXvAfYjCSPVu/l VmH5QkmmW+NpAceJw2fsvvI= X-Google-Smtp-Source: AGHT+IF/vmaKUNG5qrF+W01y9HhVT669/VcjaRhOtpiHj0vVmlUgHGI3LtGF08hI8ptteTRojtoYrg== X-Received: by 2002:a05:6830:439e:b0:6d3:127b:6fba with SMTP id s30-20020a056830439e00b006d3127b6fbamr963345otv.9.1701492722863; Fri, 01 Dec 2023 20:52:02 -0800 (PST) Received: from archie.me ([103.131.18.64]) by smtp.gmail.com with ESMTPSA id r8-20020aa78b88000000b006889511ab14sm3813267pfd.37.2023.12.01.20.52.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 20:52:02 -0800 (PST) Received: by archie.me (Postfix, from userid 1000) id F1AD010211875; Sat, 2 Dec 2023 11:51:58 +0700 (WIB) Date: Sat, 2 Dec 2023 11:51:58 +0700 From: Bagas Sanjaya To: Yosry Ahmed , Andrew Morton Cc: Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Ivan Babrou , Tejun Heo , Michal =?utf-8?Q?Koutn=C3=BD?= , Waiman Long , kernel-team@cloudflare.com, Wei Xu , Greg Thelen , Domenico Cerasuolo , Linux Memory Management List , Linux CGroups , Linux Kernel Mailing List Subject: Re: [mm-unstable v4 0/5] mm: memcg: subtree stats flushing and thresholds Message-ID: References: <20231129032154.3710765-1-yosryahmed@google.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0SGrbMye1JyaEl8d" Content-Disposition: inline In-Reply-To: <20231129032154.3710765-1-yosryahmed@google.com> X-Rspamd-Queue-Id: D7A754000D X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: mpxd1nxj4an4badpwydqqiuxg4eogwzw X-HE-Tag: 1701492723-411091 X-HE-Meta: U2FsdGVkX18uzVktRZbyKnSK43bZgss6FHxkg1jtZ0Iz74opIII4gBBG+S38TNiWUlwPNSVmil4Mh/ISmUsXnC3oaFHe9cE/firTErogxP8rUSj8FwEFjJ1x2L85V4vTcQRVtS8cllx2iVA5cwg9y+UDoGrUwcQyCoeHP3cbjEcTBn2X460BpH/8IKaGAoIrQwXezm4TLLq/gz6fXxr3mGh+wkJGrhOUq4tdF6XydqeqNH4NJzpdgGIgYbW1N85aU7dZ+0bPtQReI+QmXpLBotzXVO6XbmX1K169FIMNaqhIeUHfaYuQRroP573RmyCsqmCxsb8IHgo8vROuFlhuDD2hgNKTefxEh529PQ/AFyVQrXlzHM6EZBNXO1ks59pT5S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zNkb9T6iht7E9njWYhmWl+C6M/a2+WSo/GffJXPMuge1SLgfvw2WCyCj4TuiJB8O0CPHpx+ysIAFatwJnqq/Ws8yIXdWw32c6PKJRox12QtaUOzsc47a5Jdu0Y0Z9ftU5uPWSZMWZoiBMNRxhvwXTN1kFaEjMIVfX+OVp7xq+CCp5P2I= 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: --0SGrbMye1JyaEl8d Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 29, 2023 at 03:21:48AM +0000, Yosry Ahmed wrote: > This series attempts to address shortages in today's approach for memcg > stats flushing, namely occasionally stale or expensive stat reads. The > series does so by changing the threshold that we use to decide whether > to trigger a flush to be per memcg instead of global (patch 3), and then > changing flushing to be per memcg (i.e. subtree flushes) instead of > global (patch 5). >=20 > Patch 3 & 5 are the core of the series, and they include more details > and testing results. The rest are either cleanups or prep work. >=20 > This series replaces the "memcg: more sophisticated stats flushing" > series [1], which also replaces another series, in a long list of > attempts to improve memcg stats flushing. It is not a new version of > the same patchset as it is a completely different approach. This is > based on collected feedback from discussions on lkml in all previous > attempts. Hopefully, this is the final attempt. >=20 > There was a reported regression in v2 [2] for will-it-scale::fallocate > benchmark. I believe this regression should not affect production > workloads. This specific benchmark is allocating and freeing memory > (using fallocate/ftruncate) at a rate that is much faster to make actual > use of the memory. Testing this series on 100+ machines running > production workloads did not show any practical regressions in page > fault latency or allocation latency, but it showed great improvements in > stats read time. I do not have numbers about the exact improvements for > this series, but combined with another optimization for cgroup v1 [3] we > see 5-10x improvements. A significant chunk of that is coming from the > cgroup v1 optimization, but this series also made an improvement as > reported by Domenico [4]. >=20 > v3 -> v4: > - Rebased on top of mm-unstable + "workload-specific and memory > pressure-driven zswap writeback" series to fix conflicts [5]. >=20 > v3: https://lore.kernel.org/all/20231116022411.2250072-1-yosryahmed@googl= e.com/ >=20 > [1]https://lore.kernel.org/lkml/20230913073846.1528938-1-yosryahmed@googl= e.com/ > [2]https://lore.kernel.org/lkml/202310202303.c68e7639-oliver.sang@intel.c= om/ > [3]https://lore.kernel.org/lkml/20230803185046.1385770-1-yosryahmed@googl= e.com/ > [4]https://lore.kernel.org/lkml/CAFYChMv_kv_KXOMRkrmTN-7MrfgBHMcK3YXv0dPY= EL7nK77e2A@mail.gmail.com/ > [5]https://lore.kernel.org/all/20231127234600.2971029-1-nphamcs@gmail.com/ >=20 > Yosry Ahmed (5): > mm: memcg: change flush_next_time to flush_last_time > mm: memcg: move vmstats structs definition above flushing code > mm: memcg: make stats flushing threshold per-memcg > mm: workingset: move the stats flush into workingset_test_recent() > mm: memcg: restore subtree stats flushing >=20 > include/linux/memcontrol.h | 8 +- > mm/memcontrol.c | 272 +++++++++++++++++++++---------------- > mm/vmscan.c | 2 +- > mm/workingset.c | 42 ++++-- > 4 files changed, 188 insertions(+), 136 deletions(-) >=20 No regressions when booting the kernel with this series applied. Tested-by: Bagas Sanjaya --=20 An old man doll... just what I always wanted! - Clara --0SGrbMye1JyaEl8d Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSSYQ6Cy7oyFNCHrUH2uYlJVVFOowUCZWq37gAKCRD2uYlJVVFO o7N2AQDSNXpD6Axxh/WnApbIhH16SGiyDgp6Uioihd6PwgFtagEAzzRVEaimNHaK O5VpHq566EuUfCIWVZFuttw0/5KlFgg= =RYDo -----END PGP SIGNATURE----- --0SGrbMye1JyaEl8d--