Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp835509pxj; Fri, 14 May 2021 18:00:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOmWeQ6j+BRKSK2RigeWZhycmPfrSDNdTWj37a+v8A/OT30/b4ndA2zdwX26wUyUviozMC X-Received: by 2002:a5d:8c82:: with SMTP id g2mr36323263ion.34.1621040437915; Fri, 14 May 2021 18:00:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621040437; cv=none; d=google.com; s=arc-20160816; b=o4/kE0kDYRWqqLfv1FrdXJWaDgImE920PpAe3tM/QPzqgo3b71/i+H/wk1whDYLG2+ 6eG9O/BBoAaFrLYEcTnLgdel4+OQPXg+h/L/EJWrH0QjJkNMSm9WQ1AptdtxBJGu6lMr Mjm05io6I8WUe6eF6MJa5sF5D4SWw3lOQVNmacgs6tVDlHeg1lhGjgJhBNJCX67EPQal mUUvguzZ3OgsnqWiu7YgcIWVL3yl4GKV1b8Cb/4/8dcIwOX1o4e6cmQZ1gGb0KP9YY1E mesJac9aUvPDj1y+APWaIj/SD0Xj6i8/pSRAyEuQfouM3U4zPmZcL9uE+MW8yCrL2hJ9 EQ6g== 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=y052LogTUvmTYDDB+WfKoZ5F+9wGSH/Xp6XYfMNjiT0=; b=KoaqIuO+qTj8g8zsCAg2fa1ufRGZBph+MGE6WwIPw8Jhh8Oa2oAve6+EJiHxEG1IBI ZQAm6/HjxbZ+a9WRRHrQaM3T4h4RIBYCmVONlSu5U7JpTAyN81AE+GMCLkLVkkB0/7JH hWHl0jJtgHaLcXb3tbNHTGvRr8IZFLMlUkM9WAiGsO/kqajYmFqqvmiuGCRjf4xfI55R tZdUy/ONvlyxnz8NodChVCfBIHxXT/louV0vmhnD0upX9S/ddvEFO61A9PziayOnjbA9 bwco1a9yNejtnVm6vRpEq7ofXyV1fiF3KKmYL0flbbDtOiMkWbSFbww3YDxZRJJQP0I3 Kn/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=rmOj1JlG; 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 f12si9560894jas.117.2021.05.14.18.00.25; Fri, 14 May 2021 18:00:37 -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=rmOj1JlG; 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 S234869AbhENP4M (ORCPT + 99 others); Fri, 14 May 2021 11:56:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233914AbhENP4L (ORCPT ); Fri, 14 May 2021 11:56:11 -0400 Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF764C06174A for ; Fri, 14 May 2021 08:54:58 -0700 (PDT) Received: by mail-yb1-xb30.google.com with SMTP id r8so39424550ybb.9 for ; Fri, 14 May 2021 08:54:58 -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=y052LogTUvmTYDDB+WfKoZ5F+9wGSH/Xp6XYfMNjiT0=; b=rmOj1JlGNHpx+uPiVKXp2GXMWFkLj/A2WtlyaZyD5pZFxwhlsqd9zu0CmNdx2nQKz3 hyKBSMJEwq4rkRa1IKAxZNhcGDAR+T6fks73i5T1b7VEfpOp/gDb2G/+5nFgGIONK+KE 5WTx5ufZ/30+cWeOlNLTJcwxWCkVh7nMAyWjrV77SCuEV9Vv+/qhYpaSzCD2TSPjXpbE pthBuekUFWiKhmAdMmrAYeNIhk//NcnHznalrkjl4A1UoLj5Q/zs2/74f2tVtHRtlnn6 LkS6QSRN4TUGoxGxletRTqpWwfMbv6aWju2Cxk02zuImCHGjcle6K1d3PDeirZ5+JyYO DsaA== 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=y052LogTUvmTYDDB+WfKoZ5F+9wGSH/Xp6XYfMNjiT0=; b=ehTWels+5fa+RziFPhxPhKaTuGrWFg0BTHF5Ev4A9usK3PHSyaY5eWmkInxhLWuTXi ujr+HFeKqtMdN/Q0faZDLb1cb8qmiTvS3AAv8SK4Xn8jA6gR4HXY/k9DiofwQQ0Csmcp +MAiqjivA40ZUI6U4AdR8e6iOkThlzdmt0Z38bRVmw4M/beMDblpEbD+McdrTsZExpCE lthPSl0NE2XOpIjNgyrf/RNlqLhpzLyKdDa2o6G07Ff7SVEOK9yUSQrXRcuEV9Ra2394 4LVbL/syuY8uHvRZGg5heLiwqb5EP0tF9lK1ijtEDC62u9tk7fcw1HspJlGfP/aNWrtl u9kg== X-Gm-Message-State: AOAM5303oleIkMoYqrblFOr4uLCw7WkodVUsgVUsSFE72k+dATsLmij8 qBXADXWlYPg3YDk6rh8DspfVyIG75TelGYGEY4Dl1g== X-Received: by 2002:a5b:7c5:: with SMTP id t5mr62727703ybq.190.1621007697955; Fri, 14 May 2021 08:54:57 -0700 (PDT) MIME-Version: 1.0 References: <20210513175349.959661-1-surenb@google.com> In-Reply-To: From: Suren Baghdasaryan Date: Fri, 14 May 2021 08:54:47 -0700 Message-ID: Subject: Re: [PATCH 1/1] cgroup: make per-cgroup pressure stall tracking configurable To: Peter Zijlstra Cc: Tejun Heo , Johannes Weiner , lizefan.x@bytedance.com, Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Benjamin Segall , mgorman@suse.de, Minchan Kim , Jonathan Corbet , bristot@redhat.com, "Paul E . McKenney" , rdunlap@infradead.org, Andrew Morton , Thomas Gleixner , macro@orcam.me.uk, Viresh Kumar , mike.kravetz@oracle.com, linux-doc@vger.kernel.org, LKML , cgroups mailinglist , kernel-team Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 14, 2021 at 4:42 AM Peter Zijlstra wrote: > > On Thu, May 13, 2021 at 10:53:49AM -0700, Suren Baghdasaryan wrote: > > > +bool cgroup_psi_enabled(void) > > +{ > > + return (cgroup_feature_disable_mask & (1 << OPT_FEATURE_PRESSURE)) == 0; > > +} > > > diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c > > index cc25a3cff41f..c73efd7d4fba 100644 > > --- a/kernel/sched/psi.c > > +++ b/kernel/sched/psi.c > > @@ -747,9 +747,12 @@ static struct psi_group *iterate_groups(struct task_struct *task, void **iter) > > #ifdef CONFIG_CGROUPS > > struct cgroup *cgroup = NULL; > > > > - if (!*iter) > > + if (!*iter) { > > + /* Skip to psi_system if per-cgroup accounting is disabled */ > > + if (!cgroup_psi_enabled()) > > + goto update_sys; > > cgroup = task->cgroups->dfl_cgrp; > > - else if (*iter == &psi_system) > > + } else if (*iter == &psi_system) > > return NULL; > > else > > cgroup = cgroup_parent(*iter); > > @@ -758,6 +761,7 @@ static struct psi_group *iterate_groups(struct task_struct *task, void **iter) > > *iter = cgroup; > > return cgroup_psi(cgroup); > > } > > +update_sys: > > #else > > if (*iter) > > return NULL; > > I'm confused; shouldn't that do the same as that #else branch? Correct, for this function CONFIG_CGROUPS=n and cgroup_disable=pressure are treated the same. True, from the code it's not very obvious. Do you have some refactoring in mind that would make it more explicit? >Also, can you pretty please make cgroup_psi_enabled() a static_key ? Certainly, will post an update on Monday. Thanks for the feedback, Peter! > > -- > To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com. >