Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1500143rdb; Fri, 1 Dec 2023 20:52:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IFkPUmkE3e2VIkI+QUlPLWH9ryBrzu023lRMLUi4k/tVPvSovhwG4SisJ9fZYm1PNpMUJiT X-Received: by 2002:a05:6870:2890:b0:1fa:fa54:4d4d with SMTP id gy16-20020a056870289000b001fafa544d4dmr1141954oab.33.1701492738159; Fri, 01 Dec 2023 20:52:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701492738; cv=none; d=google.com; s=arc-20160816; b=DbebXxLHMOIGITBMXOeQsimcHpItSVhFxZ0noKRohBVNWwWwfvCI0USHvS5Q2sJMvp NUA4Sgu0YpR8RufIT4mxjdqOAD1Jwgi0FN75cf+NicQJ8nTgnFTWBtudleL1Sw6EZ2lq 5jmxrdxZflQ3pOmxHApyvOm57ZI43y9E0KtqmuXk3PVYSikc0stMyvCIX1i2Af2lCp7h AvXCxqAvIm9a22QFtNW94voO8ufa9Wl4vDP6KjLu22CBK5KxsJ3Ws4txVsE3NopAjG2Z wfmlfrRr0tiZtZ2xCdJYxgtn+0udCuIjAv1PapAgt3epQFUY/CjJyM0mHjbH90EGI1/y wMpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=U2qcgHioeM3UqyvMPr3V1bhPDDu62MtFokimKSIjeVM=; fh=inIN3o/bz3P2Zj9YzrCxKnDycEo1u6XBnZ5mO1cOGPI=; b=X+/zvhjb43pRmxhAegWzkGcDhA7KiuXTHdLMTyGO7MeXLObLAAcudk5oK9WsoBbORY YZK2JnDKD2Iunfr2zubxFYAawwmBIcI7kgNaaYfV0ziKjqlDbtr07LTpBBI9G5ps6pXh FoDlRwqEz7s6uGXUT25TtE1zFTJ6ng9db7VjG8IdIG4coN/iBFH6G3BvvU6heTPut0WK PsIo9CxaWMYoDKFKuEyFSCzkShVXXXb+C7AAmnkECdmbfJFUX/0zmsQhjClI4Wy+i+Ml +pFXWdTBqNGdygUHx2yq3IiWoVvWdciXUDVZuXVSXtvhk6Fi0wlgut7C7A/obxc4z2CQ l+kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=kFBFAGKQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id q21-20020a63e215000000b005859c255ce8si4523963pgh.819.2023.12.01.20.52.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 20:52:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=kFBFAGKQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 465B984C29A5; Fri, 1 Dec 2023 20:52:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231876AbjLBEv6 (ORCPT + 99 others); Fri, 1 Dec 2023 23:51:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjLBEv5 (ORCPT ); Fri, 1 Dec 2023 23:51:57 -0500 Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACA45D7E; Fri, 1 Dec 2023 20:52:03 -0800 (PST) Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-6d7fc4661faso907965a34.3; 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=vger.kernel.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=kFBFAGKQy5F9PTAVUbxPSdfEPCRkYwNP5fCCpWL7ej23d++3WT/6RrsrYo1Jzdga3e ZRuqO6lqNv960aLCX9ff/qlxPP+NsvqvBndSd+waD5yZmht/AaSw3dg8q4U6Ztgw9DAg IbFBmFsd4I/G5Cu2wvyLuBGFO+fkFOPkA7aXSa7yhAGATkzbYs3i91J1NSs0T13zrGaX LORXb5amt+gyuNeWsN85qdJLpHnTpsE+I5sWc7rz0KV58TJnaY3qnlUcgNHeVr84wjQ+ IV0URYO9H7NVqwpP8JS9uUGJg+j5O+Vf0fJyY7h5vjG+ATyKt+V/Rqkx6pzJ8KjSlFN4 W/JA== 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=v2okGxnkRzSJjWwsFS1YgrcQSeDC7M8z3dNCYOz3D4oxO0VANvrcqG1Onr7eeCcsnB u8b0XCLlxZyIDn4UOgI3iwOdJVYha6ymCAu6Qen5a3UGlIHMnjzDD0/Gw17+NMY7mc2c pTHqGVQk5upieAXzYLrcGvMdQN8gKVV1vqFdmwQPHV2GqVTGkxqlraqImBumbnGCjjoR 8mlBSZopNUOmIGuDCvmChPn1dT4qgKo423vBy3Cu5P+tBBHwA4V9rOL4yH4+G9HAHU8r AlYE56xvk1BrXxSefhU95J69WwKZa6RP79+sAB4jUmO4f0rLtQXFb56fYGfvRfsf6XGG MMjA== X-Gm-Message-State: AOJu0Yw/V0fuhpiSpuBcRJandI5WQKYTyWhrDd/V690I3Y0Y5sa2GlEp 1CLEBJhBmNGW+7sKwukAKlw= 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-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 01 Dec 2023 20:52:15 -0800 (PST) --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--