Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3246411pxm; Mon, 28 Feb 2022 15:29:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJw7NojaquWlFlrcEi900ibb16l1z9bNwg+BTSlA3eK2tZzZo601o1TM1FMCkgjP3DigBQxX X-Received: by 2002:a17:902:8498:b0:14d:cca6:741 with SMTP id c24-20020a170902849800b0014dcca60741mr22594077plo.16.1646090965214; Mon, 28 Feb 2022 15:29:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646090965; cv=none; d=google.com; s=arc-20160816; b=mWG1hGX7DEx2VC1nQPXRFXtMI7FIOpO0WdAOB4IPgqZr5Ck7gf2nLt+ACOQlm4rDXy 5Ae8Kcj1Z5STE7svHl9q5vuwcC+vHlhL/Syl3ya8/7uLY11kHynXOxswP5Hul0JHpEJF 8ujnBolTCPYwIdyHYHdBw28UGv38TLNOLUPp45PablGOEYlnRYTKyWxMfzrla/dJhRHz FjzloTKwogzL0cdSsBBQ+f9eKWt7ZsrKuRqFL06Fb8KzhY5ndugCCrL0sGFn0sE5gxgQ R7hk8pS+f89fk2h+CPVhdnvtjiWEyz5Nqe3Zoqqyv4TKvSmZBwcYMhkNVpQg2JlZE4El a97g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=LglAJFBfW0192A+zdtC6aPQEwQomXk3iQX8CrMvwboE=; b=1LLw5Zx0fuYEGCzzo8LZqJQGFNasnhV3Inf9rPBe+PInxMgCMh6PjYsK9ltTU3NyLK 56hHK3JQfLqE0HLAefyEDsU2JJ7ISlB3FgdKfKZx0Y+Jqdpa9bcck/t0Jfg7cKC8GRBx sPgkM8JdFIRuufLo6zjwM4vT4KMq4kQ2UjkBZ5UzxuOyZM/CbYbyEICRwsBmJHsetT2L F7gZMdAjCu7iLtsXjVejuOaDWup6hi4WwsERjiJ9eDCfs1XJT0wjSV1KtGnnpwZifmFA JF9VDV4dl9NheVDclY4Nd3fSUEYccXKjL7Ii5K0E7t6hLr5qpeC47eZtqZJmHIDe0IAk ThCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Q1mmID59; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c136-20020a63358e000000b00373598b5495si10594455pga.309.2022.02.28.15.29.08; Mon, 28 Feb 2022 15: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=@google.com header.s=20210112 header.b=Q1mmID59; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231313AbiB1Wrh (ORCPT + 99 others); Mon, 28 Feb 2022 17:47:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230253AbiB1Wrf (ORCPT ); Mon, 28 Feb 2022 17:47:35 -0500 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3B281405E7 for ; Mon, 28 Feb 2022 14:46:55 -0800 (PST) Received: by mail-pl1-x634.google.com with SMTP id h17so6387507plc.5 for ; Mon, 28 Feb 2022 14:46:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=LglAJFBfW0192A+zdtC6aPQEwQomXk3iQX8CrMvwboE=; b=Q1mmID59L3r+ZQjhjmMSnqIrxTddfLL+dg5Yncv+WGGQrW3mSeBNuaKUkiOgbD16ON Y0LTiD+wKPqFjsANDBpDGbLewVglEMBb+vPQ7iNIWROAxQKLDwNXCF+WYl02BWzhGLrM RHRxrBI1VRXCO9gQotZhnjXQoYxNZA/2S1cnEpTKfFZzBzDcEjjcpQ4O2PnBazcDncIs +nVGzkVgPfD0o3Bbl0Qfx8P6RFMUgV/vo7Bq5I8obRVLwbq2yKktjX+2sOG0qerdAjJ8 I9L84JOIAHkzoTTOeBLgd7XNiy6mErmdRwXno8BokmhWTsT2XfcKd6xPZPwgfGwfXHJW UKJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=LglAJFBfW0192A+zdtC6aPQEwQomXk3iQX8CrMvwboE=; b=es7uVU9Zp/+WkWFGajeaYpMFYsTgP8iiO5HBtE7kYx9WMCz59bFHLtiwqQe62vvIvx L4nn5oWmMx4qVIbEKMOnDB/v83iKjzWUBdE2M0/4TzLm1NlQVzEVzlLGFlfbfuf0b8/3 krUnfKyYA7aS9ccLKvmOBraw0YdzFX32htxPzc5AHakMQP8u7scajE/fOzzu8SBTO2Ob letHaoRb3hGN2snU9zprAZ+/Q4DtjCzRQNvmwxYzDQS3zkNWgYjJZncl3bBH+1L1MCN9 G5avsXGKScMkbP+mRvE3T6J0URDf/Wk+nVJCMOKG/yR73yCoJR5tRG2yCNI/tVwGiki4 zvlA== X-Gm-Message-State: AOAM533PAyijFcJx8SF3RUBJBb4qKv1H6/RqhGK+p7mAmd8cMszByb8t PTq5FgGUzsev4LFMlVY8cAEQRo2cDrdpl1dhfXInew== X-Received: by 2002:a17:90a:db15:b0:1bd:71f:8123 with SMTP id g21-20020a17090adb1500b001bd071f8123mr15955979pjv.126.1646088415342; Mon, 28 Feb 2022 14:46:55 -0800 (PST) MIME-Version: 1.0 References: <20220226002412.113819-1-shakeelb@google.com> <20220225165842.561d3a475310aeab86a2d653@linux-foundation.org> <20220228184653.GA1812@blackbody.suse.cz> In-Reply-To: <20220228184653.GA1812@blackbody.suse.cz> From: Shakeel Butt Date: Mon, 28 Feb 2022 14:46:44 -0800 Message-ID: Subject: Re: [PATCH] memcg: async flush memcg stats from perf sensitive codepaths To: =?UTF-8?Q?Michal_Koutn=C3=BD?= Cc: Andrew Morton , Johannes Weiner , Michal Hocko , Roman Gushchin , Ivan Babrou , Cgroups , Linux MM , LKML , Daniel Dao , stable Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-18.1 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 Mon, Feb 28, 2022 at 10:46 AM Michal Koutn=C3=BD wrot= e: > > 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. > We can try that and I will send a patch to Ivan and Daniel to try on their workload to see the real impact of targeted memcg flushing. However I am not very optimistic about it.