Skip to contentSkip to conversation

PM: QoS: Get rid of unused flags

RFC PATCH Superseded Amit Kucheria 2 participants 3 messages Jul 10, 2019 – Jul 11, 2019 1 message not in the archive

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

RFC PATCH 1/1 PM: QoS: Get rid of unused flags

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.

---
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.txt |  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(-)
Documentation/power/pm_qos_interface.txt +2 -3
index 19c5f7b1a7bab..ac53ca4ae24e1 100644
@@ -5,8 +5,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.
 
@@ -74,7 +73,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.
include/linux/pm_qos.h +0 -6
index 6ea1ae373d77c..2a3c237b1910d 100644
@@ -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
include/trace/events/power.h +2 -6
index f7aece721aed7..7457e238e1b74 100644
@@ -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)
 );
 
kernel/power/qos.c +0 -48

57 lines not on this page · raw message

Signature · 1 line
2.17.1
#2 lore raw
Quoted 9 lines · Amit Kucheria

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.

Quoted 5 lines

PM_QOS_MEMORY_BANDWIDTH was never even added to the trace events.

Remove all the flags except cpu_dma_latency.

I agree with the rationale, but the patch will clash with some PM QoS changes from Viresh already in linux-next AFAICS. Can you please rebase it on top of that material?

Quoted 150 lines

---
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.txt |  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(-)
Documentation/power/pm_qos_interface.txt +2 -3
index 19c5f7b1a7bab..ac53ca4ae24e1 100644
@@ -5,8 +5,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.
 
@@ -74,7 +73,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.
include/linux/pm_qos.h +0 -6
index 6ea1ae373d77c..2a3c237b1910d 100644
@@ -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
include/trace/events/power.h +2 -6
index f7aece721aed7..7457e238e1b74 100644
@@ -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)
 );
 
kernel/power/qos.c +0 -49
index 33e3febaba53f..9568a2fe7c116 100644
@@ -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,
--

2.17.1

#3 lore raw
Quoted 13 lines · Rafael J. Wysocki
Quoted 11 lines · Amit Kucheria

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.

Quoted 7 lines
Quoted 3 lines

Remove all the flags except cpu_dma_latency.

I agree with the rationale, but the patch will clash with some PM QoS changes from Viresh already in linux-next AFAICS. Can you please rebase it on top of that material?

Sure, I'll rebase on linux-next and resend.

Quoted 150 lines
Quoted 150 lines

---
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.txt |  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(-)
Documentation/power/pm_qos_interface.txt +2 -3
index 19c5f7b1a7bab..ac53ca4ae24e1 100644
@@ -5,8 +5,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.
 
@@ -74,7 +73,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.
include/linux/pm_qos.h +0 -6
index 6ea1ae373d77c..2a3c237b1910d 100644
@@ -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
include/trace/events/power.h +2 -6
index f7aece721aed7..7457e238e1b74 100644
@@ -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)
 );
 
kernel/power/qos.c +0 -49
index 33e3febaba53f..9568a2fe7c116 100644
@@ -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,
--

2.17.1