aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-22 10:38:37 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-22 10:38:37 -0500
commitfcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch)
treea57612d1888735a2ec7972891b68c1ac5ec8faea /kernel
parent8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff)
Added missing tegra files.HEADmaster
Diffstat (limited to 'kernel')
-rw-r--r--kernel/pm_qos_params.c526
-rw-r--r--kernel/power/consoleearlysuspend.c78
-rw-r--r--kernel/power/earlysuspend.c187
-rw-r--r--kernel/power/fbearlysuspend.c153
-rw-r--r--kernel/power/suspend_time.c111
-rw-r--r--kernel/power/userwakelock.c219
-rw-r--r--kernel/sched.c9443
-rw-r--r--kernel/sched_autogroup.c275
-rw-r--r--kernel/sched_autogroup.h42
-rw-r--r--kernel/sched_clock.c350
-rw-r--r--kernel/sched_cpupri.c204
-rw-r--r--kernel/sched_cpupri.h37
-rw-r--r--kernel/sched_debug.c508
-rw-r--r--kernel/sched_fair.c4346
-rw-r--r--kernel/sched_features.h74
-rw-r--r--kernel/sched_idletask.c97
-rw-r--r--kernel/sched_rt.c1866
-rw-r--r--kernel/sched_stats.h336
-rw-r--r--kernel/sched_stoptask.c104
-rw-r--r--kernel/sysctl_check.c160
-rw-r--r--kernel/time/timecompare.c193
-rw-r--r--kernel/trace/trace_workqueue.c300
-rw-r--r--kernel/trace/tracedump.c682
-rw-r--r--kernel/trace/tracelevel.c142
24 files changed, 20433 insertions, 0 deletions
diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c
new file mode 100644
index 00000000000..82da7ac3b1f
--- /dev/null
+++ b/kernel/pm_qos_params.c
@@ -0,0 +1,526 @@
1/*
2 * This module exposes the interface to kernel space for specifying
3 * QoS dependencies. It provides infrastructure for registration of:
4 *
5 * Dependents on a QoS value : register requests
6 * Watchers of QoS value : get notified when target QoS value changes
7 *
8 * This QoS design is best effort based. Dependents register their QoS needs.
9 * Watchers register to keep track of the current QoS needs of the system.
10 *
11 * There are 3 basic classes of QoS parameter: latency, timeout, throughput
12 * each have defined units:
13 * latency: usec
14 * timeout: usec <-- currently not used.
15 * throughput: kbs (kilo byte / sec)
16 *
17 * There are lists of pm_qos_objects each one wrapping requests, notifiers
18 *
19 * User mode requests on a QOS parameter register themselves to the
20 * subsystem by opening the device node /dev/... and writing there request to
21 * the node. As long as the process holds a file handle open to the node the
22 * client continues to be accounted for. Upon file release the usermode
23 * request is removed and a new qos target is computed. This way when the
24 * request that the application has is cleaned up when closes the file
25 * pointer or exits the pm_qos_object will get an opportunity to clean up.
26 *
27 * Mark Gross <mgross@linux.intel.com>
28 */
29
30/*#define DEBUG*/
31
32#include <linux/pm_qos_params.h>
33#include <linux/sched.h>
34#include <linux/spinlock.h>
35#include <linux/slab.h>
36#include <linux/time.h>
37#include <linux/fs.h>
38#include <linux/device.h>
39#include <linux/miscdevice.h>
40#include <linux/string.h>
41#include <linux/platform_device.h>
42#include <linux/init.h>
43#include <linux/kernel.h>
44
45#include <linux/uaccess.h>
46
47/*
48 * locking rule: all changes to requests or notifiers lists
49 * or pm_qos_object list and pm_qos_objects need to happen with pm_qos_lock
50 * held, taken with _irqsave. One lock to rule them all
51 */
52enum pm_qos_type {
53 PM_QOS_MAX, /* return the largest value */
54 PM_QOS_MIN /* return the smallest value */
55};
56
57/*
58 * Note: The lockless read path depends on the CPU accessing
59 * target_value atomically. Atomic access is only guaranteed on all CPU
60 * types linux supports for 32 bit quantites
61 */
62struct pm_qos_object {
63 struct plist_head requests;
64 struct blocking_notifier_head *notifiers;
65 struct miscdevice pm_qos_power_miscdev;
66 char *name;
67 s32 target_value; /* Do not change to 64 bit */
68 s32 default_value;
69 enum pm_qos_type type;
70};
71
72static DEFINE_SPINLOCK(pm_qos_lock);
73
74static struct pm_qos_object null_pm_qos;
75static BLOCKING_NOTIFIER_HEAD(cpu_dma_lat_notifier);
76static struct pm_qos_object cpu_dma_pm_qos = {
77 .requests = PLIST_HEAD_INIT(cpu_dma_pm_qos.requests),
78 .notifiers = &cpu_dma_lat_notifier,
79 .name = "cpu_dma_latency",
80 .target_value = PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE,
81 .default_value = PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE,
82 .type = PM_QOS_MIN,
83};
84
85static BLOCKING_NOTIFIER_HEAD(network_lat_notifier);
86static struct pm_qos_object network_lat_pm_qos = {
87 .requests = PLIST_HEAD_INIT(network_lat_pm_qos.requests),
88 .notifiers = &network_lat_notifier,
89 .name = "network_latency",
90 .target_value = PM_QOS_NETWORK_LAT_DEFAULT_VALUE,
91 .default_value = PM_QOS_NETWORK_LAT_DEFAULT_VALUE,
92 .type = PM_QOS_MIN
93};
94
95
96static BLOCKING_NOTIFIER_HEAD(network_throughput_notifier);
97static struct pm_qos_object network_throughput_pm_qos = {
98 .requests = PLIST_HEAD_INIT(network_throughput_pm_qos.requests),
99 .notifiers = &network_throughput_notifier,
100 .name = "network_throughput",
101 .target_value = PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE,
102 .default_value = PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE,
103 .type = PM_QOS_MAX,
104};
105
106
107static BLOCKING_NOTIFIER_HEAD(min_online_cpus_notifier);
108static struct pm_qos_object min_online_cpus_pm_qos = {
109 .requests = PLIST_HEAD_INIT(min_online_cpus_pm_qos.requests),
110 .notifiers = &min_online_cpus_notifier,
111 .name = "min_online_cpus",
112 .target_value = PM_QOS_MIN_ONLINE_CPUS_DEFAULT_VALUE,
113 .default_value = PM_QOS_MIN_ONLINE_CPUS_DEFAULT_VALUE,
114 .type = PM_QOS_MAX,
115};
116
117
118static BLOCKING_NOTIFIER_HEAD(max_online_cpus_notifier);
119static struct pm_qos_object max_online_cpus_pm_qos = {
120 .requests = PLIST_HEAD_INIT(max_online_cpus_pm_qos.requests),
121 .notifiers = &max_online_cpus_notifier,
122 .name = "max_online_cpus",
123 .target_value = PM_QOS_MAX_ONLINE_CPUS_DEFAULT_VALUE,
124 .default_value = PM_QOS_MAX_ONLINE_CPUS_DEFAULT_VALUE,
125 .type = PM_QOS_MIN,
126};
127
128
129static BLOCKING_NOTIFIER_HEAD(cpu_freq_min_notifier);
130static struct pm_qos_object cpu_freq_min_pm_qos = {
131 .requests = PLIST_HEAD_INIT(cpu_freq_min_pm_qos.requests),
132 .notifiers = &cpu_freq_min_notifier,
133 .name = "cpu_freq_min",
134 .target_value = PM_QOS_CPU_FREQ_MIN_DEFAULT_VALUE,
135 .default_value = PM_QOS_CPU_FREQ_MIN_DEFAULT_VALUE,
136 .type = PM_QOS_MAX,
137};
138
139
140static BLOCKING_NOTIFIER_HEAD(cpu_freq_max_notifier);
141static struct pm_qos_object cpu_freq_max_pm_qos = {
142 .requests = PLIST_HEAD_INIT(cpu_freq_max_pm_qos.requests),
143 .notifiers = &cpu_freq_max_notifier,
144 .name = "cpu_freq_max",
145 .target_value = PM_QOS_CPU_FREQ_MAX_DEFAULT_VALUE,
146 .default_value = PM_QOS_CPU_FREQ_MAX_DEFAULT_VALUE,
147 .type = PM_QOS_MIN,
148};
149
150
151static struct pm_qos_object *pm_qos_array[] = {
152 &null_pm_qos,
153 &cpu_dma_pm_qos,
154 &network_lat_pm_qos,
155 &network_throughput_pm_qos,
156 &min_online_cpus_pm_qos,
157 &max_online_cpus_pm_qos,
158 &cpu_freq_min_pm_qos,
159 &cpu_freq_max_pm_qos
160};
161
162static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,
163 size_t count, loff_t *f_pos);
164static ssize_t pm_qos_power_read(struct file *filp, char __user *buf,
165 size_t count, loff_t *f_pos);
166static int pm_qos_power_open(struct inode *inode, struct file *filp);
167static int pm_qos_power_release(struct inode *inode, struct file *filp);
168
169static const struct file_operations pm_qos_power_fops = {
170 .write = pm_qos_power_write,
171 .read = pm_qos_power_read,
172 .open = pm_qos_power_open,
173 .release = pm_qos_power_release,
174 .llseek = noop_llseek,
175};
176
177/* unlocked internal variant */
178static inline int pm_qos_get_value(struct pm_qos_object *o)
179{
180 if (plist_head_empty(&o->requests))
181 return o->default_value;
182
183 switch (o->type) {
184 case PM_QOS_MIN: