diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/cgroup.h | 1 | ||||
-rw-r--r-- | include/linux/dmaengine.h | 12 | ||||
-rw-r--r-- | include/linux/hugetlb.h | 11 | ||||
-rw-r--r-- | include/linux/init_task.h | 11 | ||||
-rw-r--r-- | include/linux/mm.h | 3 | ||||
-rw-r--r-- | include/linux/sched.h | 64 | ||||
-rw-r--r-- | include/linux/syscalls.h | 28 |
7 files changed, 73 insertions, 57 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index e4e8e117d27d..499900d0cee7 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -378,6 +378,7 @@ struct cgroup_subsys { | |||
378 | * - initiating hotplug events | 378 | * - initiating hotplug events |
379 | */ | 379 | */ |
380 | struct mutex hierarchy_mutex; | 380 | struct mutex hierarchy_mutex; |
381 | struct lock_class_key subsys_key; | ||
381 | 382 | ||
382 | /* | 383 | /* |
383 | * Link to parent, and list entry in parent's children. | 384 | * Link to parent, and list entry in parent's children. |
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 3e0f64c335c8..3e68469c1885 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -282,6 +282,18 @@ static inline void dmaengine_put(void) | |||
282 | } | 282 | } |
283 | #endif | 283 | #endif |
284 | 284 | ||
285 | #ifdef CONFIG_NET_DMA | ||
286 | #define net_dmaengine_get() dmaengine_get() | ||
287 | #define net_dmaengine_put() dmaengine_put() | ||
288 | #else | ||
289 | static inline void net_dmaengine_get(void) | ||
290 | { | ||
291 | } | ||
292 | static inline void net_dmaengine_put(void) | ||
293 | { | ||
294 | } | ||
295 | #endif | ||
296 | |||
285 | dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan, | 297 | dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan, |
286 | void *dest, void *src, size_t len); | 298 | void *dest, void *src, size_t len); |
287 | dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan, | 299 | dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan, |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index f1d2fba19ea0..03be7f29ca01 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -33,7 +33,8 @@ unsigned long hugetlb_total_pages(void); | |||
33 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, | 33 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, |
34 | unsigned long address, int write_access); | 34 | unsigned long address, int write_access); |
35 | int hugetlb_reserve_pages(struct inode *inode, long from, long to, | 35 | int hugetlb_reserve_pages(struct inode *inode, long from, long to, |
36 | struct vm_area_struct *vma); | 36 | struct vm_area_struct *vma, |
37 | int acctflags); | ||
37 | void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); | 38 | void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); |
38 | 39 | ||
39 | extern unsigned long hugepages_treat_as_movable; | 40 | extern unsigned long hugepages_treat_as_movable; |
@@ -138,7 +139,7 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb) | |||
138 | 139 | ||
139 | extern const struct file_operations hugetlbfs_file_operations; | 140 | extern const struct file_operations hugetlbfs_file_operations; |
140 | extern struct vm_operations_struct hugetlb_vm_ops; | 141 | extern struct vm_operations_struct hugetlb_vm_ops; |
141 | struct file *hugetlb_file_setup(const char *name, size_t); | 142 | struct file *hugetlb_file_setup(const char *name, size_t, int); |
142 | int hugetlb_get_quota(struct address_space *mapping, long delta); | 143 | int hugetlb_get_quota(struct address_space *mapping, long delta); |
143 | void hugetlb_put_quota(struct address_space *mapping, long delta); | 144 | void hugetlb_put_quota(struct address_space *mapping, long delta); |
144 | 145 | ||
@@ -158,9 +159,9 @@ static inline void set_file_hugepages(struct file *file) | |||
158 | } | 159 | } |
159 | #else /* !CONFIG_HUGETLBFS */ | 160 | #else /* !CONFIG_HUGETLBFS */ |
160 | 161 | ||
161 | #define is_file_hugepages(file) 0 | 162 | #define is_file_hugepages(file) 0 |
162 | #define set_file_hugepages(file) BUG() | 163 | #define set_file_hugepages(file) BUG() |
163 | #define hugetlb_file_setup(name,size) ERR_PTR(-ENOSYS) | 164 | #define hugetlb_file_setup(name,size,acctflag) ERR_PTR(-ENOSYS) |
164 | 165 | ||
165 | #endif /* !CONFIG_HUGETLBFS */ | 166 | #endif /* !CONFIG_HUGETLBFS */ |
166 | 167 | ||
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index ea0ea1a4c36f..e752d973fa21 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -48,12 +48,11 @@ extern struct fs_struct init_fs; | |||
48 | .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \ | 48 | .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \ |
49 | .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \ | 49 | .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \ |
50 | .rlim = INIT_RLIMITS, \ | 50 | .rlim = INIT_RLIMITS, \ |
51 | .cputime = { .totals = { \ | 51 | .cputimer = { \ |
52 | .utime = cputime_zero, \ | 52 | .cputime = INIT_CPUTIME, \ |
53 | .stime = cputime_zero, \ | 53 | .running = 0, \ |
54 | .sum_exec_runtime = 0, \ | 54 | .lock = __SPIN_LOCK_UNLOCKED(sig.cputimer.lock), \ |
55 | .lock = __SPIN_LOCK_UNLOCKED(sig.cputime.totals.lock), \ | 55 | }, \ |
56 | }, }, \ | ||
57 | } | 56 | } |
58 | 57 | ||
59 | extern struct nsproxy init_nsproxy; | 58 | extern struct nsproxy init_nsproxy; |
diff --git a/include/linux/mm.h b/include/linux/mm.h index e8ddc98b8405..323561582c10 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1129,8 +1129,7 @@ extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, | |||
1129 | unsigned long flag, unsigned long pgoff); | 1129 | unsigned long flag, unsigned long pgoff); |
1130 | extern unsigned long mmap_region(struct file *file, unsigned long addr, | 1130 | extern unsigned long mmap_region(struct file *file, unsigned long addr, |
1131 | unsigned long len, unsigned long flags, | 1131 | unsigned long len, unsigned long flags, |
1132 | unsigned int vm_flags, unsigned long pgoff, | 1132 | unsigned int vm_flags, unsigned long pgoff); |
1133 | int accountable); | ||
1134 | 1133 | ||
1135 | static inline unsigned long do_mmap(struct file *file, unsigned long addr, | 1134 | static inline unsigned long do_mmap(struct file *file, unsigned long addr, |
1136 | unsigned long len, unsigned long prot, | 1135 | unsigned long len, unsigned long prot, |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 699edb8e1853..426666dd8203 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -445,7 +445,6 @@ struct pacct_struct { | |||
445 | * @utime: time spent in user mode, in &cputime_t units | 445 | * @utime: time spent in user mode, in &cputime_t units |
446 | * @stime: time spent in kernel mode, in &cputime_t units | 446 | * @stime: time spent in kernel mode, in &cputime_t units |
447 | * @sum_exec_runtime: total time spent on the CPU, in nanoseconds | 447 | * @sum_exec_runtime: total time spent on the CPU, in nanoseconds |
448 | * @lock: lock for fields in this struct | ||
449 | * | 448 | * |
450 | * This structure groups together three kinds of CPU time that are | 449 | * This structure groups together three kinds of CPU time that are |
451 | * tracked for threads and thread groups. Most things considering | 450 | * tracked for threads and thread groups. Most things considering |
@@ -456,23 +455,33 @@ struct task_cputime { | |||
456 | cputime_t utime; | 455 | cputime_t utime; |
457 | cputime_t stime; | 456 | cputime_t stime; |
458 | unsigned long long sum_exec_runtime; | 457 | unsigned long long sum_exec_runtime; |
459 | spinlock_t lock; | ||
460 | }; | 458 | }; |
461 | /* Alternate field names when used to cache expirations. */ | 459 | /* Alternate field names when used to cache expirations. */ |
462 | #define prof_exp stime | 460 | #define prof_exp stime |
463 | #define virt_exp utime | 461 | #define virt_exp utime |
464 | #define sched_exp sum_exec_runtime | 462 | #define sched_exp sum_exec_runtime |
465 | 463 | ||
464 | #define INIT_CPUTIME \ | ||
465 | (struct task_cputime) { \ | ||
466 | .utime = cputime_zero, \ | ||
467 | .stime = cputime_zero, \ | ||
468 | .sum_exec_runtime = 0, \ | ||
469 | } | ||
470 | |||
466 | /** | 471 | /** |
467 | * struct thread_group_cputime - thread group interval timer counts | 472 | * struct thread_group_cputimer - thread group interval timer counts |
468 | * @totals: thread group interval timers; substructure for | 473 | * @cputime: thread group interval timers. |
469 | * uniprocessor kernel, per-cpu for SMP kernel. | 474 | * @running: non-zero when there are timers running and |
475 | * @cputime receives updates. | ||
476 | * @lock: lock for fields in this struct. | ||
470 | * | 477 | * |
471 | * This structure contains the version of task_cputime, above, that is | 478 | * This structure contains the version of task_cputime, above, that is |
472 | * used for thread group CPU clock calculations. | 479 | * used for thread group CPU timer calculations. |
473 | */ | 480 | */ |
474 | struct thread_group_cputime { | 481 | struct thread_group_cputimer { |
475 | struct task_cputime totals; | 482 | struct task_cputime cputime; |
483 | int running; | ||
484 | spinlock_t lock; | ||
476 | }; | 485 | }; |
477 | 486 | ||
478 | /* | 487 | /* |
@@ -521,10 +530,10 @@ struct signal_struct { | |||
521 | cputime_t it_prof_incr, it_virt_incr; | 530 | cputime_t it_prof_incr, it_virt_incr; |
522 | 531 | ||
523 | /* | 532 | /* |
524 | * Thread group totals for process CPU clocks. | 533 | * Thread group totals for process CPU timers. |
525 | * See thread_group_cputime(), et al, for details. | 534 | * See thread_group_cputimer(), et al, for details. |
526 | */ | 535 | */ |
527 | struct thread_group_cputime cputime; | 536 | struct thread_group_cputimer cputimer; |
528 | 537 | ||
529 | /* Earliest-expiration cache. */ | 538 | /* Earliest-expiration cache. */ |
530 | struct task_cputime cputime_expires; | 539 | struct task_cputime cputime_expires; |
@@ -561,7 +570,7 @@ struct signal_struct { | |||
561 | * Live threads maintain their own counters and add to these | 570 | * Live threads maintain their own counters and add to these |
562 | * in __exit_signal, except for the group leader. | 571 | * in __exit_signal, except for the group leader. |
563 | */ | 572 | */ |
564 | cputime_t cutime, cstime; | 573 | cputime_t utime, stime, cutime, cstime; |
565 | cputime_t gtime; | 574 | cputime_t gtime; |
566 | cputime_t cgtime; | 575 | cputime_t cgtime; |
567 | unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; | 576 | unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; |
@@ -570,6 +579,14 @@ struct signal_struct { | |||
570 | struct task_io_accounting ioac; | 579 | struct task_io_accounting ioac; |
571 | 580 | ||
572 | /* | 581 | /* |
582 | * Cumulative ns of schedule CPU time fo dead threads in the | ||
583 | * group, not including a zombie group leader, (This only differs | ||
584 | * from jiffies_to_ns(utime + stime) if sched_clock uses something | ||
585 | * other than jiffies.) | ||
586 | */ | ||
587 | unsigned long long sum_sched_runtime; | ||
588 | |||
589 | /* | ||
573 | * We don't bother to synchronize most readers of this at all, | 590 | * We don't bother to synchronize most readers of this at all, |
574 | * because there is no reader checking a limit that actually needs | 591 | * because there is no reader checking a limit that actually needs |
575 | * to get both rlim_cur and rlim_max atomically, and either one | 592 | * to get both rlim_cur and rlim_max atomically, and either one |
@@ -2185,27 +2202,14 @@ static inline int spin_needbreak(spinlock_t *lock) | |||
2185 | /* | 2202 | /* |
2186 | * Thread group CPU time accounting. | 2203 | * Thread group CPU time accounting. |
2187 | */ | 2204 | */ |
2188 | 2205 | void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times); | |
2189 | static inline | 2206 | void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times); |
2190 | void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times) | ||
2191 | { | ||
2192 | struct task_cputime *totals = &tsk->signal->cputime.totals; | ||
2193 | unsigned long flags; | ||
2194 | |||
2195 | spin_lock_irqsave(&totals->lock, flags); | ||
2196 | *times = *totals; | ||
2197 | spin_unlock_irqrestore(&totals->lock, flags); | ||
2198 | } | ||
2199 | 2207 | ||
2200 | static inline void thread_group_cputime_init(struct signal_struct *sig) | 2208 | static inline void thread_group_cputime_init(struct signal_struct *sig) |
2201 | { | 2209 | { |
2202 | sig->cputime.totals = (struct task_cputime){ | 2210 | sig->cputimer.cputime = INIT_CPUTIME; |
2203 | .utime = cputime_zero, | 2211 | spin_lock_init(&sig->cputimer.lock); |
2204 | .stime = cputime_zero, | 2212 | sig->cputimer.running = 0; |
2205 | .sum_exec_runtime = 0, | ||
2206 | }; | ||
2207 | |||
2208 | spin_lock_init(&sig->cputime.totals.lock); | ||
2209 | } | 2213 | } |
2210 | 2214 | ||
2211 | static inline void thread_group_cputime_free(struct signal_struct *sig) | 2215 | static inline void thread_group_cputime_free(struct signal_struct *sig) |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 0eda02ff2414..f9f900cfd066 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -95,13 +95,13 @@ struct old_linux_dirent; | |||
95 | #define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__) | 95 | #define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__) |
96 | #define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) | 96 | #define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) |
97 | 97 | ||
98 | #define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void) | 98 | #define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void) |
99 | #define SYSCALL_DEFINE1(...) SYSCALL_DEFINEx(1, __VA_ARGS__) | 99 | #define SYSCALL_DEFINE1(name, ...) SYSCALL_DEFINEx(1, _##name, __VA_ARGS__) |
100 | #define SYSCALL_DEFINE2(...) SYSCALL_DEFINEx(2, __VA_ARGS__) | 100 | #define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__) |
101 | #define SYSCALL_DEFINE3(...) SYSCALL_DEFINEx(3, __VA_ARGS__) | 101 | #define SYSCALL_DEFINE3(name, ...) SYSCALL_DEFINEx(3, _##name, __VA_ARGS__) |
102 | #define SYSCALL_DEFINE4(...) SYSCALL_DEFINEx(4, __VA_ARGS__) | 102 | #define SYSCALL_DEFINE4(name, ...) SYSCALL_DEFINEx(4, _##name, __VA_ARGS__) |
103 | #define SYSCALL_DEFINE5(...) SYSCALL_DEFINEx(5, __VA_ARGS__) | 103 | #define SYSCALL_DEFINE5(name, ...) SYSCALL_DEFINEx(5, _##name, __VA_ARGS__) |
104 | #define SYSCALL_DEFINE6(...) SYSCALL_DEFINEx(6, __VA_ARGS__) | 104 | #define SYSCALL_DEFINE6(name, ...) SYSCALL_DEFINEx(6, _##name, __VA_ARGS__) |
105 | 105 | ||
106 | #ifdef CONFIG_PPC64 | 106 | #ifdef CONFIG_PPC64 |
107 | #define SYSCALL_ALIAS(alias, name) \ | 107 | #define SYSCALL_ALIAS(alias, name) \ |
@@ -121,21 +121,21 @@ struct old_linux_dirent; | |||
121 | 121 | ||
122 | #define SYSCALL_DEFINE(name) static inline long SYSC_##name | 122 | #define SYSCALL_DEFINE(name) static inline long SYSC_##name |
123 | #define SYSCALL_DEFINEx(x, name, ...) \ | 123 | #define SYSCALL_DEFINEx(x, name, ...) \ |
124 | asmlinkage long sys_##name(__SC_DECL##x(__VA_ARGS__)); \ | 124 | asmlinkage long sys##name(__SC_DECL##x(__VA_ARGS__)); \ |
125 | static inline long SYSC_##name(__SC_DECL##x(__VA_ARGS__)); \ | 125 | static inline long SYSC##name(__SC_DECL##x(__VA_ARGS__)); \ |
126 | asmlinkage long SyS_##name(__SC_LONG##x(__VA_ARGS__)) \ | 126 | asmlinkage long SyS##name(__SC_LONG##x(__VA_ARGS__)) \ |
127 | { \ | 127 | { \ |
128 | __SC_TEST##x(__VA_ARGS__); \ | 128 | __SC_TEST##x(__VA_ARGS__); \ |
129 | return (long) SYSC_##name(__SC_CAST##x(__VA_ARGS__)); \ | 129 | return (long) SYSC##name(__SC_CAST##x(__VA_ARGS__)); \ |
130 | } \ | 130 | } \ |
131 | SYSCALL_ALIAS(sys_##name, SyS_##name); \ | 131 | SYSCALL_ALIAS(sys##name, SyS##name); \ |
132 | static inline long SYSC_##name(__SC_DECL##x(__VA_ARGS__)) | 132 | static inline long SYSC##name(__SC_DECL##x(__VA_ARGS__)) |
133 | 133 | ||
134 | #else /* CONFIG_HAVE_SYSCALL_WRAPPERS */ | 134 | #else /* CONFIG_HAVE_SYSCALL_WRAPPERS */ |
135 | 135 | ||
136 | #define SYSCALL_DEFINE(name) asmlinkage long sys_##name | 136 | #define SYSCALL_DEFINE(name) asmlinkage long sys_##name |
137 | #define SYSCALL_DEFINEx(x, name, ...) \ | 137 | #define SYSCALL_DEFINEx(x, name, ...) \ |
138 | asmlinkage long sys_##name(__SC_DECL##x(__VA_ARGS__)) | 138 | asmlinkage long sys##name(__SC_DECL##x(__VA_ARGS__)) |
139 | 139 | ||
140 | #endif /* CONFIG_HAVE_SYSCALL_WRAPPERS */ | 140 | #endif /* CONFIG_HAVE_SYSCALL_WRAPPERS */ |
141 | 141 | ||