PM Qos: Add min online cpus as PM QoS parameter
Gaurav Sarode [Fri, 17 Feb 2012 09:55:43 +0000 (14:55 +0530)]
Bug 940061

Change-Id: Ibae842fdc3af3c92ec7e6125c602417110d8b55e
Signed-off-by: Gaurav Sarode <gsarode@nvidia.com>
Reviewed-on: http://git-master/r/84521
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Tested-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>

Rebase-Id: R830d4e99f1e03b61a8c4e52e11645b7ed2f10f56

include/linux/pm_qos.h
kernel/power/qos.c

index 90e539a..cd0b85f 100644 (file)
@@ -14,6 +14,7 @@ enum {
        PM_QOS_CPU_DMA_LATENCY,
        PM_QOS_NETWORK_LATENCY,
        PM_QOS_NETWORK_THROUGHPUT,
+       PM_QOS_MIN_ONLINE_CPUS,
        PM_QOS_MAX_ONLINE_CPUS,
        PM_QOS_CPU_FREQ_MIN,
        PM_QOS_CPU_FREQ_MAX,
@@ -28,6 +29,7 @@ enum {
 #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_MIN_ONLINE_CPUS_DEFAULT_VALUE   0
 #define PM_QOS_MAX_ONLINE_CPUS_DEFAULT_VALUE   LONG_MAX
 #define PM_QOS_CPU_FREQ_MIN_DEFAULT_VALUE      0
 #define PM_QOS_CPU_FREQ_MAX_DEFAULT_VALUE      LONG_MAX
index 7a7deff..be37626 100644 (file)
@@ -100,6 +100,21 @@ static struct pm_qos_object network_throughput_pm_qos = {
        .name = "network_throughput",
 };
 
+
+static BLOCKING_NOTIFIER_HEAD(min_online_cpus_notifier);
+static struct pm_qos_constraints min_online_cpus_constraints = {
+       .list = PLIST_HEAD_INIT(min_online_cpus_constraints.list),
+       .target_value = PM_QOS_MIN_ONLINE_CPUS_DEFAULT_VALUE,
+       .default_value = PM_QOS_MIN_ONLINE_CPUS_DEFAULT_VALUE,
+       .type = PM_QOS_MAX,
+       .notifiers = &min_online_cpus_notifier,
+};
+static struct pm_qos_object min_online_cpus_pm_qos = {
+       .constraints = &min_online_cpus_constraints,
+       .name = "min_online_cpus",
+};
+
+
 static BLOCKING_NOTIFIER_HEAD(max_online_cpus_notifier);
 static struct pm_qos_constraints max_online_cpus_constraints = {
        .list = PLIST_HEAD_INIT(max_online_cpus_constraints.list),
@@ -148,6 +163,7 @@ static struct pm_qos_object *pm_qos_array[] = {
        &cpu_dma_pm_qos,
        &network_lat_pm_qos,
        &network_throughput_pm_qos,
+       &min_online_cpus_pm_qos,
        &max_online_cpus_pm_qos,
        &cpu_freq_min_pm_qos,
        &cpu_freq_max_pm_qos