Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1688024pxj; Wed, 19 May 2021 11:29:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNh1/XHCQSkal3S209CCd+8h/EwDKlezzT0bEEjQG6dYTbCkPre2wBOqskQ8p6Dj8s2S16 X-Received: by 2002:a17:906:2f91:: with SMTP id w17mr455336eji.443.1621448978025; Wed, 19 May 2021 11:29:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621448978; cv=none; d=google.com; s=arc-20160816; b=IqKnxOiGfZ/QDoFqU90ZCIDbq4BDfxyGhF/qC0/+oQuwJ6sAIo2xV0tsaY68+KsU8o yqCLEkut81LF4PfJZr4ouecBvMjPnBdw+j6vpp0sDCbssca+UhifSZZyhV93UxKf3KKX dzgBQpPlHlihfj19loubHH/tWndKyf+4m/bTBy3LlLcxNkyTo/++un/Df+o7kIsC1Rnz YzbTKpSlwJOqkCoZNvpeDqQ8poo15pOx84Zbz0ItdtvaPxuDiK9B+kMydKB/Y9QHrCuM NwlhlPC8+g+DsUDTK8y8hVTvPLzTtM4jbcPHTPimV8i8tUSC3RaWs8jzL2u7AQGp3sZH zHLw== 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=XVc3DguSfxxYVXN0x5EkHPuQLUSzK1Aah2uiT3qFU3o=; b=pK5yiuQrVYkWbDaow7IYZdgWQe+K/s8xZdt1LwdU8j5b4Ds2BQkS72YnOQozCyAXdR 6e5dWgN+3/HGqL4GHqcO4vI2SHgP9k84KhHOgScU5zqHhjKOeVHYjW3frpNc8C8mBZD/ 763Q/K3wWUAieMrVy5J6YJ8ImZX14ELIMjP6jYIKNlRIsrzqpxrM0BM/j7eik/h284km NP6hDNGxLrVDDvpofb7LBkks9WJEYdRyymQhNs3yVbVMMfv6TAx5YwZF+/3bWk5Cropy 2of3WgVYQHWiUCpibE4uCJfHyhOUc/ztcLa8FdKs3ouz2ERBbGAxkQFt/mz5vCpGBr3i RMfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="Eq/h3JfO"; 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 du20si484393ejc.634.2021.05.19.11.29.14; Wed, 19 May 2021 11:29:38 -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="Eq/h3JfO"; 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 S1351525AbhERSYg (ORCPT + 99 others); Tue, 18 May 2021 14:24:36 -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-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.