From patchwork Thu Jul 11 14:21:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 168842 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp11456124ilk; Thu, 11 Jul 2019 07:21:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwO8GkcAblsRqT1fX94SUF5cxjsFAgTyNOXJGPGonW2bI0arv1mBI7ap3+nq0t6tbiF3Bxo X-Received: by 2002:a17:90a:b903:: with SMTP id p3mr5088128pjr.79.1562854892836; Thu, 11 Jul 2019 07:21:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562854892; cv=none; d=google.com; s=arc-20160816; b=u4Opbl01G0UH2lJH+DANOgXDJzmKHY9vN110+DC3IFWGGdswP1EZmQDylhcqfNZRDD u6giY3CfsAdMlrXJ5um44XTTFTyZD8xSDmeuGOd4VFrc75hcXYCyzEuh04dJ+Y2l/PgW U12KCtyTx1DWz0LbPpzy65sWmVgH82OlCsQFVtURYvBOqqctcWgNwtJ5btexV7Uhz/AI dbo287DZLJ/v7esx9khPKsF2Z0/F0TWhHaZ65wo2HxtjrEmeajbwvgm1AO1W6F09/kPi SfKufpGhPJmtsqWkguwRSHhodco/L9BPeo7TA2kqPDTn6yLCD8wTJ5N+lkPjGWFhhxH5 13zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=Awpujz9r/neB3EOz35gTs3qfspG2l2LEyx+qOFwQWtc=; b=JrRbnUYU2EWzgwaazUJ9uA1EQVF8HkPBdpT/9S0xB5vSsb9ZeXhXHHK0v9lfzWc9vZ oHotL9UnSa4ijHYfTjFyhKXhGZVeWWsulgf7nCisNouBMfvpRDJIX6UstZ/SHWAIP06+ ilbbDjj4xwEE6/eZB1eBkzpEBlsDXb4t8bCEgcdCG1kZV7SB11oTlKGBR2znPcwGoA69 J2eKIMaG0HkyGauPBe1fnfJf83NUck+RYDLmPANnATmMWfs2TANLDn695BdLFYhGF6pH i3TQp5iH54xaqdSMTQOlKoJYAQ/1+ol3VlOK7FYCAJRC6+lvN6WDhwr3z1Ts3yyQFRyJ N05g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=itMw7Ebp; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u191si5352976pgd.281.2019.07.11.07.21.31; Thu, 11 Jul 2019 07:21:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=itMw7Ebp; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728506AbfGKOVb (ORCPT + 15 others); Thu, 11 Jul 2019 10:21:31 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:37539 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728484AbfGKOVb (ORCPT ); Thu, 11 Jul 2019 10:21:31 -0400 Received: by mail-pf1-f194.google.com with SMTP id 19so2841747pfa.4 for ; Thu, 11 Jul 2019 07:21:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Awpujz9r/neB3EOz35gTs3qfspG2l2LEyx+qOFwQWtc=; b=itMw7Ebpfg3uMHx+Cp6KsA/Jzruj3ROpTQpU9KFExu0AV2HoMbkQ4B5z08DRqTZ4LZ kd2MMKFWuwP4QkUSsyb7fRuNAYfFPwlgP9KidEUMzEO8/HNsW+pUHEiZnagno2r1/1uW Bjo8poHGBtyy3cYaA0ViTzf9RPiXyGmVyMOfuwdibIqkoHOjOdcL4c1LYOAKWFYuSXjH GdkkY22AYUXcV9hRqzXd4wVDoHHdaYxxndjmYX1x1OiSq+BN/rZYViGkXGyLq6XwRR4O HsgqkdvgeflDjPyOPM07rlJTP8EkWvCrhlJfx3i8B2kKgtrQK4muI0eWSOdKkCHnawZj a5Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Awpujz9r/neB3EOz35gTs3qfspG2l2LEyx+qOFwQWtc=; b=qedLvWfLn+NXL1x/b4mEnQZrmgvQ14GmfVMVbeJjDh/4F2QCLANWsEECAyyh32PQ/n bEwL1NJelk3BZPIZmoSfV+rZiAFir0+8WYFV2TKbEUIGmKAzHifD05o1pkweJsCKy9jb 4Gmq9g4kkkHDLkH0/nmpn9D+cBSh9G9BahYVeMEwJ97WL+hFdfABENSXKUVtM8G8ve96 qCK9GRMZbLDa2p0Mpqj8dJKVzNIVVMoysO73jtElXAembrUcOjHv2dWR82GytSmera0V typarSF4ftKyulfPKtoQLO/09mpHodbLo+n6ZjpAXOLnadRuiMFzoOPeLnmwzV4/4Ehi NcjA== X-Gm-Message-State: APjAAAXjfm/BWBfYPQ+bCh8F9zutO7Vyme1+BcdBI2eY4X2zOD3EPccR Eo4qaBLOpYHpj/R8WQOap9uD0Wd1WpK95Q== X-Received: by 2002:a63:5d54:: with SMTP id o20mr4769342pgm.413.1562854889992; Thu, 11 Jul 2019 07:21:29 -0700 (PDT) Received: from localhost ([49.248.58.252]) by smtp.gmail.com with ESMTPSA id q4sm5408674pjq.27.2019.07.11.07.21.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Jul 2019 07:21:29 -0700 (PDT) From: Amit Kucheria To: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, "Rafael J. Wysocki" , Len Brown , Pavel Machek Cc: linux-pm@vger.kernel.org Subject: [PATCH v2] PM: QoS: Get rid of unused flags Date: Thu, 11 Jul 2019 19:51:25 +0530 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The network_latency and network_throughput flags for PM-QoS have not found much use in drivers or in userspace since they were introduced. Commit 4a733ef1bea7 ("mac80211: remove PM-QoS listener") removed the only user PM_QOS_NETWORK_LATENCY in the kernel a while ago and there don't seem to be any userspace tools using the character device files either. PM_QOS_MEMORY_BANDWIDTH was never even added to the trace events. Remove all the flags except cpu_dma_latency. Signed-off-by: Amit Kucheria --- Changes from v1: - Rebased on linux-next to deal with .rst conversion of docs I've looked around for use of /dev/network_throughput and /dev/network_bandwidth) and not found any userspace programs that seem to use this currently. So this shouldn't be breaking our ABI contract with userspace. Documentation/power/pm_qos_interface.rst | 5 +-- include/linux/pm_qos.h | 6 --- include/trace/events/power.h | 8 +--- kernel/power/qos.c | 48 ------------------------ 4 files changed, 4 insertions(+), 63 deletions(-) -- 2.17.1 Acked-by: Pavel Machek diff --git a/Documentation/power/pm_qos_interface.rst b/Documentation/power/pm_qos_interface.rst index 945fc6d760c9..a00d607107ec 100644 --- a/Documentation/power/pm_qos_interface.rst +++ b/Documentation/power/pm_qos_interface.rst @@ -7,8 +7,7 @@ performance expectations by drivers, subsystems and user space applications on one of the parameters. Two different PM QoS frameworks are available: -1. PM QoS classes for cpu_dma_latency, network_latency, network_throughput, -memory_bandwidth. +1. PM QoS classes for cpu_dma_latency 2. the per-device PM QoS framework provides the API to manage the per-device latency constraints and PM QoS flags. @@ -79,7 +78,7 @@ cleanup of a process, the interface requires the process to register its parameter requests in the following way: To register the default pm_qos target for the specific parameter, the process -must open one of /dev/[cpu_dma_latency, network_latency, network_throughput] +must open /dev/cpu_dma_latency As long as the device node is held open that process has a registered request on the parameter. diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h index 6ea1ae373d77..2a3c237b1910 100644 --- a/include/linux/pm_qos.h +++ b/include/linux/pm_qos.h @@ -13,9 +13,6 @@ enum { PM_QOS_RESERVED = 0, PM_QOS_CPU_DMA_LATENCY, - PM_QOS_NETWORK_LATENCY, - PM_QOS_NETWORK_THROUGHPUT, - PM_QOS_MEMORY_BANDWIDTH, /* insert new class ID */ PM_QOS_NUM_CLASSES, @@ -33,9 +30,6 @@ enum pm_qos_flags_status { #define PM_QOS_LATENCY_ANY_NS ((s64)PM_QOS_LATENCY_ANY * NSEC_PER_USEC) #define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC) -#define PM_QOS_NETWORK_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC) -#define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0 -#define PM_QOS_MEMORY_BANDWIDTH_DEFAULT_VALUE 0 #define PM_QOS_RESUME_LATENCY_DEFAULT_VALUE PM_QOS_LATENCY_ANY #define PM_QOS_RESUME_LATENCY_NO_CONSTRAINT PM_QOS_LATENCY_ANY #define PM_QOS_RESUME_LATENCY_NO_CONSTRAINT_NS PM_QOS_LATENCY_ANY_NS diff --git a/include/trace/events/power.h b/include/trace/events/power.h index f7aece721aed..7457e238e1b7 100644 --- a/include/trace/events/power.h +++ b/include/trace/events/power.h @@ -379,9 +379,7 @@ DECLARE_EVENT_CLASS(pm_qos_request, TP_printk("pm_qos_class=%s value=%d", __print_symbolic(__entry->pm_qos_class, - { PM_QOS_CPU_DMA_LATENCY, "CPU_DMA_LATENCY" }, - { PM_QOS_NETWORK_LATENCY, "NETWORK_LATENCY" }, - { PM_QOS_NETWORK_THROUGHPUT, "NETWORK_THROUGHPUT" }), + { PM_QOS_CPU_DMA_LATENCY, "CPU_DMA_LATENCY" }), __entry->value) ); @@ -426,9 +424,7 @@ TRACE_EVENT(pm_qos_update_request_timeout, TP_printk("pm_qos_class=%s value=%d, timeout_us=%ld", __print_symbolic(__entry->pm_qos_class, - { PM_QOS_CPU_DMA_LATENCY, "CPU_DMA_LATENCY" }, - { PM_QOS_NETWORK_LATENCY, "NETWORK_LATENCY" }, - { PM_QOS_NETWORK_THROUGHPUT, "NETWORK_THROUGHPUT" }), + { PM_QOS_CPU_DMA_LATENCY, "CPU_DMA_LATENCY" }), __entry->value, __entry->timeout_us) ); diff --git a/kernel/power/qos.c b/kernel/power/qos.c index 33e3febaba53..9568a2fe7c11 100644 --- a/kernel/power/qos.c +++ b/kernel/power/qos.c @@ -78,57 +78,9 @@ static struct pm_qos_object cpu_dma_pm_qos = { .name = "cpu_dma_latency", }; -static BLOCKING_NOTIFIER_HEAD(network_lat_notifier); -static struct pm_qos_constraints network_lat_constraints = { - .list = PLIST_HEAD_INIT(network_lat_constraints.list), - .target_value = PM_QOS_NETWORK_LAT_DEFAULT_VALUE, - .default_value = PM_QOS_NETWORK_LAT_DEFAULT_VALUE, - .no_constraint_value = PM_QOS_NETWORK_LAT_DEFAULT_VALUE, - .type = PM_QOS_MIN, - .notifiers = &network_lat_notifier, -}; -static struct pm_qos_object network_lat_pm_qos = { - .constraints = &network_lat_constraints, - .name = "network_latency", -}; - - -static BLOCKING_NOTIFIER_HEAD(network_throughput_notifier); -static struct pm_qos_constraints network_tput_constraints = { - .list = PLIST_HEAD_INIT(network_tput_constraints.list), - .target_value = PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE, - .default_value = PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE, - .no_constraint_value = PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE, - .type = PM_QOS_MAX, - .notifiers = &network_throughput_notifier, -}; -static struct pm_qos_object network_throughput_pm_qos = { - .constraints = &network_tput_constraints, - .name = "network_throughput", -}; - - -static BLOCKING_NOTIFIER_HEAD(memory_bandwidth_notifier); -static struct pm_qos_constraints memory_bw_constraints = { - .list = PLIST_HEAD_INIT(memory_bw_constraints.list), - .target_value = PM_QOS_MEMORY_BANDWIDTH_DEFAULT_VALUE, - .default_value = PM_QOS_MEMORY_BANDWIDTH_DEFAULT_VALUE, - .no_constraint_value = PM_QOS_MEMORY_BANDWIDTH_DEFAULT_VALUE, - .type = PM_QOS_SUM, - .notifiers = &memory_bandwidth_notifier, -}; -static struct pm_qos_object memory_bandwidth_pm_qos = { - .constraints = &memory_bw_constraints, - .name = "memory_bandwidth", -}; - - static struct pm_qos_object *pm_qos_array[] = { &null_pm_qos, &cpu_dma_pm_qos, - &network_lat_pm_qos, - &network_throughput_pm_qos, - &memory_bandwidth_pm_qos, }; static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,