Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3082369pxm; Mon, 28 Feb 2022 11:38:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJy0bxwDoZc1NdeKK8LUSMEjzBzsvSRacug06ynTYnQUe6MuaPeHa5gMy9YDA/nZr9k1cbqH X-Received: by 2002:a63:407:0:b0:373:a770:b1c with SMTP id 7-20020a630407000000b00373a7700b1cmr18719040pge.93.1646077125119; Mon, 28 Feb 2022 11:38:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646077125; cv=none; d=google.com; s=arc-20160816; b=ZceV6w5M7/kabf/ArB3Rzfui5uNEhHMebvyN6XLvyiVBJjLjTizsvp/tWuozxbfCgQ qVKmvD7niYyWy30ax1L4diF220d9s0+eBjRGEM6inrMPMzGNfGVENzdom6haomaxWY95 46MSc0/vedcmf62v8/TZ5sj1dgUEy2WO0H3FnV+cHDduEZFHz63OYLBAjtV7SHAji4n4 cVfOORAtMq32sXLImSaoHOKGgDOoB3gboShcZqsfoK/GtIv8Bx3/7IDBSwNPnTNHTnl0 vpt4aLYiY/ezMcbENyo3ohXajOMMqZEY1O8W6ASPVjjWS68CKIr5bdmhDBGlhlGut0HO 0hdg== 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=XFD/luhJC8LruRYLMs0gTooM9kEU0Vb0THBd4sc3pRA=; b=O2eEYfhv4nU/mQ1uJEatB+IS82RPfYWCX42jy6NxrZSv3XmAX+jX161gBq6Mi7a1Am Qp1+Dp3Tw+GjVZg6r0YlFO9z0D4Ok96AhFGt7gXjYVr/A/fxI7Ic0jVzGVvqFIQ0/PVQ tuRVgmzNGZDm9Gr4EsTYP6DFF0r1Zd2Z2uZebF+5+yBvZfFGuQBSItvx6ub0RTX7wU65 va1QMT3JjU6Gnj5K/ORxl58MJvdue7UHlUp/YiQRH1HLp4+PUqvHlRyFotwCsDHndBTn Qq3qD6MjTWQ0/65k+nHAUu5W2HaX6jmTeDYNYsBEW0ydEcrCzJbOmfudCCO/UDuQeWp5 mwQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=KRyo6rUk; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id o16-20020a170902d4d000b001501c9e02eesi10798564plg.6.2022.02.28.11.38.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 11:38:45 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=KRyo6rUk; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BA7046BDFA; Mon, 28 Feb 2022 11:19:38 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234121AbiB1Srh (ORCPT + 99 others); Mon, 28 Feb 2022 13:47:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233037AbiB1Srg (ORCPT ); Mon, 28 Feb 2022 13:47:36 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDC0D21D; Mon, 28 Feb 2022 10:46:56 -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-out1.suse.de (Postfix) with ESMTPS id 91D2E219A0; Mon, 28 Feb 2022 18:46:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1646074015; 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=XFD/luhJC8LruRYLMs0gTooM9kEU0Vb0THBd4sc3pRA=; b=KRyo6rUkMNul2GZJKG7Kx0l4Nw4gD3yieyj/lCJCTigs5UFZ978tEqO1/WbNe75Q6r5PU/ jEvk+0GNiPgx1SINVBkCHyUeG/o7df+NptnWhTTZ+74gBbV0gL7jhYSV9B5RCwwVVOAH9R vHSGjFMxoT/+7S52NU/YCFOvI+99ku4= 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 6539F13AE1; Mon, 28 Feb 2022 18:46:55 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id rAuLF58YHWJGTgAAMHmgww (envelope-from ); Mon, 28 Feb 2022 18:46:55 +0000 Date: Mon, 28 Feb 2022 19:46:53 +0100 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Shakeel Butt Cc: Andrew Morton , Johannes Weiner , Michal Hocko , Roman Gushchin , Ivan Babrou , Cgroups , Linux MM , LKML , Daniel Dao , stable Subject: Re: [PATCH] memcg: async flush memcg stats from perf sensitive codepaths Message-ID: <20220228184653.GA1812@blackbody.suse.cz> References: <20220226002412.113819-1-shakeelb@google.com> <20220225165842.561d3a475310aeab86a2d653@linux-foundation.org> 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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 On Fri, Feb 25, 2022 at 05:42:57PM -0800, Shakeel Butt wrote: > Yes, the right fix would be to optimize the flushing code (but that > would require more work/time). However I still think letting > performance critical code paths to skip the sync flush would be good > in general. So, if the current patch is not to your liking we can > remove mem_cgroup_flush_stats() from workingset_refault(). What about flushing just the subtree of the memcg where the refault happens? It doesn't reduce the overall work and there's still full-tree cgroup_rstat_lock but it should make the chunks of work smaller durations more regular. Michal