diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/compat.h | 2 | ||||
-rw-r--r-- | include/linux/init.h | 28 | ||||
-rw-r--r-- | include/linux/mmzone.h | 6 | ||||
-rw-r--r-- | include/linux/pagemap.h | 14 | ||||
-rw-r--r-- | include/linux/sched.h | 1 | ||||
-rw-r--r-- | include/linux/taskstats_kern.h | 31 | ||||
-rw-r--r-- | include/linux/vmalloc.h | 3 |
7 files changed, 43 insertions, 42 deletions
diff --git a/include/linux/compat.h b/include/linux/compat.h index f4ebf96f5308..f1553196826f 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -196,7 +196,7 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, | |||
196 | #define BITS_TO_COMPAT_LONGS(bits) \ | 196 | #define BITS_TO_COMPAT_LONGS(bits) \ |
197 | (((bits)+BITS_PER_COMPAT_LONG-1)/BITS_PER_COMPAT_LONG) | 197 | (((bits)+BITS_PER_COMPAT_LONG-1)/BITS_PER_COMPAT_LONG) |
198 | 198 | ||
199 | long compat_get_bitmap(unsigned long *mask, compat_ulong_t __user *umask, | 199 | long compat_get_bitmap(unsigned long *mask, const compat_ulong_t __user *umask, |
200 | unsigned long bitmap_size); | 200 | unsigned long bitmap_size); |
201 | long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask, | 201 | long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask, |
202 | unsigned long bitmap_size); | 202 | unsigned long bitmap_size); |
diff --git a/include/linux/init.h b/include/linux/init.h index e92b1455d7af..ff40ea118e3a 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -84,19 +84,29 @@ extern void setup_arch(char **); | |||
84 | * by link order. | 84 | * by link order. |
85 | * For backwards compatibility, initcall() puts the call in | 85 | * For backwards compatibility, initcall() puts the call in |
86 | * the device init subsection. | 86 | * the device init subsection. |
87 | * | ||
88 | * The `id' arg to __define_initcall() is needed so that multiple initcalls | ||
89 | * can point at the same handler without causing duplicate-symbol build errors. | ||
87 | */ | 90 | */ |
88 | 91 | ||
89 | #define __define_initcall(level,fn) \ | 92 | #define __define_initcall(level,fn,id) \ |
90 | static initcall_t __initcall_##fn __attribute_used__ \ | 93 | static initcall_t __initcall_##fn##id __attribute_used__ \ |
91 | __attribute__((__section__(".initcall" level ".init"))) = fn | 94 | __attribute__((__section__(".initcall" level ".init"))) = fn |
92 | 95 | ||
93 | #define core_initcall(fn) __define_initcall("1",fn) | 96 | #define core_initcall(fn) __define_initcall("1",fn,1) |
94 | #define postcore_initcall(fn) __define_initcall("2",fn) | 97 | #define core_initcall_sync(fn) __define_initcall("1s",fn,1s) |
95 | #define arch_initcall(fn) __define_initcall("3",fn) | 98 | #define postcore_initcall(fn) __define_initcall("2",fn,2) |
96 | #define subsys_initcall(fn) __define_initcall("4",fn) | 99 | #define postcore_initcall_sync(fn) __define_initcall("2s",fn,2s) |
97 | #define fs_initcall(fn) __define_initcall("5",fn) | 100 | #define arch_initcall(fn) __define_initcall("3",fn,3) |
98 | #define device_initcall(fn) __define_initcall("6",fn) | 101 | #define arch_initcall_sync(fn) __define_initcall("3s",fn,3s) |
99 | #define late_initcall(fn) __define_initcall("7",fn) | 102 | #define subsys_initcall(fn) __define_initcall("4",fn,4) |
103 | #define subsys_initcall_sync(fn) __define_initcall("4s",fn,4s) | ||
104 | #define fs_initcall(fn) __define_initcall("5",fn,5) | ||
105 | #define fs_initcall_sync(fn) __define_initcall("5s",fn,5s) | ||
106 | #define device_initcall(fn) __define_initcall("6",fn,6) | ||
107 | #define device_initcall_sync(fn) __define_initcall("6s",fn,6s) | ||
108 | #define late_initcall(fn) __define_initcall("7",fn,7) | ||
109 | #define late_initcall_sync(fn) __define_initcall("7s",fn,7s) | ||
100 | 110 | ||
101 | #define __initcall(fn) device_initcall(fn) | 111 | #define __initcall(fn) device_initcall(fn) |
102 | 112 | ||
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index ed0762b283a9..e06683e2bea3 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -218,13 +218,9 @@ struct zone { | |||
218 | * under - it drives the swappiness decision: whether to unmap mapped | 218 | * under - it drives the swappiness decision: whether to unmap mapped |
219 | * pages. | 219 | * pages. |
220 | * | 220 | * |
221 | * temp_priority is used to remember the scanning priority at which | 221 | * Access to both this field is quite racy even on uniprocessor. But |
222 | * this zone was successfully refilled to free_pages == pages_high. | ||
223 | * | ||
224 | * Access to both these fields is quite racy even on uniprocessor. But | ||
225 | * it is expected to average out OK. | 222 | * it is expected to average out OK. |
226 | */ | 223 | */ |
227 | int temp_priority; | ||
228 | int prev_priority; | 224 | int prev_priority; |
229 | 225 | ||
230 | 226 | ||
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 64f950925151..c3e255bf8594 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -52,19 +52,23 @@ static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask) | |||
52 | void release_pages(struct page **pages, int nr, int cold); | 52 | void release_pages(struct page **pages, int nr, int cold); |
53 | 53 | ||
54 | #ifdef CONFIG_NUMA | 54 | #ifdef CONFIG_NUMA |
55 | extern struct page *page_cache_alloc(struct address_space *x); | 55 | extern struct page *__page_cache_alloc(gfp_t gfp); |
56 | extern struct page *page_cache_alloc_cold(struct address_space *x); | ||
57 | #else | 56 | #else |
57 | static inline struct page *__page_cache_alloc(gfp_t gfp) | ||
58 | { | ||
59 | return alloc_pages(gfp, 0); | ||
60 | } | ||
61 | #endif | ||
62 | |||
58 | static inline struct page *page_cache_alloc(struct address_space *x) | 63 | static inline struct page *page_cache_alloc(struct address_space *x) |
59 | { | 64 | { |
60 | return alloc_pages(mapping_gfp_mask(x), 0); | 65 | return __page_cache_alloc(mapping_gfp_mask(x)); |
61 | } | 66 | } |
62 | 67 | ||
63 | static inline struct page *page_cache_alloc_cold(struct address_space *x) | 68 | static inline struct page *page_cache_alloc_cold(struct address_space *x) |
64 | { | 69 | { |
65 | return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD, 0); | 70 | return __page_cache_alloc(mapping_gfp_mask(x)|__GFP_COLD); |
66 | } | 71 | } |
67 | #endif | ||
68 | 72 | ||
69 | typedef int filler_t(void *, struct page *); | 73 | typedef int filler_t(void *, struct page *); |
70 | 74 | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 6735c1cf334c..eafe4a7b8237 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -466,7 +466,6 @@ struct signal_struct { | |||
466 | struct pacct_struct pacct; /* per-process accounting information */ | 466 | struct pacct_struct pacct; /* per-process accounting information */ |
467 | #endif | 467 | #endif |
468 | #ifdef CONFIG_TASKSTATS | 468 | #ifdef CONFIG_TASKSTATS |
469 | spinlock_t stats_lock; | ||
470 | struct taskstats *stats; | 469 | struct taskstats *stats; |
471 | #endif | 470 | #endif |
472 | }; | 471 | }; |
diff --git a/include/linux/taskstats_kern.h b/include/linux/taskstats_kern.h index 16894b7edcc8..6562a2050a25 100644 --- a/include/linux/taskstats_kern.h +++ b/include/linux/taskstats_kern.h | |||
@@ -23,25 +23,26 @@ static inline void taskstats_exit_free(struct taskstats *tidstats) | |||
23 | 23 | ||
24 | static inline void taskstats_tgid_init(struct signal_struct *sig) | 24 | static inline void taskstats_tgid_init(struct signal_struct *sig) |
25 | { | 25 | { |
26 | spin_lock_init(&sig->stats_lock); | ||
27 | sig->stats = NULL; | 26 | sig->stats = NULL; |
28 | } | 27 | } |
29 | 28 | ||
30 | static inline void taskstats_tgid_alloc(struct signal_struct *sig) | 29 | static inline void taskstats_tgid_alloc(struct task_struct *tsk) |
31 | { | 30 | { |
31 | struct signal_struct *sig = tsk->signal; | ||
32 | struct taskstats *stats; | 32 | struct taskstats *stats; |
33 | unsigned long flags; | ||
34 | 33 | ||
35 | stats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL); | 34 | if (sig->stats != NULL) |
36 | if (!stats) | ||
37 | return; | 35 | return; |
38 | 36 | ||
39 | spin_lock_irqsave(&sig->stats_lock, flags); | 37 | /* No problem if kmem_cache_zalloc() fails */ |
38 | stats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL); | ||
39 | |||
40 | spin_lock_irq(&tsk->sighand->siglock); | ||
40 | if (!sig->stats) { | 41 | if (!sig->stats) { |
41 | sig->stats = stats; | 42 | sig->stats = stats; |
42 | stats = NULL; | 43 | stats = NULL; |
43 | } | 44 | } |
44 | spin_unlock_irqrestore(&sig->stats_lock, flags); | 45 | spin_unlock_irq(&tsk->sighand->siglock); |
45 | 46 | ||
46 | if (stats) | 47 | if (stats) |
47 | kmem_cache_free(taskstats_cache, stats); | 48 | kmem_cache_free(taskstats_cache, stats); |
@@ -49,23 +50,13 @@ static inline void taskstats_tgid_alloc(struct signal_struct *sig) | |||
49 | 50 | ||
50 | static inline void taskstats_tgid_free(struct signal_struct *sig) | 51 | static inline void taskstats_tgid_free(struct signal_struct *sig) |
51 | { | 52 | { |
52 | struct taskstats *stats = NULL; | 53 | if (sig->stats) |
53 | unsigned long flags; | 54 | kmem_cache_free(taskstats_cache, sig->stats); |
54 | |||
55 | spin_lock_irqsave(&sig->stats_lock, flags); | ||
56 | if (sig->stats) { | ||
57 | stats = sig->stats; | ||
58 | sig->stats = NULL; | ||
59 | } | ||
60 | spin_unlock_irqrestore(&sig->stats_lock, flags); | ||
61 | if (stats) | ||
62 | kmem_cache_free(taskstats_cache, stats); | ||
63 | } | 55 | } |
64 | 56 | ||
65 | extern void taskstats_exit_alloc(struct taskstats **, unsigned int *); | 57 | extern void taskstats_exit_alloc(struct taskstats **, unsigned int *); |
66 | extern void taskstats_exit_send(struct task_struct *, struct taskstats *, int, unsigned int); | 58 | extern void taskstats_exit_send(struct task_struct *, struct taskstats *, int, unsigned int); |
67 | extern void taskstats_init_early(void); | 59 | extern void taskstats_init_early(void); |
68 | extern void taskstats_tgid_alloc(struct signal_struct *); | ||
69 | #else | 60 | #else |
70 | static inline void taskstats_exit_alloc(struct taskstats **ptidstats, unsigned int *mycpu) | 61 | static inline void taskstats_exit_alloc(struct taskstats **ptidstats, unsigned int *mycpu) |
71 | {} | 62 | {} |
@@ -77,7 +68,7 @@ static inline void taskstats_exit_send(struct task_struct *tsk, | |||
77 | {} | 68 | {} |
78 | static inline void taskstats_tgid_init(struct signal_struct *sig) | 69 | static inline void taskstats_tgid_init(struct signal_struct *sig) |
79 | {} | 70 | {} |
80 | static inline void taskstats_tgid_alloc(struct signal_struct *sig) | 71 | static inline void taskstats_tgid_alloc(struct task_struct *tsk) |
81 | {} | 72 | {} |
82 | static inline void taskstats_tgid_free(struct signal_struct *sig) | 73 | static inline void taskstats_tgid_free(struct signal_struct *sig) |
83 | {} | 74 | {} |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index ce5f1482e6be..dc9a29d84abc 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -60,7 +60,8 @@ extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags); | |||
60 | extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, | 60 | extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, |
61 | unsigned long start, unsigned long end); | 61 | unsigned long start, unsigned long end); |
62 | extern struct vm_struct *get_vm_area_node(unsigned long size, | 62 | extern struct vm_struct *get_vm_area_node(unsigned long size, |
63 | unsigned long flags, int node); | 63 | unsigned long flags, int node, |
64 | gfp_t gfp_mask); | ||
64 | extern struct vm_struct *remove_vm_area(void *addr); | 65 | extern struct vm_struct *remove_vm_area(void *addr); |
65 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, | 66 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, |
66 | struct page ***pages); | 67 | struct page ***pages); |