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 dc4ef0023d88..2ee96942a9d6 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 7200c1bb8dde..726d27044778 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -446,7 +446,6 @@ struct pacct_struct {
446 * @utime: time spent in user mode, in &cputime_t units 446 * @utime: time spent in user mode, in &cputime_t units
447 * @stime: time spent in kernel mode, in &cputime_t units 447 * @stime: time spent in kernel mode, in &cputime_t units
448 * @sum_exec_runtime: total time spent on the CPU, in nanoseconds 448 * @sum_exec_runtime: total time spent on the CPU, in nanoseconds
449 * @lock: lock for fields in this struct
450 * 449 *
451 * This structure groups together three kinds of CPU time that are 450 * This structure groups together three kinds of CPU time that are
452 * tracked for threads and thread groups. Most things considering 451 * tracked for threads and thread groups. Most things considering
@@ -457,23 +456,33 @@ struct task_cputime {
457 cputime_t utime; 456 cputime_t utime;
458 cputime_t stime; 457 cputime_t stime;
459 unsigned long long sum_exec_runtime; 458 unsigned long long sum_exec_runtime;
460 spinlock_t lock;
461}; 459};
462/* Alternate field names when used to cache expirations. */ 460/* Alternate field names when used to cache expirations. */
463#define prof_exp stime 461#define prof_exp stime
464#define virt_exp utime 462#define virt_exp utime
465#define sched_exp sum_exec_runtime 463#define sched_exp sum_exec_runtime
466 464
465#define INIT_CPUTIME \
466 (struct task_cputime) { \
467 .utime = cputime_zero, \
468 .stime = cputime_zero, \
469 .sum_exec_runtime = 0, \
470 }
471
467/** 472/**
468 * struct thread_group_cputime - thread group interval timer counts 473 * struct thread_group_cputimer - thread group interval timer counts
469 * @totals: thread group interval timers; substructure for 474 * @cputime: thread group interval timers.
470 * uniprocessor kernel, per-cpu for SMP kernel. 475 * @running: non-zero when there are timers running and
476 * @cputime receives updates.
477 * @lock: lock for fields in this struct.
471 * 478 *
472 * This structure contains the version of task_cputime, above, that is 479 * This structure contains the version of task_cputime, above, that is
473 * used for thread group CPU clock calculations. 480 * used for thread group CPU timer calculations.
474 */ 481 */
475struct thread_group_cputime { 482struct thread_group_cputimer {
476 struct task_cputime totals; 483 struct task_cputime cputime;
484 int running;
485 spinlock_t lock;
477}; 486};
478 487
479/* 488/*
@@ -522,10 +531,10 @@ struct signal_struct {
522 cputime_t it_prof_incr, it_virt_incr; 531 cputime_t it_prof_incr, it_virt_incr;
523 532
524 /* 533 /*
525 * Thread group totals for process CPU clocks. 534 * Thread group totals for process CPU timers.
526 * See thread_group_cputime(), et al, for details. 535 * See thread_group_cputimer(), et al, for details.
527 */ 536 */
528 struct thread_group_cputime cputime; 537 struct thread_group_cputimer cputimer;
529 538
530 /* Earliest-expiration cache. */ 539 /* Earliest-expiration cache. */
531 struct task_cputime cputime_expires; 540 struct task_cputime cputime_expires;
@@ -562,7 +571,7 @@ struct signal_struct {
562 * Live threads maintain their own counters and add to these 571 * Live threads maintain their own counters and add to these
563 * in __exit_signal, except for the group leader. 572 * in __exit_signal, except for the group leader.
564 */ 573 */
565 cputime_t cutime, cstime; 574 cputime_t utime, stime, cutime, cstime;
566 cputime_t gtime; 575 cputime_t gtime;
567 cputime_t cgtime; 576 cputime_t cgtime;
568 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; 577 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw;
@@ -571,6 +580,14 @@ struct signal_struct {
571 struct task_io_accounting ioac; 580 struct task_io_accounting ioac;
572 581
573 /* 582 /*
583 * Cumulative ns of schedule CPU time fo dead threads in the
584 * group, not including a zombie group leader, (This only differs
585 * from jiffies_to_ns(utime + stime) if sched_clock uses something
586 * other than jiffies.)
587 */
588 unsigned long long sum_sched_runtime;
589
590 /*
574 * We don't bother to synchronize most readers of this at all, 591 * We don't bother to synchronize most readers of this at all,
575 * because there is no reader checking a limit that actually needs 592 * because there is no reader checking a limit that actually needs
576 * to get both rlim_cur and rlim_max atomically, and either one 593 * to get both rlim_cur and rlim_max atomically, and either one
@@ -2200,27 +2217,14 @@ static inline int spin_needbreak(spinlock_t *lock)
2200/* 2217/*
2201 * Thread group CPU time accounting. 2218 * Thread group CPU time accounting.
2202 */ 2219 */
2203 2220void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times);
2204static inline 2221void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times);
2205void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times)
2206{
2207 struct task_cputime *totals = &tsk->signal->cputime.totals;
2208 unsigned long flags;
2209
2210 spin_lock_irqsave(&totals->lock, flags);
2211 *times = *totals;
2212 spin_unlock_irqrestore(&totals->lock, flags);
2213}
2214 2222
2215static inline void thread_group_cputime_init(struct signal_struct *sig) 2223static inline void thread_group_cputime_init(struct signal_struct *sig)
2216{ 2224{
2217 sig->cputime.totals = (struct task_cputime){ 2225 sig->cputimer.cputime = INIT_CPUTIME;
2218 .utime = cputime_zero, 2226 spin_lock_init(&sig->cputimer.lock);
2219 .stime = cputime_zero, 2227 sig->cputimer.running = 0;
2220 .sum_exec_runtime = 0,
2221 };
2222
2223 spin_lock_init(&sig->cputime.totals.lock);
2224} 2228}
2225 2229
2226static inline void thread_group_cputime_free(struct signal_struct *sig) 2230static 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 ff957a115cc6..88255d3261a4 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -96,13 +96,13 @@ struct perf_counter_hw_event;
96#define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__) 96#define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__)
97#define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) 97#define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__)
98 98
99#define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void) 99#define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void)
100#define SYSCALL_DEFINE1(...) SYSCALL_DEFINEx(1, __VA_ARGS__) 100#define SYSCALL_DEFINE1(name, ...) SYSCALL_DEFINEx(1, _##name, __VA_ARGS__)
101#define SYSCALL_DEFINE2(...) SYSCALL_DEFINEx(2, __VA_ARGS__) 101#define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
102#define SYSCALL_DEFINE3(...) SYSCALL_DEFINEx(3, __VA_ARGS__) 102#define SYSCALL_DEFINE3(name, ...) SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
103#define SYSCALL_DEFINE4(...) SYSCALL_DEFINEx(4, __VA_ARGS__) 103#define SYSCALL_DEFINE4(name, ...) SYSCALL_DEFINEx(4, _##name, __VA_ARGS__)
104#define SYSCALL_DEFINE5(...) SYSCALL_DEFINEx(5, __VA_ARGS__) 104#define SYSCALL_DEFINE5(name, ...) SYSCALL_DEFINEx(5, _##name, __VA_ARGS__)
105#define SYSCALL_DEFINE6(...) SYSCALL_DEFINEx(6, __VA_ARGS__) 105#define SYSCALL_DEFINE6(name, ...) SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
106 106
107#ifdef CONFIG_PPC64 107#ifdef CONFIG_PPC64
108#define SYSCALL_ALIAS(alias, name) \ 108#define SYSCALL_ALIAS(alias, name) \
@@ -122,21 +122,21 @@ struct perf_counter_hw_event;
122 122
123#define SYSCALL_DEFINE(name) static inline long SYSC_##name 123#define SYSCALL_DEFINE(name) static inline long SYSC_##name
124#define SYSCALL_DEFINEx(x, name, ...) \ 124#define SYSCALL_DEFINEx(x, name, ...) \
125 asmlinkage long sys_##name(__SC_DECL##x(__VA_ARGS__)); \ 125 asmlinkage long sys##name(__SC_DECL##x(__VA_ARGS__)); \
126 static inline long SYSC_##name(__SC_DECL##x(__VA_ARGS__)); \ 126 static inline long SYSC##name(__SC_DECL##x(__VA_ARGS__)); \
127 asmlinkage long SyS_##name(__SC_LONG##x(__VA_ARGS__)) \ 127 asmlinkage long SyS##name(__SC_LONG##x(__VA_ARGS__)) \
128 { \ 128 { \
129 __SC_TEST##x(__VA_ARGS__); \ 129 __SC_TEST##x(__VA_ARGS__); \
130 return (long) SYSC_##name(__SC_CAST##x(__VA_ARGS__)); \ 130 return (long) SYSC##name(__SC_CAST##x(__VA_ARGS__)); \
131 } \ 131 } \
132 SYSCALL_ALIAS(sys_##name, SyS_##name); \ 132 SYSCALL_ALIAS(sys##name, SyS##name); \
133 static inline long SYSC_##name(__SC_DECL##x(__VA_ARGS__)) 133 static inline long SYSC##name(__SC_DECL##x(__VA_ARGS__))
134 134
135#else /* CONFIG_HAVE_SYSCALL_WRAPPERS */ 135#else /* CONFIG_HAVE_SYSCALL_WRAPPERS */
136 136
137#define SYSCALL_DEFINE(name) asmlinkage long sys_##name 137#define SYSCALL_DEFINE(name) asmlinkage long sys_##name
138#define SYSCALL_DEFINEx(x, name, ...) \ 138#define SYSCALL_DEFINEx(x, name, ...) \
139 asmlinkage long sys_##name(__SC_DECL##x(__VA_ARGS__)) 139 asmlinkage long sys##name(__SC_DECL##x(__VA_ARGS__))
140 140
141#endif /* CONFIG_HAVE_SYSCALL_WRAPPERS */ 141#endif /* CONFIG_HAVE_SYSCALL_WRAPPERS */
142 142