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 B3E8CC433EF for ; Tue, 1 Mar 2022 17:57:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 101138D0002; Tue, 1 Mar 2022 12:57:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0B0CE8D0001; Tue, 1 Mar 2022 12:57:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EBAEE8D0002; Tue, 1 Mar 2022 12:57:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0254.hostedemail.com [216.40.44.254]) by kanga.kvack.org (Postfix) with ESMTP id DDCA78D0001 for ; Tue, 1 Mar 2022 12:57:25 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 968D6181C43A9 for ; Tue, 1 Mar 2022 17:57:25 +0000 (UTC) X-FDA: 79196574450.22.FBE7B74 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf09.hostedemail.com (Postfix) with ESMTP id C7543140005 for ; Tue, 1 Mar 2022 17:57:06 +0000 (UTC) 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-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: C7543140005 X-Stat-Signature: e4c41gkozuhn73kibesc6znujqyn9htf Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b="Qa/tlCjN"; spf=pass (imf09.hostedemail.com: domain of mkoutny@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mkoutny@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-HE-Tag: 1646157426-354165 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000004, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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