Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5424030ybv; Tue, 11 Feb 2020 15:39:45 -0800 (PST) X-Google-Smtp-Source: APXvYqyr8uHZwyfbySv4ecZWZNxCAutnAhx9zKj8el1vacDYSoKp1PSGGugBb2xO9ttJVsGI6doD X-Received: by 2002:a54:4003:: with SMTP id x3mr4291243oie.0.1581464385750; Tue, 11 Feb 2020 15:39:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581464385; cv=none; d=google.com; s=arc-20160816; b=Ul068V7u32gg04WjoaxF5YOPbrICxTAK1Utybii3wDACzIUogV/6a76OZLSw6FYxeR fDsaqpoHlgHDb62YKU18oGc5O2q7YFIUniQuD0ZM4QNlJeYWYxCwJlOtGELlM2i+Mf6r 4VIm2dVaoG2P5zi8lQyU1ERp6rRE2M64Vy/uSiMOIy0Hvsn4C11VqksbDikt+3Y/A/Kj 5+2kCFXnPp8QafSWy5oWhu3YjPRNvFDr3soqUQ9VjaO/w08NydOtSHkwJ04tLXPWtlgC JQtfkTe+O3hv74tgmjHpqZiEXnztgyuxeyLChAul+vbqn5RbVdJzs6bBdUSmMLjkN+ck fWrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=qdD3hRM2SNfQB2qjEKYGA6f+zRFsW77tWeA6ZAC05dQ=; b=0Pnhjp1AXtJczhrZQHLUl+TE2pLstU9z5ubdJZfkTe+/felzfMj+CCb5TFf/IUlUht Ulv8bN6IhJbyqWMjo99RX2ZIFKYxZtOLKE0K28aDYC8PW3dJuXcuWf1TRt5ECYAMOByH TyZ6rJUB320BTqCNEW9rgW6E7uPWXKpSiELI5OXTqBgEJqvVbwf0Jph0dnq8OdNvmUv4 4OVmkLVnSykHBkYtgExa55pW2wyNAhMEiVqXJWuYm1Zu7KO4rWMTrNlhNLINSgvRczA4 ck6Umrt2a/gWsm7vm5uv6ap9fhPBx5Cl22CPuKkVDz9veh2+7FO3Kb4jBAo8TeD+XleY nXlg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x12si2589238oto.194.2020.02.11.15.39.33; Tue, 11 Feb 2020 15:39:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728290AbgBKXjJ (ORCPT + 99 others); Tue, 11 Feb 2020 18:39:09 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:46664 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728240AbgBKXjF (ORCPT ); Tue, 11 Feb 2020 18:39:05 -0500 Received: from 79.184.254.199.ipv4.supernova.orange.pl (79.184.254.199) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.341) id c814c39a8c8d77ab; Wed, 12 Feb 2020 00:39:02 +0100 From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Amit Kucheria Subject: [PATCH 01/28] PM: QoS: Drop debugfs interface Date: Tue, 11 Feb 2020 23:52:35 +0100 Message-ID: <2121727.25eEc26k0f@kreacher> In-Reply-To: <1654227.8mz0SueHsU@kreacher> References: <1654227.8mz0SueHsU@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Rafael J. Wysocki" After commit c3082a674f46 ("PM: QoS: Get rid of unused flags") the only global PM QoS class in use is PM_QOS_CPU_DMA_LATENCY and the existing PM QoS debugfs interface has become overly complicated (as it takes other potentially possible PM QoS classes that are not there any more into account). It is also not particularly useful (the "type" of the PM_QOS_CPU_DMA_LATENCY is known, its aggregate value can be read from /dev/cpu_dma_latency and the number of requests in the queue does not really matter) and there are no known users depending on it. Moreover, there are dedicated trace events that can be used for tracking PM QoS usage with much higher precision. For these reasons, drop the PM QoS debugfs interface altogether. Signed-off-by: Rafael J. Wysocki --- kernel/power/qos.c | 73 ++---------------------------------------------------- 1 file changed, 2 insertions(+), 71 deletions(-) diff --git a/kernel/power/qos.c b/kernel/power/qos.c index 83edf8698118..d932fa42e8e4 100644 --- a/kernel/power/qos.c +++ b/kernel/power/qos.c @@ -137,69 +137,6 @@ static inline void pm_qos_set_value(struct pm_qos_constraints *c, s32 value) c->target_value = value; } -static int pm_qos_debug_show(struct seq_file *s, void *unused) -{ - struct pm_qos_object *qos = (struct pm_qos_object *)s->private; - struct pm_qos_constraints *c; - struct pm_qos_request *req; - char *type; - unsigned long flags; - int tot_reqs = 0; - int active_reqs = 0; - - if (IS_ERR_OR_NULL(qos)) { - pr_err("%s: bad qos param!\n", __func__); - return -EINVAL; - } - c = qos->constraints; - if (IS_ERR_OR_NULL(c)) { - pr_err("%s: Bad constraints on qos?\n", __func__); - return -EINVAL; - } - - /* Lock to ensure we have a snapshot */ - spin_lock_irqsave(&pm_qos_lock, flags); - if (plist_head_empty(&c->list)) { - seq_puts(s, "Empty!\n"); - goto out; - } - - switch (c->type) { - case PM_QOS_MIN: - type = "Minimum"; - break; - case PM_QOS_MAX: - type = "Maximum"; - break; - case PM_QOS_SUM: - type = "Sum"; - break; - default: - type = "Unknown"; - } - - plist_for_each_entry(req, &c->list, node) { - char *state = "Default"; - - if ((req->node).prio != c->default_value) { - active_reqs++; - state = "Active"; - } - tot_reqs++; - seq_printf(s, "%d: %d: %s\n", tot_reqs, - (req->node).prio, state); - } - - seq_printf(s, "Type=%s, Value=%d, Requests: active=%d / total=%d\n", - type, pm_qos_get_value(c), active_reqs, tot_reqs); - -out: - spin_unlock_irqrestore(&pm_qos_lock, flags); - return 0; -} - -DEFINE_SHOW_ATTRIBUTE(pm_qos_debug); - /** * pm_qos_update_target - manages the constraints list and calls the notifiers * if needed @@ -529,15 +466,12 @@ int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier) EXPORT_SYMBOL_GPL(pm_qos_remove_notifier); /* User space interface to PM QoS classes via misc devices */ -static int register_pm_qos_misc(struct pm_qos_object *qos, struct dentry *d) +static int register_pm_qos_misc(struct pm_qos_object *qos) { qos->pm_qos_power_miscdev.minor = MISC_DYNAMIC_MINOR; qos->pm_qos_power_miscdev.name = qos->name; qos->pm_qos_power_miscdev.fops = &pm_qos_power_fops; - debugfs_create_file(qos->name, S_IRUGO, d, (void *)qos, - &pm_qos_debug_fops); - return misc_register(&qos->pm_qos_power_miscdev); } @@ -631,14 +565,11 @@ static int __init pm_qos_power_init(void) { int ret = 0; int i; - struct dentry *d; BUILD_BUG_ON(ARRAY_SIZE(pm_qos_array) != PM_QOS_NUM_CLASSES); - d = debugfs_create_dir("pm_qos", NULL); - for (i = PM_QOS_CPU_DMA_LATENCY; i < PM_QOS_NUM_CLASSES; i++) { - ret = register_pm_qos_misc(pm_qos_array[i], d); + ret = register_pm_qos_misc(pm_qos_array[i]); if (ret < 0) { pr_err("%s: %s setup failed\n", __func__, pm_qos_array[i]->name); -- 2.16.4