aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/cgroup.h1
-rw-r--r--include/linux/crypto.h7
-rw-r--r--include/linux/dmaengine.h12
-rw-r--r--include/linux/hugetlb.h11
-rw-r--r--include/linux/init_task.h11
-rw-r--r--include/linux/mm.h3
-rw-r--r--include/linux/sched.h64
-rw-r--r--include/linux/spinlock.h5
-rw-r--r--include/linux/syscalls.h28
9 files changed, 84 insertions, 58 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/crypto.h b/include/linux/crypto.h
index 3bacd71509fb..1f2e9020acc6 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -552,7 +552,12 @@ struct crypto_tfm *crypto_alloc_tfm(const char *alg_name,
552 const struct crypto_type *frontend, 552 const struct crypto_type *frontend,
553 u32 type, u32 mask); 553 u32 type, u32 mask);
554struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask); 554struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask);
555void crypto_free_tfm(struct crypto_tfm *tfm); 555void crypto_destroy_tfm(void *mem, struct crypto_tfm *tfm);
556
557static inline void crypto_free_tfm(struct crypto_tfm *tfm)
558{
559 return crypto_destroy_tfm(tfm, tfm);
560}
556 561
557int alg_test(const char *driver, const char *alg, u32 type, u32 mask); 562int alg_test(const char *driver, const char *alg, u32 type, u32 mask);
558 563
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
289static inline void net_dmaengine_get(void)
290{
291}
292static inline void net_dmaengine_put(void)
293{
294}
295#endif
296
285dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan, 297dma_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);
287dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan, 299dma_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);
33int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, 33int 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);
35int hugetlb_reserve_pages(struct inode *inode, long from, long to, 35int 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);
37void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); 38void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed);
38 39
39extern unsigned long hugepages_treat_as_movable; 40extern unsigned long hugepages_treat_as_movable;
@@ -138,7 +139,7 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
138 139
139extern const struct file_operations hugetlbfs_file_operations; 140extern const struct file_operations hugetlbfs_file_operations;
140extern struct vm_operations_struct hugetlb_vm_ops; 141extern struct vm_operations_struct hugetlb_vm_ops;
141struct file *hugetlb_file_setup(const char *name, size_t); 142struct file *hugetlb_file_setup(const char *name, size_t, int);
142int hugetlb_get_quota(struct address_space *mapping, long delta); 143int hugetlb_get_quota(struct address_space *mapping, long delta);
143void hugetlb_put_quota(struct address_space *mapping, long delta); 144void 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
59extern struct nsproxy init_nsproxy; 58extern 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);
1130extern unsigned long mmap_region(struct file *file, unsigned long addr, 1130extern 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
1135static inline unsigned long do_mmap(struct file *file, unsigned long addr, 1134static 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 2127e959e0f4..8981e52c714f 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -443,7 +443,6 @@ struct pacct_struct {
443 * @utime: time spent in user mode, in &cputime_t units 443 * @utime: time spent in user mode, in &cputime_t units
444 * @stime: time spent in kernel mode, in &cputime_t units 444 * @stime: time spent in kernel mode, in &cputime_t units
445 * @sum_exec_runtime: total time spent on the CPU, in nanoseconds 445 * @sum_exec_runtime: total time spent on the CPU, in nanoseconds
446 * @lock: lock for fields in this struct
447 * 446 *
448 * This structure groups together three kinds of CPU time that are 447 * This structure groups together three kinds of CPU time that are
449 * tracked for threads and thread groups. Most things considering 448 * tracked for threads and thread groups. Most things considering
@@ -454,23 +453,33 @@ struct task_cputime {
454 cputime_t utime; 453 cputime_t utime;
455 cputime_t stime; 454 cputime_t stime;
456 unsigned long long sum_exec_runtime; 455 unsigned long long sum_exec_runtime;
457 spinlock_t lock;
458}; 456};
459/* Alternate field names when used to cache expirations. */ 457/* Alternate field names when used to cache expirations. */
460#define prof_exp stime 458#define prof_exp stime
461#define virt_exp utime 459#define virt_exp utime
462#define sched_exp sum_exec_runtime 460#define sched_exp sum_exec_runtime
463 461
462#define INIT_CPUTIME \
463 (struct task_cputime) { \
464 .utime = cputime_zero, \
465 .stime = cputime_zero, \
466 .sum_exec_runtime = 0, \
467 }
468
464/** 469/**
465 * struct thread_group_cputime - thread group interval timer counts 470 * struct thread_group_cputimer - thread group interval timer counts
466 * @totals: thread group interval timers; substructure for 471 * @cputime: thread group interval timers.
467 * uniprocessor kernel, per-cpu for SMP kernel. 472 * @running: non-zero when there are timers running and
473 * @cputime receives updates.
474 * @lock: lock for fields in this struct.
468 * 475 *
469 * This structure contains the version of task_cputime, above, that is 476 * This structure contains the version of task_cputime, above, that is
470 * used for thread group CPU clock calculations. 477 * used for thread group CPU timer calculations.
471 */ 478 */
472struct thread_group_cputime { 479struct thread_group_cputimer {
473 struct task_cputime totals; 480 struct task_cputime cputime;
481 int running;
482 spinlock_t lock;
474}; 483};
475 484
476/* 485/*
@@ -519,10 +528,10 @@ struct signal_struct {
519 cputime_t it_prof_incr, it_virt_incr; 528 cputime_t it_prof_incr, it_virt_incr;
520 529
521 /* 530 /*
522 * Thread group totals for process CPU clocks. 531 * Thread group totals for process CPU timers.
523 * See thread_group_cputime(), et al, for details. 532 * See thread_group_cputimer(), et al, for details.
524 */ 533 */
525 struct thread_group_cputime cputime; 534 struct thread_group_cputimer cputimer;
526 535
527 /* Earliest-expiration cache. */ 536 /* Earliest-expiration cache. */
528 struct task_cputime cputime_expires; 537 struct task_cputime cputime_expires;
@@ -559,7 +568,7 @@ struct signal_struct {
559 * Live threads maintain their own counters and add to these 568 * Live threads maintain their own counters and add to these
560 * in __exit_signal, except for the group leader. 569 * in __exit_signal, except for the group leader.
561 */ 570 */
562 cputime_t cutime, cstime; 571 cputime_t utime, stime, cutime, cstime;
563 cputime_t gtime; 572 cputime_t gtime;
564 cputime_t cgtime; 573 cputime_t cgtime;
565 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; 574 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw;
@@ -568,6 +577,14 @@ struct signal_struct {
568 struct task_io_accounting ioac; 577 struct task_io_accounting ioac;
569 578
570 /* 579 /*
580 * Cumulative ns of schedule CPU time fo dead threads in the
581 * group, not including a zombie group leader, (This only differs
582 * from jiffies_to_ns(utime + stime) if sched_clock uses something
583 * other than jiffies.)
584 */
585 unsigned long long sum_sched_runtime;
586
587 /*
571 * We don't bother to synchronize most readers of this at all, 588 * We don't bother to synchronize most readers of this at all,
572 * because there is no reader checking a limit that actually needs 589 * because there is no reader checking a limit that actually needs
573 * to get both rlim_cur and rlim_max atomically, and either one 590 * to get both rlim_cur and rlim_max atomically, and either one
@@ -2183,27 +2200,14 @@ static inline int spin_needbreak(spinlock_t *lock)
2183/* 2200/*
2184 * Thread group CPU time accounting. 2201 * Thread group CPU time accounting.
2185 */ 2202 */
2186 2203void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times);
2187static inline 2204void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times);
2188void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times)
2189{
2190 struct task_cputime *totals = &tsk->signal->cputime.totals;
2191 unsigned long flags;
2192
2193 spin_lock_irqsave(&totals->lock, flags);
2194 *times = *totals;
2195 spin_unlock_irqrestore(&totals->lock, flags);
2196}
2197 2205
2198static inline void thread_group_cputime_init(struct signal_struct *sig) 2206static inline void thread_group_cputime_init(struct signal_struct *sig)
2199{ 2207{
2200 sig->cputime.totals = (struct task_cputime){ 2208 sig->cputimer.cputime = INIT_CPUTIME;
2201 .utime = cputime_zero, 2209 spin_lock_init(&sig->cputimer.lock);
2202 .stime = cputime_zero, 2210 sig->cputimer.running = 0;
2203 .sum_exec_runtime = 0,
2204 };
2205
2206 spin_lock_init(&sig->cputime.totals.lock);
2207} 2211}
2208 2212
2209static inline void thread_group_cputime_free(struct signal_struct *sig) 2213static inline void thread_group_cputime_free(struct signal_struct *sig)
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index e0c0fccced46..a0c66a2e00ad 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -124,7 +124,12 @@ do { \
124#ifdef CONFIG_GENERIC_LOCKBREAK 124#ifdef CONFIG_GENERIC_LOCKBREAK
125#define spin_is_contended(lock) ((lock)->break_lock) 125#define spin_is_contended(lock) ((lock)->break_lock)
126#else 126#else
127
128#ifdef __raw_spin_is_contended
127#define spin_is_contended(lock) __raw_spin_is_contended(&(lock)->raw_lock) 129#define spin_is_contended(lock) __raw_spin_is_contended(&(lock)->raw_lock)
130#else
131#define spin_is_contended(lock) (((void)(lock), 0))
132#endif /*__raw_spin_is_contended*/
128#endif 133#endif
129 134
130/** 135/**
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