Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp440275pxu; Tue, 6 Oct 2020 09:57:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcDWPxpSDvaGCLs7n6iT5wMLb8BeLTq2HWJ0osXumDgPfKaKw/eXCl8Vako6X/G34wuz66 X-Received: by 2002:a17:906:1644:: with SMTP id n4mr507599ejd.332.1602003467883; Tue, 06 Oct 2020 09:57:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602003467; cv=none; d=google.com; s=arc-20160816; b=ZFRzoWlHtcHFYlQBekHHO99mSo++s//fcjhJc5Zr0cZnyuic1gcOtBHZMooFqu2C1P lcVwTWWFvrAkohSKpQ6a8fsaekvKaTSEXGhLSVtMaF6XTttaBcrCR3BOW24ZDCl/Tyws 8sPTK5XuyGsNCDBX+sTXIc2WLaiEJyiTTDSLbS6Y1ON5aFY77cNTEc+i4+i24GdIg1zj NU4EqgulJg65B8XIzZMvYnppt6MKOGy1nXmLtl480ipuByZBeg55Lwb68imlFLtaYTJl C7RV6tU2Txn9zPOZkA+1pKFVSLDJqyRYsrQeEP9ZhvpbT9t81s4bR6x0ss6KrHUlcOMc IxVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=6FMgIEmm68X+8barBvlty/GsDrmbyTvteiUC/zViSzM=; b=Uz5b81wmzqfuD+uyrMAXeNj6KNH7CczHD83QL9kF5VChIkeVXayuiKpRyuB2Eurx+f FkdPURHKfSB9j5CI9IVB/rpsrZ8OQu3HlnjgEWjtnz52rJMmO5DQAzq2nXkYc3DaTPfp zv65N7SVDcixjfKH4yZ2AohSqIHiEXw0ue9DQ3d7bnZHURIrMifFKBPsThOOmgeFiq0z yqgQppV3d7nZZs54OTGeoHs4N3L3UYi6IfdME1dV2FwoNZ8qLfUvFkmSUbz8KoD/UYrx NQuL+ibAPrX28vft3iM63tR7PHQzL0PJBz46slUr1zxuZxRu9HEfDqfK9G2TSXT6CbgJ P+Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=E+fs5Kb6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d10si2873812edt.247.2020.10.06.09.57.24; Tue, 06 Oct 2020 09:57:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=E+fs5Kb6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1725981AbgJFQz5 (ORCPT + 99 others); Tue, 6 Oct 2020 12:55:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725902AbgJFQz4 (ORCPT ); Tue, 6 Oct 2020 12:55:56 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68E53C061755 for ; Tue, 6 Oct 2020 09:55:56 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id a5so6110056ljj.11 for ; Tue, 06 Oct 2020 09:55:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6FMgIEmm68X+8barBvlty/GsDrmbyTvteiUC/zViSzM=; b=E+fs5Kb6ZtKcDpUZvLnSB08EOAVj2XhAZad69x+W3WhY0TvKQs7HLnWuX1DalOm5k3 75g0XMp7neiJ0e9OM6kSd7eBrufBh65ij0geSUYX+V5pNfDC72uq3vfmfDr0gtlZMpbJ DcQ0L1pYWRcCDJNfvgKMXtdc4EmejdC6A7ZExgxw+UxR0Ojc0g9NL1qIJs/8vB0fMhdJ x1JgRTLTqvDnnjFkkyrjySeMyl+r5ulpW2pQVTHhS4Ehu9+aX8n2CePeR3tUCCaBQ07T OQZfOuGO2gJWiGAternLPjoBUgE1ZZbuHrHcPcpP/ZzCWyLa8C6aBNI8lPQeSibLV3XP Y+Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6FMgIEmm68X+8barBvlty/GsDrmbyTvteiUC/zViSzM=; b=l2U4BIhDViIuE2ffcVoI98bqKkwL45Wwhlu4FOAWGQHhiCMVHWvMiMkFa7HrZCOuNk WBwa9LX5La/UULMhmhIO4XXtp58r5WpFQdNrMtYZy6xb7oAgF76wHPV1/BJJHdcT6B4w jd2f4j+XW2S2AHWiU7KEUOarE2xMhNuKKxZZw0qF8TiJPSiJC9Y7yVZ4VrlzRP6I0wT1 6V4pEqN7+35aNURiFjMhiF4MDX/kRsCu5fXTyy4nyFTBIFkOJmClEkNc8IrYLpvCVGr0 wi/T3rxA73aYV5zllTtbsEAAy2i3+p093g/fgUFHxX4VMhdCa4hy5q/V7ZW8lCxx1kAC SwWg== X-Gm-Message-State: AOAM5307LPdpIXXQ0xbHZuktcj+RjRzcQPjKx7n2PXXWGhmxCZ+NmhXg lZTxZzhb+XSuRrnxbPNWHUWZEsYMMlFbFwM4nNFmDg== X-Received: by 2002:a2e:3c0e:: with SMTP id j14mr1670185lja.332.1602003354535; Tue, 06 Oct 2020 09:55:54 -0700 (PDT) MIME-Version: 1.0 References: <20200909215752.1725525-1-shakeelb@google.com> <20200928210216.GA378894@cmpxchg.org> <20200929150444.GG2277@dhcp22.suse.cz> <20200929215341.GA408059@cmpxchg.org> <20201001143149.GA493631@cmpxchg.org> In-Reply-To: <20201001143149.GA493631@cmpxchg.org> From: Shakeel Butt Date: Tue, 6 Oct 2020 09:55:43 -0700 Message-ID: Subject: Re: [PATCH] memcg: introduce per-memcg reclaim interface To: Johannes Weiner Cc: Michal Hocko , Roman Gushchin , Yang Shi , Greg Thelen , David Rientjes , =?UTF-8?Q?Michal_Koutn=C3=BD?= , Andrew Morton , Linux MM , Cgroups , LKML , Andrea Righi , SeongJae Park Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 1, 2020 at 7:33 AM Johannes Weiner wrote: > [snip] > > > So instead of asking users for a target size whose suitability > > > heavily depends on the kernel's LRU implementation, the readahead > > > code, the IO device's capability and general load, why not directly > > > ask the user for a pressure level that the workload is comfortable > > > with and which captures all of the above factors implicitly? Then > > > let the kernel do this feedback loop from a per-cgroup worker. > > > > I am assuming here by pressure level you are referring to the PSI like > > interface e.g. allowing the users to tell about their jobs that X > > amount of stalls in a fixed time window is tolerable. > > Right, essentially the same parameters that psi poll() would take. I thought a bit more on the semantics of the psi usage for the proactive reclaim. Suppose I have a top level cgroup A on which I want to enable proactive reclaim. Which memory psi events should the proactive reclaim should consider? The simplest would be the memory.psi at 'A'. However memory.psi is hierarchical and I would not really want the pressure due limits in children of 'A' to impact the proactive reclaim. PSI due to refaults and slow IO should be included or maybe only those which are caused by the proactive reclaim itself. I am undecided on the PSI due to compaction. PSI due to global reclaim for 'A' is even more complicated. This is a stall due to reclaiming from the system including self. It might not really cause more refaults and IOs for 'A'. Should proactive reclaim ignore the pressure due to global pressure when tuning its aggressiveness. Am I overthinking here?