Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp207543imi; Wed, 20 Jul 2022 21:37:43 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vKS9ZFtf05rgVI5f4bXXaJ6WcRo1MiOxYyA8Pv0JAdxHZbNYMn8HMZAngEyQDqYPt7DgZB X-Received: by 2002:a05:6402:25c6:b0:43b:7797:d953 with SMTP id x6-20020a05640225c600b0043b7797d953mr14914599edb.254.1658378263204; Wed, 20 Jul 2022 21:37:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658378263; cv=none; d=google.com; s=arc-20160816; b=He8EKYuJbg30oXpSuyOFs8HQqPmDsQOlBZ8N+SXHvRb0CCNmov08xIb+02aus30Muj Rye4clnxBcSuwj4Cc4X9s8g02zd9BYCUAqiQyu44vVB7olSQNH81Tv8zCbBuV2bOvf7l S+mScQVUngqMuMkkM1AiSt+XAiXOLBlUu/v5l32aVuFZRse6JpD+G7kWIHnxyw1qxd2o 6dcaDMKFpeJc888xe6I2dv/y35mvjUmoLUVzdt/NtXASeERMaPOvKyKHFrai8CjRjn9e M51wONwVzA1XfoBvRSUaBvSHWaOFgrWJTMGbjbHkvcfDTEN8UUKKlIA7ZNH+wZgtW2+O A9QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iTBK+C00vRPG4JDueYyv7EqFsWvxIqsN3waJE+O/isA=; b=HuPNSEUjsW2EaAEw/RK/aCOgrVxK0L5s7cmxeHmhAniBuE+LmOJfeV6caaTDX4LQGL wh1dWqrXTDkEfd7pd9nfBYnX5QAVzq/DoufHk8ymSUKj56NqkXUJi5MkETdiZ3qNkSfW 9mZ4LG8MyP1co+HZ/1c+lLVAsQQayQFKJV5l+/eZIG3tBoEjzZcV1vA7MZYlhLforgLO PTtynBbMH8p6d8VC6XEB/Z90H7e8Zqrk86WdBf0TH9Yu2Ve/i8Up7GkMzLglw2M/PWxm BELaq0d4xVSJEvAahvYIv4XDSEa6ftnljr9ngTA4Xy/k6KpdZ6pme++SBdE2U8LE/W6n 9gHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b="QHIvOf/v"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n13-20020a05640205cd00b0043bc44828ebsi1054821edx.630.2022.07.20.21.37.17; Wed, 20 Jul 2022 21:37:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b="QHIvOf/v"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231917AbiGUEFs (ORCPT + 99 others); Thu, 21 Jul 2022 00:05:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231745AbiGUEFX (ORCPT ); Thu, 21 Jul 2022 00:05:23 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E7D013DC1 for ; Wed, 20 Jul 2022 21:05:20 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id f3-20020a17090ac28300b001f22d62bfbcso642495pjt.0 for ; Wed, 20 Jul 2022 21:05:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iTBK+C00vRPG4JDueYyv7EqFsWvxIqsN3waJE+O/isA=; b=QHIvOf/vF7cxWQOSppu23p6vElDHp0+ZqYuQj3IE6sYMS6UGWgb8VpdRJEDv/3fmgK EBsyNAQs2eSnCL8T+CYX5Ge6nLSOCZhoT7717mCb3PYoGzDPZvxo0RttCkMybvV+RiqR 7lSJrgu7/rcXtElobuMaOqMSQk4MZHbvh0tkYM8/N8UBVTGiNPK+sk0l0Q1No0nSuCne +ICLWxXj78VcKThofLCbfIwAuz7LBngg0/wfa0zSvrleB7AUxs7BkQP92oCOqUvaFR9q 96tnMKzLbOOur2qTlrlpvcq9bAVMyNMH61VFRD89X5LBADuZX1NXdhUgyrLX/EYl/Du0 N72g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iTBK+C00vRPG4JDueYyv7EqFsWvxIqsN3waJE+O/isA=; b=624aFB/dSjbcIaEmJ8h8dqpr7EIZTEkmeMLT4N0PutDLNFzBJnyg6Dy5Pj1q+1Wg3F Tq+Vp0oyYuomMlxcG+LGs+0hIEa9rHGrHhqds0+Q8D1Gux5HHtb0YOGDbtq7jtynJ0EK i+KT/kxCR+GGsnnzvinvXBNww4P1idjVeky5StGUqv6aYF3RuiQihI9MszvKgTt6TU25 uRg954fFf+8oqeo3MFr2VBsEXDSrkmyp2IegSP2W/O8jkqlTqUQ4DIp3ZCTuPcLpb3mi E2reNWXwuSibWJbxQYqZFj53x2edb4bCaVIFDcL+gi0rYlHdZFADeTmMOv98SzKNoGZF WNhA== X-Gm-Message-State: AJIora9vm91d6xFDRuAuF2vMfsU5YhWCz46C/mN6HMP0jpW27zi8JstZ PEbxFoi7s3fcnsd9hjsorLZBYw== X-Received: by 2002:a17:903:44b:b0:16c:b112:7f74 with SMTP id iw11-20020a170903044b00b0016cb1127f74mr35436361plb.149.1658376319603; Wed, 20 Jul 2022 21:05:19 -0700 (PDT) Received: from C02CV1DAMD6P.bytedance.net ([139.177.225.228]) by smtp.gmail.com with ESMTPSA id f4-20020a170902684400b0016bdf0032b9sm384368pln.110.2022.07.20.21.05.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 21:05:19 -0700 (PDT) From: Chengming Zhou To: hannes@cmpxchg.org, surenb@google.com, mingo@redhat.com, peterz@infradead.org, tj@kernel.org, corbet@lwn.net, akpm@linux-foundation.org, rdunlap@infradead.org Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, songmuchun@bytedance.com, cgroups@vger.kernel.org, Chengming Zhou Subject: [PATCH 5/9] sched/psi: don't create cgroup PSI files when psi_disabled Date: Thu, 21 Jul 2022 12:04:35 +0800 Message-Id: <20220721040439.2651-6-zhouchengming@bytedance.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220721040439.2651-1-zhouchengming@bytedance.com> References: <20220721040439.2651-1-zhouchengming@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org commit 3958e2d0c34e ("cgroup: make per-cgroup pressure stall tracking configurable") make PSI can be configured to skip per-cgroup stall accounting. And doesn't expose PSI files in cgroup hierarchy. This patch do the same thing when psi_disabled. Signed-off-by: Chengming Zhou --- kernel/cgroup/cgroup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index 1779ccddb734..1424da7ed2c4 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -3700,6 +3700,9 @@ static void cgroup_pressure_release(struct kernfs_open_file *of) bool cgroup_psi_enabled(void) { + if (static_branch_likely(&psi_disabled)) + return false; + return (cgroup_feature_disable_mask & (1 << OPT_FEATURE_PRESSURE)) == 0; } -- 2.36.1