Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp691655pxj; Fri, 14 May 2021 13:15:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqu6KzTLrER9GSyyXAH4JWP7wE9fkGhvoP7QI+YTrUkGDB0eOv4A3JiJ6ea4alfJQKd/Y9 X-Received: by 2002:a17:906:9892:: with SMTP id zc18mr15419067ejb.354.1621023309458; Fri, 14 May 2021 13:15:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621023309; cv=none; d=google.com; s=arc-20160816; b=PnRmno+xsdZW3DndksqfQ1hUNgCjqVV2ocRxwsmUFHLhKP7Efd+0EbZKXl+h9Loxbm 8UNCzuAWx9YB4oOxBmsnNSpNsdLjxQRZvDmtsXJBuvI8ksqeho7tLay88C2qAWORyt2b Q55j04HIf8A+/gbgfxhLAHYnevPbyOYu0Ih485IDhlnmlcOmVBqG1BPRlGcyFTlXKbiF FY0O+bPlAlFTCf2h26ihP/YidllTdc9EH5bDdCHqxOONIPs3lcHlmLidDZ1XM4UYVCDy qAnBsjsNg5qK+iQrknsyBKw0TMMdfAtOK7K7iGc0t1lBXw3doS+GDe6igLzcZIpMscNO 5o+w== 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=rdMfTFq+p2AV3NKNFb0bpljlABY/TwfShHFjcvSUVzg=; b=CIqUuF827mwZfTRfVmnsM0CX3n0v8j2CkusI+W9kPDkrakFUGcc5PRbg3zTCuOZe8v UUCplclFGT6F4+PWdPLX567bGGINNAbvn6n+/QhAXCqI2meJCm9dA2InqFjhJwSl21cT oHGw/2arN5nyWQSioWHkMJKGrelh///OXAkuexa4GA5NX5zbivsTTsOo7WWXWW8ismEM /su0ZmcCLaoXlFKBfOsgAInLLRqsG+4wD8dG2PxcWMDuNuxPuG2n7OJ7cy4OQlZdjxTM fzS1HzzqxNiwJXUAxXCAm1hxD/Qs9RUYfqO3z+bAyGQ5kAjwBA/G6s7hICB/zLN1YvW8 dlXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=dHn86QCP; 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 l12si6905163ejr.61.2021.05.14.13.14.46; Fri, 14 May 2021 13:15:09 -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=dHn86QCP; 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 S233214AbhENSVm (ORCPT + 99 others); Fri, 14 May 2021 14:21:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233202AbhENSVk (ORCPT ); Fri, 14 May 2021 14:21:40 -0400 Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com [IPv6:2607:f8b0:4864:20::b32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C291C06174A for ; Fri, 14 May 2021 11:20:22 -0700 (PDT) Received: by mail-yb1-xb32.google.com with SMTP id h202so174115ybg.11 for ; Fri, 14 May 2021 11:20:22 -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=rdMfTFq+p2AV3NKNFb0bpljlABY/TwfShHFjcvSUVzg=; b=dHn86QCPxrUvY85Zj+PW33DwYOe9blB+d2udQfcFv8w9pPd+Hzej+ND5IUhQwtZuqg cMOrKJNDRwpk99Y+8FeEjjSMSL/EhHGLx/MWDfeZaAujF6T5zDYK30+l5dYWMx0LMUeW VekZb/Uvk1L03y3M3UqYt8gQvm9EAPPTROEYYdTJUhI2xu/nIGNoIXVWLZoVDalfo6Lw FA0Qy3IDOHz26sNAAybAR+8mS+Vy410ooDwBfwA3oMLWOecQON4aLYvVnbL0TtnKVFJG A+KKNTFk/y+ajft7d7pt8Vs2Qu067QdkpiGBZJPFwdGgEkwqxLigeiGvNX928QxdR489 1+LQ== 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=rdMfTFq+p2AV3NKNFb0bpljlABY/TwfShHFjcvSUVzg=; b=nDpN4hlEPmXsaZQAMPKZWBW+EWi3uqVViYEP3yjFhK5AHxwahnK9EZUmtvFmM8TODz SSYVgSv0qNIns64L0zIsGByecP04BfidD5MSbRHq7hCLN3OQhiIp+lIlxKkCy+W4mwtX JWkUb2mpIB45ubsleQTq8NEjp3bbi5bPtu3JcQwh9cgpYSySopZjadi6Az3Gc9/lcSUZ z2vhij25jJogQWIYdoylnPN0Qd8tZ7RRmguYMrQGAZApwiR18/G1eXph3saqBAZ0U1v/ dL//ql08W1qPrWok3XoSU9UFR1DESe5gVGS7xsKbczDl3GSXn67RD8MMaOxWWlp1eU5S 2M6Q== X-Gm-Message-State: AOAM532+njOJRaOnEO2pdD5ndarLUKQ+auHACw9cDhRxzHc1tADbYzNI ny+4NlT0eOfkTroAyzrVFiB3VbRcs79Hn2Fo2APg5A== X-Received: by 2002:a5b:7c5:: with SMTP id t5mr63587418ybq.190.1621016421569; Fri, 14 May 2021 11:20:21 -0700 (PDT) MIME-Version: 1.0 References: <20210513175349.959661-1-surenb@google.com> In-Reply-To: From: Suren Baghdasaryan Date: Fri, 14 May 2021 11:20:10 -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 10:52 AM Peter Zijlstra wrote: > > On Fri, May 14, 2021 at 08:54:47AM -0700, Suren Baghdasaryan wrote: > > > 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? > > Does this make sense? > > --- a/kernel/sched/psi.c > +++ b/kernel/sched/psi.c > @@ -744,24 +744,26 @@ static void psi_group_change(struct psi_ > > static struct psi_group *iterate_groups(struct task_struct *task, void **iter) > { > + if (cgroup_psi_enabled()) { > #ifdef CONFIG_CGROUPS > - struct cgroup *cgroup = NULL; > + struct cgroup *cgroup = NULL; > > - if (!*iter) > - cgroup = task->cgroups->dfl_cgrp; > - else if (*iter == &psi_system) > - return NULL; > - else > - cgroup = cgroup_parent(*iter); > + if (!*iter) > + cgroup = task->cgroups->dfl_cgrp; > + else if (*iter == &psi_system) > + return NULL; > + else > + cgroup = cgroup_parent(*iter); > > - if (cgroup && cgroup_parent(cgroup)) { > - *iter = cgroup; > - return cgroup_psi(cgroup); > - } > -#else > - if (*iter) > - return NULL; > + if (cgroup && cgroup_parent(cgroup)) { > + *iter = cgroup; > + return cgroup_psi(cgroup); > + } > #endif > + } else { > + if (*iter) > + return NULL; > + } > *iter = &psi_system; > return &psi_system; > } Hmm. Looks like the case when cgroup_psi_enabled()==true and CONFIG_CGROUPS=n would miss the "if (*iter) return NULL;" condition. Effectively with CONFIG_CGROUPS=n this becomes: if (cgroup_psi_enabled()) { <== assume this is true #ifdef CONFIG_CGROUPS <== compiled out #endif } else { if (*iter) <== this statement will never execute return NULL; } *iter = &psi_system; return &psi_system; > > -- > To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com. >