diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/cpuset.c | 2 | ||||
-rw-r--r-- | kernel/cred.c | 4 | ||||
-rw-r--r-- | kernel/exit.c | 1 | ||||
-rw-r--r-- | kernel/irq/handle.c | 11 | ||||
-rw-r--r-- | kernel/module.c | 7 | ||||
-rw-r--r-- | kernel/profile.c | 6 | ||||
-rw-r--r-- | kernel/ptrace.c | 9 | ||||
-rw-r--r-- | kernel/sched.c | 30 | ||||
-rw-r--r-- | kernel/sched_cpupri.c | 8 | ||||
-rw-r--r-- | kernel/signal.c | 11 | ||||
-rw-r--r-- | kernel/slow-work.c | 4 | ||||
-rw-r--r-- | kernel/sysctl.c | 14 | ||||
-rw-r--r-- | kernel/time/clocksource.c | 3 | ||||
-rw-r--r-- | kernel/time/timekeeping.c | 7 | ||||
-rw-r--r-- | kernel/trace/blktrace.c | 21 |
15 files changed, 76 insertions, 62 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 026faccca869..d5a7e17474ee 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -1857,7 +1857,7 @@ struct cgroup_subsys cpuset_subsys = { | |||
1857 | 1857 | ||
1858 | int __init cpuset_init_early(void) | 1858 | int __init cpuset_init_early(void) |
1859 | { | 1859 | { |
1860 | alloc_bootmem_cpumask_var(&top_cpuset.cpus_allowed); | 1860 | alloc_cpumask_var(&top_cpuset.cpus_allowed, GFP_NOWAIT); |
1861 | 1861 | ||
1862 | top_cpuset.mems_generation = cpuset_mems_generation++; | 1862 | top_cpuset.mems_generation = cpuset_mems_generation++; |
1863 | return 0; | 1863 | return 0; |
diff --git a/kernel/cred.c b/kernel/cred.c index 3a039189d707..1bb4d7e5d616 100644 --- a/kernel/cred.c +++ b/kernel/cred.c | |||
@@ -167,7 +167,7 @@ EXPORT_SYMBOL(prepare_creds); | |||
167 | 167 | ||
168 | /* | 168 | /* |
169 | * Prepare credentials for current to perform an execve() | 169 | * Prepare credentials for current to perform an execve() |
170 | * - The caller must hold current->cred_exec_mutex | 170 | * - The caller must hold current->cred_guard_mutex |
171 | */ | 171 | */ |
172 | struct cred *prepare_exec_creds(void) | 172 | struct cred *prepare_exec_creds(void) |
173 | { | 173 | { |
@@ -276,7 +276,7 @@ int copy_creds(struct task_struct *p, unsigned long clone_flags) | |||
276 | struct cred *new; | 276 | struct cred *new; |
277 | int ret; | 277 | int ret; |
278 | 278 | ||
279 | mutex_init(&p->cred_exec_mutex); | 279 | mutex_init(&p->cred_guard_mutex); |
280 | 280 | ||
281 | if ( | 281 | if ( |
282 | #ifdef CONFIG_KEYS | 282 | #ifdef CONFIG_KEYS |
diff --git a/kernel/exit.c b/kernel/exit.c index 49cdf6946f34..b6c90b5ef509 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -1480,6 +1480,7 @@ static int wait_consider_task(struct task_struct *parent, int ptrace, | |||
1480 | */ | 1480 | */ |
1481 | if (*notask_error) | 1481 | if (*notask_error) |
1482 | *notask_error = ret; | 1482 | *notask_error = ret; |
1483 | return 0; | ||
1483 | } | 1484 | } |
1484 | 1485 | ||
1485 | if (likely(!ptrace) && unlikely(p->ptrace)) { | 1486 | if (likely(!ptrace) && unlikely(p->ptrace)) { |
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c index a60018402f42..104578541230 100644 --- a/kernel/irq/handle.c +++ b/kernel/irq/handle.c | |||
@@ -150,6 +150,7 @@ int __init early_irq_init(void) | |||
150 | { | 150 | { |
151 | struct irq_desc *desc; | 151 | struct irq_desc *desc; |
152 | int legacy_count; | 152 | int legacy_count; |
153 | int node; | ||
153 | int i; | 154 | int i; |
154 | 155 | ||
155 | init_irq_default_affinity(); | 156 | init_irq_default_affinity(); |
@@ -160,20 +161,20 @@ int __init early_irq_init(void) | |||
160 | 161 | ||
161 | desc = irq_desc_legacy; | 162 | desc = irq_desc_legacy; |
162 | legacy_count = ARRAY_SIZE(irq_desc_legacy); | 163 | legacy_count = ARRAY_SIZE(irq_desc_legacy); |
164 | node = first_online_node; | ||
163 | 165 | ||
164 | /* allocate irq_desc_ptrs array based on nr_irqs */ | 166 | /* allocate irq_desc_ptrs array based on nr_irqs */ |
165 | irq_desc_ptrs = alloc_bootmem(nr_irqs * sizeof(void *)); | 167 | irq_desc_ptrs = kcalloc(nr_irqs, sizeof(void *), GFP_NOWAIT); |
166 | 168 | ||
167 | /* allocate based on nr_cpu_ids */ | 169 | /* allocate based on nr_cpu_ids */ |
168 | /* FIXME: invert kstat_irgs, and it'd be a per_cpu_alloc'd thing */ | 170 | kstat_irqs_legacy = kzalloc_node(NR_IRQS_LEGACY * nr_cpu_ids * |
169 | kstat_irqs_legacy = alloc_bootmem(NR_IRQS_LEGACY * nr_cpu_ids * | 171 | sizeof(int), GFP_NOWAIT, node); |
170 | sizeof(int)); | ||
171 | 172 | ||
172 | for (i = 0; i < legacy_count; i++) { | 173 | for (i = 0; i < legacy_count; i++) { |
173 | desc[i].irq = i; | 174 | desc[i].irq = i; |
174 | desc[i].kstat_irqs = kstat_irqs_legacy + i * nr_cpu_ids; | 175 | desc[i].kstat_irqs = kstat_irqs_legacy + i * nr_cpu_ids; |
175 | lockdep_set_class(&desc[i].lock, &irq_desc_lock_class); | 176 | lockdep_set_class(&desc[i].lock, &irq_desc_lock_class); |
176 | alloc_desc_masks(&desc[i], 0, true); | 177 | alloc_desc_masks(&desc[i], node, true); |
177 | init_desc_masks(&desc[i]); | 178 | init_desc_masks(&desc[i]); |
178 | irq_desc_ptrs[i] = desc + i; | 179 | irq_desc_ptrs[i] = desc + i; |
179 | } | 180 | } |
diff --git a/kernel/module.c b/kernel/module.c index 2383e60fcf3f..278e9b6762bb 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -73,6 +73,9 @@ DEFINE_MUTEX(module_mutex); | |||
73 | EXPORT_SYMBOL_GPL(module_mutex); | 73 | EXPORT_SYMBOL_GPL(module_mutex); |
74 | static LIST_HEAD(modules); | 74 | static LIST_HEAD(modules); |
75 | 75 | ||
76 | /* Block module loading/unloading? */ | ||
77 | int modules_disabled = 0; | ||
78 | |||
76 | /* Waiting for a module to finish initializing? */ | 79 | /* Waiting for a module to finish initializing? */ |
77 | static DECLARE_WAIT_QUEUE_HEAD(module_wq); | 80 | static DECLARE_WAIT_QUEUE_HEAD(module_wq); |
78 | 81 | ||
@@ -778,7 +781,7 @@ SYSCALL_DEFINE2(delete_module, const char __user *, name_user, | |||
778 | char name[MODULE_NAME_LEN]; | 781 | char name[MODULE_NAME_LEN]; |
779 | int ret, forced = 0; | 782 | int ret, forced = 0; |
780 | 783 | ||
781 | if (!capable(CAP_SYS_MODULE)) | 784 | if (!capable(CAP_SYS_MODULE) || modules_disabled) |
782 | return -EPERM; | 785 | return -EPERM; |
783 | 786 | ||
784 | if (strncpy_from_user(name, name_user, MODULE_NAME_LEN-1) < 0) | 787 | if (strncpy_from_user(name, name_user, MODULE_NAME_LEN-1) < 0) |
@@ -2338,7 +2341,7 @@ SYSCALL_DEFINE3(init_module, void __user *, umod, | |||
2338 | int ret = 0; | 2341 | int ret = 0; |
2339 | 2342 | ||
2340 | /* Must have permission */ | 2343 | /* Must have permission */ |
2341 | if (!capable(CAP_SYS_MODULE)) | 2344 | if (!capable(CAP_SYS_MODULE) || modules_disabled) |
2342 | return -EPERM; | 2345 | return -EPERM; |
2343 | 2346 | ||
2344 | /* Only one module load at a time, please */ | 2347 | /* Only one module load at a time, please */ |
diff --git a/kernel/profile.c b/kernel/profile.c index 7724e0409bae..28cf26ad2d24 100644 --- a/kernel/profile.c +++ b/kernel/profile.c | |||
@@ -111,12 +111,6 @@ int __ref profile_init(void) | |||
111 | /* only text is profiled */ | 111 | /* only text is profiled */ |
112 | prof_len = (_etext - _stext) >> prof_shift; | 112 | prof_len = (_etext - _stext) >> prof_shift; |
113 | buffer_bytes = prof_len*sizeof(atomic_t); | 113 | buffer_bytes = prof_len*sizeof(atomic_t); |
114 | if (!slab_is_available()) { | ||
115 | prof_buffer = alloc_bootmem(buffer_bytes); | ||
116 | alloc_bootmem_cpumask_var(&prof_cpu_mask); | ||
117 | cpumask_copy(prof_cpu_mask, cpu_possible_mask); | ||
118 | return 0; | ||
119 | } | ||
120 | 114 | ||
121 | if (!alloc_cpumask_var(&prof_cpu_mask, GFP_KERNEL)) | 115 | if (!alloc_cpumask_var(&prof_cpu_mask, GFP_KERNEL)) |
122 | return -ENOMEM; | 116 | return -ENOMEM; |
diff --git a/kernel/ptrace.c b/kernel/ptrace.c index 2442d140bd9a..f6d8b8cb5e34 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c | |||
@@ -175,10 +175,11 @@ int ptrace_attach(struct task_struct *task) | |||
175 | if (same_thread_group(task, current)) | 175 | if (same_thread_group(task, current)) |
176 | goto out; | 176 | goto out; |
177 | 177 | ||
178 | /* Protect exec's credential calculations against our interference; | 178 | /* Protect the target's credential calculations against our |
179 | * SUID, SGID and LSM creds get determined differently under ptrace. | 179 | * interference; SUID, SGID and LSM creds get determined differently |
180 | * under ptrace. | ||
180 | */ | 181 | */ |
181 | retval = mutex_lock_interruptible(&task->cred_exec_mutex); | 182 | retval = mutex_lock_interruptible(&task->cred_guard_mutex); |
182 | if (retval < 0) | 183 | if (retval < 0) |
183 | goto out; | 184 | goto out; |
184 | 185 | ||
@@ -222,7 +223,7 @@ repeat: | |||
222 | bad: | 223 | bad: |
223 | write_unlock_irqrestore(&tasklist_lock, flags); | 224 | write_unlock_irqrestore(&tasklist_lock, flags); |
224 | task_unlock(task); | 225 | task_unlock(task); |
225 | mutex_unlock(&task->cred_exec_mutex); | 226 | mutex_unlock(&task->cred_guard_mutex); |
226 | out: | 227 | out: |
227 | return retval; | 228 | return retval; |
228 | } | 229 | } |
diff --git a/kernel/sched.c b/kernel/sched.c index 5b3f6ec1b0b3..f04aa9664504 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -69,7 +69,6 @@ | |||
69 | #include <linux/pagemap.h> | 69 | #include <linux/pagemap.h> |
70 | #include <linux/hrtimer.h> | 70 | #include <linux/hrtimer.h> |
71 | #include <linux/tick.h> | 71 | #include <linux/tick.h> |
72 | #include <linux/bootmem.h> | ||
73 | #include <linux/debugfs.h> | 72 | #include <linux/debugfs.h> |
74 | #include <linux/ctype.h> | 73 | #include <linux/ctype.h> |
75 | #include <linux/ftrace.h> | 74 | #include <linux/ftrace.h> |
@@ -7825,24 +7824,21 @@ static void rq_attach_root(struct rq *rq, struct root_domain *rd) | |||
7825 | 7824 | ||
7826 | static int __init_refok init_rootdomain(struct root_domain *rd, bool bootmem) | 7825 | static int __init_refok init_rootdomain(struct root_domain *rd, bool bootmem) |
7827 | { | 7826 | { |
7827 | gfp_t gfp = GFP_KERNEL; | ||
7828 | |||
7828 | memset(rd, 0, sizeof(*rd)); | 7829 | memset(rd, 0, sizeof(*rd)); |
7829 | 7830 | ||
7830 | if (bootmem) { | 7831 | if (bootmem) |
7831 | alloc_bootmem_cpumask_var(&def_root_domain.span); | 7832 | gfp = GFP_NOWAIT; |
7832 | alloc_bootmem_cpumask_var(&def_root_domain.online); | ||
7833 | alloc_bootmem_cpumask_var(&def_root_domain.rto_mask); | ||
7834 | cpupri_init(&rd->cpupri, true); | ||
7835 | return 0; | ||
7836 | } | ||
7837 | 7833 | ||
7838 | if (!alloc_cpumask_var(&rd->span, GFP_KERNEL)) | 7834 | if (!alloc_cpumask_var(&rd->span, gfp)) |
7839 | goto out; | 7835 | goto out; |
7840 | if (!alloc_cpumask_var(&rd->online, GFP_KERNEL)) | 7836 | if (!alloc_cpumask_var(&rd->online, gfp)) |
7841 | goto free_span; | 7837 | goto free_span; |
7842 | if (!alloc_cpumask_var(&rd->rto_mask, GFP_KERNEL)) | 7838 | if (!alloc_cpumask_var(&rd->rto_mask, gfp)) |
7843 | goto free_online; | 7839 | goto free_online; |
7844 | 7840 | ||
7845 | if (cpupri_init(&rd->cpupri, false) != 0) | 7841 | if (cpupri_init(&rd->cpupri, bootmem) != 0) |
7846 | goto free_rto_mask; | 7842 | goto free_rto_mask; |
7847 | return 0; | 7843 | return 0; |
7848 | 7844 | ||
@@ -9166,7 +9162,7 @@ void __init sched_init(void) | |||
9166 | * we use alloc_bootmem(). | 9162 | * we use alloc_bootmem(). |
9167 | */ | 9163 | */ |
9168 | if (alloc_size) { | 9164 | if (alloc_size) { |
9169 | ptr = (unsigned long)alloc_bootmem(alloc_size); | 9165 | ptr = (unsigned long)kzalloc(alloc_size, GFP_NOWAIT); |
9170 | 9166 | ||
9171 | #ifdef CONFIG_FAIR_GROUP_SCHED | 9167 | #ifdef CONFIG_FAIR_GROUP_SCHED |
9172 | init_task_group.se = (struct sched_entity **)ptr; | 9168 | init_task_group.se = (struct sched_entity **)ptr; |
@@ -9357,13 +9353,13 @@ void __init sched_init(void) | |||
9357 | current->sched_class = &fair_sched_class; | 9353 | current->sched_class = &fair_sched_class; |
9358 | 9354 | ||
9359 | /* Allocate the nohz_cpu_mask if CONFIG_CPUMASK_OFFSTACK */ | 9355 | /* Allocate the nohz_cpu_mask if CONFIG_CPUMASK_OFFSTACK */ |
9360 | alloc_bootmem_cpumask_var(&nohz_cpu_mask); | 9356 | alloc_cpumask_var(&nohz_cpu_mask, GFP_NOWAIT); |
9361 | #ifdef CONFIG_SMP | 9357 | #ifdef CONFIG_SMP |
9362 | #ifdef CONFIG_NO_HZ | 9358 | #ifdef CONFIG_NO_HZ |
9363 | alloc_bootmem_cpumask_var(&nohz.cpu_mask); | 9359 | alloc_cpumask_var(&nohz.cpu_mask, GFP_NOWAIT); |
9364 | alloc_bootmem_cpumask_var(&nohz.ilb_grp_nohz_mask); | 9360 | alloc_cpumask_var(&nohz.ilb_grp_nohz_mask, GFP_NOWAIT); |
9365 | #endif | 9361 | #endif |
9366 | alloc_bootmem_cpumask_var(&cpu_isolated_map); | 9362 | alloc_cpumask_var(&cpu_isolated_map, GFP_NOWAIT); |
9367 | #endif /* SMP */ | 9363 | #endif /* SMP */ |
9368 | 9364 | ||
9369 | perf_counter_init(); | 9365 | perf_counter_init(); |
diff --git a/kernel/sched_cpupri.c b/kernel/sched_cpupri.c index 344712a5e3ed..7deffc9f0e5f 100644 --- a/kernel/sched_cpupri.c +++ b/kernel/sched_cpupri.c | |||
@@ -154,8 +154,12 @@ void cpupri_set(struct cpupri *cp, int cpu, int newpri) | |||
154 | */ | 154 | */ |
155 | int __init_refok cpupri_init(struct cpupri *cp, bool bootmem) | 155 | int __init_refok cpupri_init(struct cpupri *cp, bool bootmem) |
156 | { | 156 | { |
157 | gfp_t gfp = GFP_KERNEL; | ||
157 | int i; | 158 | int i; |
158 | 159 | ||
160 | if (bootmem) | ||
161 | gfp = GFP_NOWAIT; | ||
162 | |||
159 | memset(cp, 0, sizeof(*cp)); | 163 | memset(cp, 0, sizeof(*cp)); |
160 | 164 | ||
161 | for (i = 0; i < CPUPRI_NR_PRIORITIES; i++) { | 165 | for (i = 0; i < CPUPRI_NR_PRIORITIES; i++) { |
@@ -163,9 +167,7 @@ int __init_refok cpupri_init(struct cpupri *cp, bool bootmem) | |||
163 | 167 | ||
164 | spin_lock_init(&vec->lock); | 168 | spin_lock_init(&vec->lock); |
165 | vec->count = 0; | 169 | vec->count = 0; |
166 | if (bootmem) | 170 | if (!zalloc_cpumask_var(&vec->mask, gfp)) |
167 | alloc_bootmem_cpumask_var(&vec->mask); | ||
168 | else if (!zalloc_cpumask_var(&vec->mask, GFP_KERNEL)) | ||
169 | goto cleanup; | 171 | goto cleanup; |
170 | } | 172 | } |
171 | 173 | ||
diff --git a/kernel/signal.c b/kernel/signal.c index dba6ae99978a..809a228019ad 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -247,14 +247,19 @@ void flush_sigqueue(struct sigpending *queue) | |||
247 | /* | 247 | /* |
248 | * Flush all pending signals for a task. | 248 | * Flush all pending signals for a task. |
249 | */ | 249 | */ |
250 | void __flush_signals(struct task_struct *t) | ||
251 | { | ||
252 | clear_tsk_thread_flag(t, TIF_SIGPENDING); | ||
253 | flush_sigqueue(&t->pending); | ||
254 | flush_sigqueue(&t->signal->shared_pending); | ||
255 | } | ||
256 | |||
250 | void flush_signals(struct task_struct *t) | 257 | void flush_signals(struct task_struct *t) |
251 | { | 258 | { |
252 | unsigned long flags; | 259 | unsigned long flags; |
253 | 260 | ||
254 | spin_lock_irqsave(&t->sighand->siglock, flags); | 261 | spin_lock_irqsave(&t->sighand->siglock, flags); |
255 | clear_tsk_thread_flag(t, TIF_SIGPENDING); | 262 | __flush_signals(t); |
256 | flush_sigqueue(&t->pending); | ||
257 | flush_sigqueue(&t->signal->shared_pending); | ||
258 | spin_unlock_irqrestore(&t->sighand->siglock, flags); | 263 | spin_unlock_irqrestore(&t->sighand->siglock, flags); |
259 | } | 264 | } |
260 | 265 | ||
diff --git a/kernel/slow-work.c b/kernel/slow-work.c index b28d19135f43..521ed2004d63 100644 --- a/kernel/slow-work.c +++ b/kernel/slow-work.c | |||
@@ -372,8 +372,8 @@ static int slow_work_thread(void *_data) | |||
372 | vsmax *= atomic_read(&slow_work_thread_count); | 372 | vsmax *= atomic_read(&slow_work_thread_count); |
373 | vsmax /= 100; | 373 | vsmax /= 100; |
374 | 374 | ||
375 | prepare_to_wait(&slow_work_thread_wq, &wait, | 375 | prepare_to_wait_exclusive(&slow_work_thread_wq, &wait, |
376 | TASK_INTERRUPTIBLE); | 376 | TASK_INTERRUPTIBLE); |
377 | if (!freezing(current) && | 377 | if (!freezing(current) && |
378 | !slow_work_threads_should_exit && | 378 | !slow_work_threads_should_exit && |
379 | !slow_work_available(vsmax) && | 379 | !slow_work_available(vsmax) && |
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index a7e4eb0525b1..ce664f98e3fb 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -115,6 +115,7 @@ static int ngroups_max = NGROUPS_MAX; | |||
115 | 115 | ||
116 | #ifdef CONFIG_MODULES | 116 | #ifdef CONFIG_MODULES |
117 | extern char modprobe_path[]; | 117 | extern char modprobe_path[]; |
118 | extern int modules_disabled; | ||
118 | #endif | 119 | #endif |
119 | #ifdef CONFIG_CHR_DEV_SG | 120 | #ifdef CONFIG_CHR_DEV_SG |
120 | extern int sg_big_buff; | 121 | extern int sg_big_buff; |
@@ -535,6 +536,17 @@ static struct ctl_table kern_table[] = { | |||
535 | .proc_handler = &proc_dostring, | 536 | .proc_handler = &proc_dostring, |
536 | .strategy = &sysctl_string, | 537 | .strategy = &sysctl_string, |
537 | }, | 538 | }, |
539 | { | ||
540 | .ctl_name = CTL_UNNUMBERED, | ||
541 | .procname = "modules_disabled", | ||
542 | .data = &modules_disabled, | ||
543 | .maxlen = sizeof(int), | ||
544 | .mode = 0644, | ||
545 | /* only handle a transition from default "0" to "1" */ | ||
546 | .proc_handler = &proc_dointvec_minmax, | ||
547 | .extra1 = &one, | ||
548 | .extra2 = &one, | ||
549 | }, | ||
538 | #endif | 550 | #endif |
539 | #if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) | 551 | #if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) |
540 | { | 552 | { |
@@ -1260,7 +1272,6 @@ static struct ctl_table vm_table[] = { | |||
1260 | .strategy = &sysctl_jiffies, | 1272 | .strategy = &sysctl_jiffies, |
1261 | }, | 1273 | }, |
1262 | #endif | 1274 | #endif |
1263 | #ifdef CONFIG_SECURITY | ||
1264 | { | 1275 | { |
1265 | .ctl_name = CTL_UNNUMBERED, | 1276 | .ctl_name = CTL_UNNUMBERED, |
1266 | .procname = "mmap_min_addr", | 1277 | .procname = "mmap_min_addr", |
@@ -1269,7 +1280,6 @@ static struct ctl_table vm_table[] = { | |||
1269 | .mode = 0644, | 1280 | .mode = 0644, |
1270 | .proc_handler = &proc_doulongvec_minmax, | 1281 | .proc_handler = &proc_doulongvec_minmax, |
1271 | }, | 1282 | }, |
1272 | #endif | ||
1273 | #ifdef CONFIG_NUMA | 1283 | #ifdef CONFIG_NUMA |
1274 | { | 1284 | { |
1275 | .ctl_name = CTL_UNNUMBERED, | 1285 | .ctl_name = CTL_UNNUMBERED, |
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index ecfd7b5187e0..80189f6f1c5a 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c | |||
@@ -402,9 +402,6 @@ int clocksource_register(struct clocksource *c) | |||
402 | unsigned long flags; | 402 | unsigned long flags; |
403 | int ret; | 403 | int ret; |
404 | 404 | ||
405 | /* save mult_orig on registration */ | ||
406 | c->mult_orig = c->mult; | ||
407 | |||
408 | spin_lock_irqsave(&clocksource_lock, flags); | 405 | spin_lock_irqsave(&clocksource_lock, flags); |
409 | ret = clocksource_enqueue(c); | 406 | ret = clocksource_enqueue(c); |
410 | if (!ret) | 407 | if (!ret) |
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 52a8bf8931f3..e8c77d9c633a 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
@@ -77,6 +77,10 @@ static void clocksource_forward_now(void) | |||
77 | clock->cycle_last = cycle_now; | 77 | clock->cycle_last = cycle_now; |
78 | 78 | ||
79 | nsec = cyc2ns(clock, cycle_delta); | 79 | nsec = cyc2ns(clock, cycle_delta); |
80 | |||
81 | /* If arch requires, add in gettimeoffset() */ | ||
82 | nsec += arch_gettimeoffset(); | ||
83 | |||
80 | timespec_add_ns(&xtime, nsec); | 84 | timespec_add_ns(&xtime, nsec); |
81 | 85 | ||
82 | nsec = ((s64)cycle_delta * clock->mult_orig) >> clock->shift; | 86 | nsec = ((s64)cycle_delta * clock->mult_orig) >> clock->shift; |
@@ -111,6 +115,9 @@ void getnstimeofday(struct timespec *ts) | |||
111 | /* convert to nanoseconds: */ | 115 | /* convert to nanoseconds: */ |
112 | nsecs = cyc2ns(clock, cycle_delta); | 116 | nsecs = cyc2ns(clock, cycle_delta); |
113 | 117 | ||
118 | /* If arch requires, add in gettimeoffset() */ | ||
119 | nsecs += arch_gettimeoffset(); | ||
120 | |||
114 | } while (read_seqretry(&xtime_lock, seq)); | 121 | } while (read_seqretry(&xtime_lock, seq)); |
115 | 122 | ||
116 | timespec_add_ns(ts, nsecs); | 123 | timespec_add_ns(ts, nsecs); |
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 7bd6a9893c24..39af8af6fc30 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c | |||
@@ -669,12 +669,12 @@ static void blk_add_trace_rq(struct request_queue *q, struct request *rq, | |||
669 | 669 | ||
670 | if (blk_pc_request(rq)) { | 670 | if (blk_pc_request(rq)) { |
671 | what |= BLK_TC_ACT(BLK_TC_PC); | 671 | what |= BLK_TC_ACT(BLK_TC_PC); |
672 | __blk_add_trace(bt, 0, rq->data_len, rw, what, rq->errors, | 672 | __blk_add_trace(bt, 0, blk_rq_bytes(rq), rw, |
673 | rq->cmd_len, rq->cmd); | 673 | what, rq->errors, rq->cmd_len, rq->cmd); |
674 | } else { | 674 | } else { |
675 | what |= BLK_TC_ACT(BLK_TC_FS); | 675 | what |= BLK_TC_ACT(BLK_TC_FS); |
676 | __blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9, | 676 | __blk_add_trace(bt, blk_rq_pos(rq), blk_rq_bytes(rq), rw, |
677 | rw, what, rq->errors, 0, NULL); | 677 | what, rq->errors, 0, NULL); |
678 | } | 678 | } |
679 | } | 679 | } |
680 | 680 | ||
@@ -881,11 +881,11 @@ void blk_add_driver_data(struct request_queue *q, | |||
881 | return; | 881 | return; |
882 | 882 | ||
883 | if (blk_pc_request(rq)) | 883 | if (blk_pc_request(rq)) |
884 | __blk_add_trace(bt, 0, rq->data_len, 0, BLK_TA_DRV_DATA, | 884 | __blk_add_trace(bt, 0, blk_rq_bytes(rq), 0, |
885 | rq->errors, len, data); | 885 | BLK_TA_DRV_DATA, rq->errors, len, data); |
886 | else | 886 | else |
887 | __blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9, | 887 | __blk_add_trace(bt, blk_rq_pos(rq), blk_rq_bytes(rq), 0, |
888 | 0, BLK_TA_DRV_DATA, rq->errors, len, data); | 888 | BLK_TA_DRV_DATA, rq->errors, len, data); |
889 | } | 889 | } |
890 | EXPORT_SYMBOL_GPL(blk_add_driver_data); | 890 | EXPORT_SYMBOL_GPL(blk_add_driver_data); |
891 | 891 | ||
@@ -1724,10 +1724,7 @@ void blk_fill_rwbs_rq(char *rwbs, struct request *rq) | |||
1724 | if (blk_discard_rq(rq)) | 1724 | if (blk_discard_rq(rq)) |
1725 | rw |= (1 << BIO_RW_DISCARD); | 1725 | rw |= (1 << BIO_RW_DISCARD); |
1726 | 1726 | ||
1727 | if (blk_pc_request(rq)) | 1727 | bytes = blk_rq_bytes(rq); |
1728 | bytes = rq->data_len; | ||
1729 | else | ||
1730 | bytes = rq->hard_nr_sectors << 9; | ||
1731 | 1728 | ||
1732 | blk_fill_rwbs(rwbs, rw, bytes); | 1729 | blk_fill_rwbs(rwbs, rw, bytes); |
1733 | } | 1730 | } |