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 B35C8C433F5 for ; Wed, 16 Mar 2022 16:27:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F266F6B0071; Wed, 16 Mar 2022 12:27:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ED64C8D0003; Wed, 16 Mar 2022 12:27:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D9D6E8D0002; Wed, 16 Mar 2022 12:27:08 -0400 (EDT) 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 CBEA86B0071 for ; Wed, 16 Mar 2022 12:27:08 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7816F182751A9 for ; Wed, 16 Mar 2022 16:27:08 +0000 (UTC) X-FDA: 79250778936.21.E3E3F8D Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by imf23.hostedemail.com (Postfix) with ESMTP id 035B2140023 for ; Wed, 16 Mar 2022 16:27:07 +0000 (UTC) Received: by mail-pj1-f42.google.com with SMTP id 15-20020a17090a098f00b001bef0376d5cso2878286pjo.5 for ; Wed, 16 Mar 2022 09:27:07 -0700 (PDT) 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=LOz30deJcjhjIyXrEXiDnvgZ+SlnXxBb7kUkmufCFCs=; b=euiuCzfqGkYwgdoQmNRDghuuPrAiXcUV401r/vjPV6N4ydFbIk4O/ZZos55iCYihiJ 1B2Rdtk2zITgdDZnW4fAcsQkznCDbtClCUyNsp3+wGQqZhtsZcavfxaZO4uc39FbFK5c DPNGY6oCGwYL2dtnywRcf3II37L/WfRmydceUYcMRp7yEXaaDpJwqw0cdTtA7oUmf99K L3r2N2Ro8VNPJE16xuaG4MaBJbyvbNiaNwRSY0Eyjwppc6RxiTgg9+8s5wDbscVHjrjn S/F6K4GdPfbGbLMp3h+Y+rNlIC4IvgqTUFpV8l+loRNejQDA4QjoTkD9Bx4o+eQmBScb t/ow== 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=LOz30deJcjhjIyXrEXiDnvgZ+SlnXxBb7kUkmufCFCs=; b=CHzG6Z6Zb1PjibK71WbQLEOruYq4hYKt4KGjMnXwtgPae3dNYWfVFn8kDJ3WJdGCVj dUex3YQr2V1UUxLvv8qhxvJAl8/J5rGw/3Hh938SK4r7l7R5RIuykXUyHF3lMhmNPlTt OleOPMxi/uABGoRWg/HV1Qus6ToCp8nzkgyQdsZwkYQ4LZPQ7dTJ3lLsqmPVYw9su26n 55h/FA5S9OCIwGUFGpPpfg3oEidAsK32LVxvEhLDXKVNjei7JXYLiHFymJ2vnR1ab8+C 9FLWA0uz28XkQzxfaEr47sjzUQrUMajjZa2eWAwoi4AIiZHHEDaKViRBQw9WCrrTKxq3 J7Zw== X-Gm-Message-State: AOAM530eDp4EXL/lTkaKCO1RdE5VolF+fVgSAhONgcjzt11EHzuDXnYo +ZmB4z7mXSEgm/8Y1a0aymYAy1n7kf/gqmHegjuRNw== X-Google-Smtp-Source: ABdhPJytOF5H+Jf3tnI4511+heBxknFBPUzXrfadFH/aaaKAfnciI9nJzGVZMoY9Fe2031uuscVswxuuo1OcklRO2DE= X-Received: by 2002:a17:902:e745:b0:151:5474:d3ed with SMTP id p5-20020a170902e74500b001515474d3edmr319937plf.106.1647448026684; Wed, 16 Mar 2022 09:27:06 -0700 (PDT) MIME-Version: 1.0 References: <20220304184040.1304781-1-shakeelb@google.com> <20220311160051.GA24796@blackbody.suse.cz> <20220312190715.cx4aznnzf6zdp7wv@google.com> <20220314125709.GA12347@blackbody.suse.cz> In-Reply-To: <20220314125709.GA12347@blackbody.suse.cz> From: Shakeel Butt Date: Wed, 16 Mar 2022 09:26:55 -0700 Message-ID: Subject: Re: [PATCH] memcg: sync flush only if periodic flush is delayed To: =?UTF-8?Q?Michal_Koutn=C3=BD?= Cc: Johannes Weiner , Michal Hocko , Roman Gushchin , Ivan Babrou , Frank Hofmann , Andrew Morton , Cgroups , Linux MM , LKML , Daniel Dao , stable Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 035B2140023 X-Stat-Signature: g7qu8jo9pw64edcb67q7mkp7u864zm4s Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=euiuCzfq; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf23.hostedemail.com: domain of shakeelb@google.com designates 209.85.216.42 as permitted sender) smtp.mailfrom=shakeelb@google.com X-Rspam-User: X-HE-Tag: 1647448027-501060 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000003, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Mar 14, 2022 at 5:57 AM Michal Koutn=C3=BD wrote= : > > Hi 2. > > On Sat, Mar 12, 2022 at 07:07:15PM +0000, Shakeel Butt wrote: > > It is (b) that I am aiming for in this patch. At least (a) was not > > happening in the cloudflare experiments. Are you suggesting having a > > dedicated high priority wq would solve both (a) and (b)? > > [...] > > > We can't argue what's the effect of periodic only flushing so this > > > newly introduced factor would inherit that too. I find it superfluous= . > > > > > > Sorry I didn't get your point. What is superfluous? > > Let me retell my understanding. > The current implementation flushes based on cumulated error and time. > Your patch proposes conditioning the former with another time-based > flushing, whose duration can be up to 2 times longer than the existing > periodic flush. > > Assuming the periodic flush is working, the reader won't see data older > than 2 seconds, so the additional sync-flush after (possible) 4 seconds > seems superfluous. > > (In the case of periodic flush being stuck, I thought the factor 2=3D4s/2= s > was superfluous, another magic parameter.) > > I'm comparing here your proposal vs no synchronous flushing in > workingset_refault(). > > > Do you have any strong concerns with the currect patch? > > Does that clarify? > > (I agree with your initial thesis this can be iterated before it evolves > to everyone's satisfaction.) > Thanks Michal for the explanation. For the long term, I think all these batching can be made part of core rstat infrastructure and as generic as you have described. Also there is interest in using rstat from BPF, so generic batching would be needed there as well.