Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3709795pxj; Mon, 24 May 2021 13:00:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwC86L2ssYJckX/gs0sMAj6if2ygJPZc20U4W9t5CMBm0Y+As8DWdKiTfioCZHnFRCZlkxS X-Received: by 2002:a17:906:f283:: with SMTP id gu3mr24800953ejb.91.1621886406713; Mon, 24 May 2021 13:00:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621886406; cv=none; d=google.com; s=arc-20160816; b=lXJ16NtEdccTwi86pdoNMyZfneROkKDGD1S+rqe51esO1tVvy70l1AzQX/B27HBabZ pzcsHsO2I7BSpDfuAv/YCTRQ0DXpqhwIpC1JhT8BsLT2RI3D39OgeIZ8zKMp+2Tk7HfR y1QlhcjCVJBtdC1d2lFWUt/EfS7/Bc8vfpOh5vFGABhceaWqPgo2QK17MfOoWjzKWpto s4PxQ6ccKRRz2QBEfYqNOwhGgvdUXAaIbrZ95ykCG1RZGF4i+b7V/cxi5KTh2HFc8Cgh 39EQWEJnH9td199IPcSNoG7+7DzrpJ2aQxgm+0UsmDKTBzB0/VbtD4+Bqjud+sTbJbCe c2QQ== 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=WJ6tyfSEArP9hZm90tcyE3NQZnpl/6fI+B8ESdNfuho=; b=Ow5HHjEysWhxY3EkJrO4OJWEhFduo2LH7HTMS+Rd/6T3Pib6rbLoDwHHR1zFyRLIEE xSksxRI9Dmmx7oUXHUccKwJE3idTg+HVxDowLLCMrlWkDSXeusJE2JQD4ksMC2Jcg7EU Xu+OEIYTgkYOkFrjBONbXIRjH8kA7xscO4o0fXqNdRzDZxMOrvC+6QBarvMPCrUEzGyD sF/wy5kY5CUMcrMnaYsd6E0Ud71uM5jCKJtCsFujIgUY56h7sqohr0xDclYSDkhkTCgz keL9gC60TX1U5Qr3fJWdgsidTcuYAntJAOH/AwlGZpI/s9V5ZjyR1jDK4A5mNVyuEFVJ 865Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=DGiMbn2o; 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 c14si13207436eds.262.2021.05.24.12.59.42; Mon, 24 May 2021 13:00:06 -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=DGiMbn2o; 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 S232829AbhEXUAE (ORCPT + 99 others); Mon, 24 May 2021 16:00:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232516AbhEXUAE (ORCPT ); Mon, 24 May 2021 16:00:04 -0400 Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FCBAC061574 for ; Mon, 24 May 2021 12:58:34 -0700 (PDT) Received: by mail-yb1-xb2e.google.com with SMTP id w206so8031661ybg.7 for ; Mon, 24 May 2021 12:58:34 -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=WJ6tyfSEArP9hZm90tcyE3NQZnpl/6fI+B8ESdNfuho=; b=DGiMbn2oWBHJGlquzFbClTelbBRbm6EbopgxGjWgk/Utr3/zBOwHFEGbLBpdvji4Td r2re7GIDGTlYE2Y58CiJKz08whvTgviabFbWPfBc9xp4lN6YLJ1UYj5cwUfJhzM0P6qY tsSHIphGc1Dc8Yx6HNyLBr/xRllCLcwUeOOujJ+rsLiY1Tubi8Z9ijH9QbBmpwqKlTsA scYxl7X9h9gYP+m9+78Q5lmPxLW9w6o9v944+eZEoK/nzc/RCEFJL3DW6o7IzcoxAQKf TD9AAK4a603BtCQe8P9zDowyC7j7iCO7pCYuwFFyTKe94LeiRYNmbC7RxBwVLpn3QUMl QJxA== 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=WJ6tyfSEArP9hZm90tcyE3NQZnpl/6fI+B8ESdNfuho=; b=rcXbNCSQGU26ixzCM79WCLgnClJelbknC5xFn76K3BF0dZjzPFKFNjbw7xlv4AUvlL nyxhCSSn3WGkLG4Bt6VJhR5XzZJmRIHnGtjUjvJolvGJ56gMcG+I1WF9UC2Xpdid7IHH vaZobOvyHvxhn9DKfSWFbKzIvt45iGbtmLd2A/V+QDbudq9TTHIFsN7/MogDFMFmpnT+ rJ6LBEGOmUSo2iIDyz9mluL/aFG5z0/PMyJ+ZTDMvBt3q85YZ1Xr12ZP6U8LcScX9swC Wdc7DjSY2ZRVc5LKCYEzTrd8ifJkZHQat9feQyezq7yBT1CKsj88KJrEkKHHF74yeXAs RR8w== X-Gm-Message-State: AOAM530G5UvfS6uyimVsgSodCPP/5wH6pGCNNZOoPOMs+TVCiQmY5HzQ 9auRh+UtcQ/XUZ2LV9D0fQSN713sJoDQIK0Fyt56Ww== X-Received: by 2002:a25:7ec4:: with SMTP id z187mr35848883ybc.136.1621886313594; Mon, 24 May 2021 12:58:33 -0700 (PDT) MIME-Version: 1.0 References: <20210518020200.1790058-1-surenb@google.com> <20210518185251.GI5618@worktop.programming.kicks-ass.net> In-Reply-To: From: Suren Baghdasaryan Date: Mon, 24 May 2021 12:58:22 -0700 Message-ID: Subject: Re: [PATCH v2 1/1] cgroup: make per-cgroup pressure stall tracking configurable To: Peter Zijlstra Cc: Tejun Heo , Johannes Weiner , Zefan Li , Ingo Molnar , 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 mailinglist , 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:55 AM Suren Baghdasaryan wrote: > > On Tue, May 18, 2021 at 11:52 AM Peter Zijlstra wrote: > > > > On Mon, May 17, 2021 at 07:02:00PM -0700, Suren Baghdasaryan wrote: > > > > > diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c > > > index cc25a3cff41f..4b8e72640ac9 100644 > > > --- a/kernel/sched/psi.c > > > +++ b/kernel/sched/psi.c > > > @@ -148,6 +148,7 @@ > > > static int psi_bug __read_mostly; > > > > > > DEFINE_STATIC_KEY_FALSE(psi_disabled); > > > +DEFINE_STATIC_KEY_FALSE(psi_cgroups_disabled); > > > > I'm thinking the whole thing will be easier/clearer when you make this: > > > > DEFINE_STATIC_KEY_TRUE(psi_cgroups_enabled); > > > > Sounds good. Will respin another version. Thanks for reviewing! v3 is posted at https://lore.kernel.org/patchwork/patch/1435705 > > > > > > > > #ifdef CONFIG_PSI_DEFAULT_DISABLED > > > static bool psi_enable; > > > @@ -211,6 +212,9 @@ void __init psi_init(void) > > > return; > > > } > > > > > > + if (!cgroup_psi_enabled()) > > > + static_branch_enable(&psi_cgroups_disabled); > > > > if (!cgroup_psi_enabled()) > > static_branch_disable(&psi_cgroups_enabled); > > > > > + > > > psi_period = jiffies_to_nsecs(PSI_FREQ); > > > group_init(&psi_system); > > > } > > > @@ -744,23 +748,23 @@ static void psi_group_change(struct psi_group *group, int cpu, > > > > > > static struct psi_group *iterate_groups(struct task_struct *task, void **iter) > > > { > > > + if (*iter == &psi_system) > > > + return NULL; > > > + > > > #ifdef CONFIG_CGROUPS > > > + if (!static_branch_likely(&psi_cgroups_disabled)) { > > > > if (static_branch_likely(&psi_cgroups_enabled)) { > > > > > + struct cgroup *cgroup = NULL; > > > > > > + if (!*iter) > > > + cgroup = task->cgroups->dfl_cgrp; > > > + else > > > + cgroup = cgroup_parent(*iter); > > > > > > + if (cgroup && cgroup_parent(cgroup)) { > > > + *iter = cgroup; > > > + return cgroup_psi(cgroup); > > > + } > > > } > > > #endif > > > *iter = &psi_system; > > > return &psi_system; > > > > But yes, very nice. > > > > -- > > To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com. > >