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 X-Spam-Level: X-Spam-Status: No, score=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14891C43460 for ; Tue, 18 May 2021 18:23:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EC4AF611B0 for ; Tue, 18 May 2021 18:23:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351532AbhERSYi (ORCPT ); Tue, 18 May 2021 14:24:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351524AbhERSYf (ORCPT ); Tue, 18 May 2021 14:24:35 -0400 Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FDCBC061760 for ; Tue, 18 May 2021 11:23:16 -0700 (PDT) Received: by mail-yb1-xb34.google.com with SMTP id f9so14574962ybo.6 for ; Tue, 18 May 2021 11:23:16 -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=XVc3DguSfxxYVXN0x5EkHPuQLUSzK1Aah2uiT3qFU3o=; b=Eq/h3JfOdyqBY6BBO5kopAzTdIl0PltU1tMCHbexs2XtJruCLS1NvHNDaPu1TNILLK LHW5iZ0PyiH/o5kSjrNNGuJn5VLbno2vPoiX3TrYdYpPP+dfPyq0fl8p/fZbukNNcqit ec/bdh3lmKUH+XySetmyMsKvkdVT/1tfFwUM9MU75ZB+b3JCX898BSNR6vDFJaTtPVjG AjM2bern9kVDfDrFDzOmq9lZG5sCHq1Ebvu2v21Jqbd5GRRFTiu7k52IrwDexYDAcjcF qfiKoeaWruQbbSWciPbQN4CxIsaciRekjAsII29RgOcSM/QpaHM3jd9fk/j+AifNXOvX SCtQ== 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=XVc3DguSfxxYVXN0x5EkHPuQLUSzK1Aah2uiT3qFU3o=; b=AQKtfEyoqJaSMbce3CibUu4d81HpWqRr4VdCPzrqFWHsT8Zu4NNllKiynfqibwpt5B cvEaIq1PeVkEOSihvzD5rGPIwaaPOcSrAQ/oM4bHjx5x7t97xSEOBjRMNcvZsKgQlKBp VItYhJRrYhaZGv96FZ+E0A9M2tAzA0to5ghoblWUAVgYEu4pUE12tquLpANB97qELdqN M/2PSnMjJImmAMVS6ehydl2CBh84IdjpCsgBTm/41g3seOAJ4zIoy5qPTELSWyofr38H nVyruICyR1oWRIfQuH+WswQNN/joBuqyWAC/IdFV8b0rwpwb3kVtGYDIYqCSf2kFNMlL 9g5Q== X-Gm-Message-State: AOAM533X5JPXxd9w631ry1D7zE+W4L/iDJDHnzX2Fb6oNvRIs0p6M/0t 5ohvOVXWQMlbbUq/dEY56zhZSomtxWPTHGC+EiFzTw== X-Google-Smtp-Source: ABdhPJzWO1Acrw6zrrOBxGupwyTWQVrMszflylG4NfHUekUTJSDPHLp8pyQ4hZO0U6sPW9jd/DVLtNs3JKWBra3ElPo= X-Received: by 2002:a25:c801:: with SMTP id y1mr9726961ybf.250.1621362195006; Tue, 18 May 2021 11:23:15 -0700 (PDT) MIME-Version: 1.0 References: <20210518020200.1790058-1-surenb@google.com> In-Reply-To: From: Suren Baghdasaryan Date: Tue, 18 May 2021 11:23:04 -0700 Message-ID: Subject: Re: [PATCH v2 1/1] cgroup: make per-cgroup pressure stall tracking configurable To: Shakeel Butt Cc: Tejun Heo , Johannes Weiner , Zefan Li , Ingo Molnar , "Peter Zijlstra (Intel)" , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Benjamin Segall , Mel Gorman , Minchan Kim , Jonathan Corbet , Daniel Bristot de Oliveira , "Paul E . McKenney" , Randy Dunlap , Andrew Morton , Thomas Gleixner , macro@orcam.me.uk, Viresh Kumar , Mike Kravetz , linux-doc@vger.kernel.org, LKML , Cgroups , kernel-team Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 18, 2021 at 11:08 AM Shakeel Butt wrote: > > On Mon, May 17, 2021 at 7:02 PM Suren Baghdasaryan wrote: > > > > PSI accounts stalls for each cgroup separately and aggregates it at each > > level of the hierarchy. This causes additional overhead with psi_avgs_work > > being called for each cgroup in the hierarchy. psi_avgs_work has been > > highly optimized, however on systems with large number of cgroups the > > overhead becomes noticeable. > > Systems which use PSI only at the system level could avoid this overhead > > if PSI can be configured to skip per-cgroup stall accounting. > > Add "cgroup_disable=pressure" kernel command-line option to allow > > requesting system-wide only pressure stall accounting. When set, it > > keeps system-wide accounting under /proc/pressure/ but skips accounting > > for individual cgroups and does not expose PSI nodes in cgroup hierarchy. > > > > Signed-off-by: Suren Baghdasaryan > > I am assuming that this is for Android and at the moment Android is > only interested in system level pressure. I am wondering if there is > any plan for Android to have cgroup hierarchies with explicit limits > in future? Correct and yes, we would like to use memcgs to limit memory in the future, however we do not plan on using per-cgroup psi so far. > > If yes, then I think we should follow up (this patch is fine > independently) with making this feature more general by explicitly > enabling psi for each cgroup level similar to how we enable > controllers through cgroup.subtree_control. > > Something like: > > $ echo "+psi" > cgroup.subtree_control > > This definitely would be helpful for server use cases where jobs do > sub-containers but might not be interested in psi but the admin is > interested in the top level job's psi. Haven't thought about it before but that makes sense to me.