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 0929EC433F5 for ; Mon, 28 Feb 2022 22:46:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7E4FC8D0003; Mon, 28 Feb 2022 17:46:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7934C8D0001; Mon, 28 Feb 2022 17:46:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6AA288D0003; Mon, 28 Feb 2022 17:46:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0152.hostedemail.com [216.40.44.152]) by kanga.kvack.org (Postfix) with ESMTP id 5C5D28D0001 for ; Mon, 28 Feb 2022 17:46:57 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 1E691978F3 for ; Mon, 28 Feb 2022 22:46:57 +0000 (UTC) X-FDA: 79193675274.18.F979AC7 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by imf24.hostedemail.com (Postfix) with ESMTP id 8CC6B180005 for ; Mon, 28 Feb 2022 22:46:56 +0000 (UTC) Received: by mail-pl1-f177.google.com with SMTP id z11so3564786pla.7 for ; Mon, 28 Feb 2022 14:46:56 -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=Hgo7nIwikPFG0zX2826ZrjvDWAFM00cZZMhfscIEBzMkUk4bQTuoJZaeYGR+rQfXrT tMSFtbnys/ZseVEcKE+Dz3kIOXjoRohWlKOnSGhyRncOXGktr68oXeI0WW10W89wLXzG CnBTG/3gcKA9aNp1w/eaDjAioAqk9m2wz8gvZXEkbwH5ikaB/Wl6djiKDRpBP4vrszxJ ezgYJ/jm15JI7TZXG7qwWa+gEKJr/ajxAm9FCRYMxDV5meJM0upC+DYZf27eX286spED I///PMWx6oN1bWxg79+7vAV/ndtwTv2jIgK8SqaJ7E7z75srawqEicsbFHvkf357GKyw yndQ== X-Gm-Message-State: AOAM530CMKFp1txKj0qxvuw6u5R3PtTz/VsnngNY+8sprn1iTvDgfSxS 4IkVta5Qz2yC8YYJjqjLHGX8arUEjUn84KbMteHfTQ== X-Google-Smtp-Source: ABdhPJzsghlkq6BU0I6LPAO56Tv+4suMMu6V1k1d4Uy6Z43D+GNTocRNhUW9x/uRixnOWsMjqGp30B9Php1ZVuXO+Kg= 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-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 8CC6B180005 X-Stat-Signature: jtx1rrx3rjtsjdwgazhj831o8mtwdxia Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=Q1mmID59; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf24.hostedemail.com: domain of shakeelb@google.com designates 209.85.214.177 as permitted sender) smtp.mailfrom=shakeelb@google.com X-HE-Tag: 1646088416-506588 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000048, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.