Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp443056pxm; Wed, 2 Mar 2022 01:29:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBDKIzO7Us0BNbtnGnx3eAcIjiqcvBZrktduSzcK89ReVag7tWNNxCBvWP3rW/yVmAoNwf X-Received: by 2002:a05:6402:4384:b0:413:9e36:b56f with SMTP id o4-20020a056402438400b004139e36b56fmr17702293edc.280.1646213365847; Wed, 02 Mar 2022 01:29:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646213365; cv=none; d=google.com; s=arc-20160816; b=r4Argp7kRlkZ4H+FAx8t6p9KnhKLvLRzydElDU926QEnMYHUNeo0ZFUC6qbmwbdh7X ebPiOvcQY93sRq+pNxjztj5xB/YU6dlvjEpW8NT60MTojV9rVXzbRsHGJsRWyikfImqa lvlaxfBbbPg+4YiDYhROr+zvAqxwyWs3kLzWqwLVJujUskjJhd6N2dUUtBLw6gHxWxnB TshhTDLhKY9tB7wSw2cjadhP8cexVBu//2jIk0Tt5PbQvmR7SJ4Eyd3df7DpalX1joFI LaG++bXlOpmeRNZV+yz9ymH1EsG88yB6YaLNZOCjL7JSI7gLf9NWHhI7Q358TciNjAb7 am5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=buWeJHt6GiyDyp6c2t6RjOy396An8wRLpBnyIHHufHY=; b=F90w5kcQzCd45hz+6Y9QKZVmAqM18VdsaY8sp/F0EaKVg/1XAaaZV309ccWE8e/vjQ 6jHr9kOSQSxv1Nx3Ew+QwUGgx/scUag8Ft/RHnt6yqVCaxDD4KKYpn92vE5OhQo23wzV XjKriajhhsQkc3DLlS4XwUvgF8+TYFrRWVjl3BAKDyxLh1LwenGpuabg5i/oMmIjgq0a xdL03Hl8tRWswMaxpy3/he4B3IxOWWPcYUJ4rhHmm8xZRAQQxVmU4vhZzfLegeVFcnm9 892J1E/uhwRInGTd4sbNmSdMHuQRiuEPxXd3WPQCUxrPAMcjJuP+Mi3/gcc4ZafGfz4A 68/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="Qa/tlCjN"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e26-20020a170906315a00b006cf60c8c029si9186743eje.340.2022.03.02.01.29.02; Wed, 02 Mar 2022 01:29:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="Qa/tlCjN"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236727AbiCAR55 (ORCPT + 99 others); Tue, 1 Mar 2022 12:57:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236724AbiCAR5s (ORCPT ); Tue, 1 Mar 2022 12:57:48 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6CFC41F8A; Tue, 1 Mar 2022 09:57:06 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 6E71A1F39D; Tue, 1 Mar 2022 17:57:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1646157425; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=buWeJHt6GiyDyp6c2t6RjOy396An8wRLpBnyIHHufHY=; b=Qa/tlCjNWZWBuQe2pEOePHVesePkJsxgpGAcf+RKInChvZEOpBSOv16KjCk6wN3eB9rRmD GZyyOTwaEbMN0GGXw2Xmw8uaT/U5BevMNkAopM6bozcI14rCPFaheJSxDUirS59knYxmsK 6sub2e238Ivp/5yAAgjARKA1omAM1WM= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3EA0313B89; Tue, 1 Mar 2022 17:57:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Ks7BDXFeHmJXRwAAMHmgww (envelope-from ); Tue, 01 Mar 2022 17:57:05 +0000 Date: Tue, 1 Mar 2022 18:57:03 +0100 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Shakeel Butt Cc: Michal Hocko , Johannes Weiner , Roman Gushchin , Ivan Babrou , Andrew Morton , Cgroups , Linux MM , LKML , Daniel Dao , stable Subject: Re: [PATCH] memcg: async flush memcg stats from perf sensitive codepaths Message-ID: <20220301175703.GA10867@blackbody.suse.cz> References: <20220226002412.113819-1-shakeelb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Making decisions based on up to 2 s old information. On Tue, Mar 01, 2022 at 09:21:12AM -0800, Shakeel Butt wrote: > Without flushing the worst that can happen in the refault path is > false (or missed) activations of the refaulted page. Yeah, this may under- or overestimate workingset size (when it's changing), the result is likely only less efficient reclaim. > For reclaim code, some heuristics (like deactivating active LRU or > cache-trim) may act on old information. Here, I'd be more careful whether such a delay cannot introduce some unstable behavior (permanent oscillation in the worst case). > Now, coming to your question, yes, we can remove the flushing from > these performance critical codepaths as the stats at most will be 2 > second old due to periodic flush. Another aspect is that people will notice and report such a narrowly located performance regression more easily than reduced/less predictable reclaim behavior. (IMO the former is better, OTOH, it can also be interpreted that noone notices (is able to notice).) Michal