diff options
author | James Morris <jmorris@namei.org> | 2009-05-22 04:40:59 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-05-22 04:40:59 -0400 |
commit | 2c9e703c618106f5383226fbb1f526cb11034f8a (patch) | |
tree | 87d7548001ea82f655fede0640466fc16aabcdf7 /mm | |
parent | 6470c077cae12227318f40f3e6d756caadcce4b0 (diff) | |
parent | 5805977e63a36ad56594a623f3bd2bebcb7db233 (diff) |
Merge branch 'master' into next
Conflicts:
fs/exec.c
Removed IMA changes (the IMA checks are now performed via may_open()).
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/madvise.c | 8 | ||||
-rw-r--r-- | mm/mmzone.c | 15 | ||||
-rw-r--r-- | mm/page-writeback.c | 6 | ||||
-rw-r--r-- | mm/pdflush.c | 31 | ||||
-rw-r--r-- | mm/slob.c | 5 | ||||
-rw-r--r-- | mm/slub.c | 6 | ||||
-rw-r--r-- | mm/vmstat.c | 19 |
7 files changed, 43 insertions, 47 deletions
diff --git a/mm/madvise.c b/mm/madvise.c index 36d6ea2b6340..b9ce574827c8 100644 --- a/mm/madvise.c +++ b/mm/madvise.c | |||
@@ -112,14 +112,6 @@ static long madvise_willneed(struct vm_area_struct * vma, | |||
112 | if (!file) | 112 | if (!file) |
113 | return -EBADF; | 113 | return -EBADF; |
114 | 114 | ||
115 | /* | ||
116 | * Page cache readahead assumes page cache pages are order-0 which | ||
117 | * is not the case for hugetlbfs. Do not give a bad return value | ||
118 | * but ignore the advice. | ||
119 | */ | ||
120 | if (vma->vm_flags & VM_HUGETLB) | ||
121 | return 0; | ||
122 | |||
123 | if (file->f_mapping->a_ops->get_xip_mem) { | 115 | if (file->f_mapping->a_ops->get_xip_mem) { |
124 | /* no bad return value, but ignore advice */ | 116 | /* no bad return value, but ignore advice */ |
125 | return 0; | 117 | return 0; |
diff --git a/mm/mmzone.c b/mm/mmzone.c index 16ce8b955dcf..f5b7d1760213 100644 --- a/mm/mmzone.c +++ b/mm/mmzone.c | |||
@@ -6,6 +6,7 @@ | |||
6 | 6 | ||
7 | 7 | ||
8 | #include <linux/stddef.h> | 8 | #include <linux/stddef.h> |
9 | #include <linux/mm.h> | ||
9 | #include <linux/mmzone.h> | 10 | #include <linux/mmzone.h> |
10 | #include <linux/module.h> | 11 | #include <linux/module.h> |
11 | 12 | ||
@@ -72,3 +73,17 @@ struct zoneref *next_zones_zonelist(struct zoneref *z, | |||
72 | *zone = zonelist_zone(z); | 73 | *zone = zonelist_zone(z); |
73 | return z; | 74 | return z; |
74 | } | 75 | } |
76 | |||
77 | #ifdef CONFIG_ARCH_HAS_HOLES_MEMORYMODEL | ||
78 | int memmap_valid_within(unsigned long pfn, | ||
79 | struct page *page, struct zone *zone) | ||
80 | { | ||
81 | if (page_to_pfn(page) != pfn) | ||
82 | return 0; | ||
83 | |||
84 | if (page_zone(page) != zone) | ||
85 | return 0; | ||
86 | |||
87 | return 1; | ||
88 | } | ||
89 | #endif /* CONFIG_ARCH_HAS_HOLES_MEMORYMODEL */ | ||
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 30351f0063ac..bb553c3e955d 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c | |||
@@ -94,12 +94,12 @@ unsigned long vm_dirty_bytes; | |||
94 | /* | 94 | /* |
95 | * The interval between `kupdate'-style writebacks | 95 | * The interval between `kupdate'-style writebacks |
96 | */ | 96 | */ |
97 | unsigned int dirty_writeback_interval = 5 * 100; /* sentiseconds */ | 97 | unsigned int dirty_writeback_interval = 5 * 100; /* centiseconds */ |
98 | 98 | ||
99 | /* | 99 | /* |
100 | * The longest time for which data is allowed to remain dirty | 100 | * The longest time for which data is allowed to remain dirty |
101 | */ | 101 | */ |
102 | unsigned int dirty_expire_interval = 30 * 100; /* sentiseconds */ | 102 | unsigned int dirty_expire_interval = 30 * 100; /* centiseconds */ |
103 | 103 | ||
104 | /* | 104 | /* |
105 | * Flag that makes the machine dump writes/reads and block dirtyings. | 105 | * Flag that makes the machine dump writes/reads and block dirtyings. |
@@ -770,7 +770,7 @@ static void wb_kupdate(unsigned long arg) | |||
770 | 770 | ||
771 | sync_supers(); | 771 | sync_supers(); |
772 | 772 | ||
773 | oldest_jif = jiffies - msecs_to_jiffies(dirty_expire_interval); | 773 | oldest_jif = jiffies - msecs_to_jiffies(dirty_expire_interval * 10); |
774 | start_jif = jiffies; | 774 | start_jif = jiffies; |
775 | next_jif = start_jif + msecs_to_jiffies(dirty_writeback_interval * 10); | 775 | next_jif = start_jif + msecs_to_jiffies(dirty_writeback_interval * 10); |
776 | nr_to_write = global_page_state(NR_FILE_DIRTY) + | 776 | nr_to_write = global_page_state(NR_FILE_DIRTY) + |
diff --git a/mm/pdflush.c b/mm/pdflush.c index f2caf96993f8..235ac440c44e 100644 --- a/mm/pdflush.c +++ b/mm/pdflush.c | |||
@@ -58,14 +58,6 @@ static DEFINE_SPINLOCK(pdflush_lock); | |||
58 | int nr_pdflush_threads = 0; | 58 | int nr_pdflush_threads = 0; |
59 | 59 | ||
60 | /* | 60 | /* |
61 | * The max/min number of pdflush threads. R/W by sysctl at | ||
62 | * /proc/sys/vm/nr_pdflush_threads_max/min | ||
63 | */ | ||
64 | int nr_pdflush_threads_max __read_mostly = MAX_PDFLUSH_THREADS; | ||
65 | int nr_pdflush_threads_min __read_mostly = MIN_PDFLUSH_THREADS; | ||
66 | |||
67 | |||
68 | /* | ||
69 | * The time at which the pdflush thread pool last went empty | 61 | * The time at which the pdflush thread pool last went empty |
70 | */ | 62 | */ |
71 | static unsigned long last_empty_jifs; | 63 | static unsigned long last_empty_jifs; |
@@ -76,7 +68,7 @@ static unsigned long last_empty_jifs; | |||
76 | * Thread pool management algorithm: | 68 | * Thread pool management algorithm: |
77 | * | 69 | * |
78 | * - The minimum and maximum number of pdflush instances are bound | 70 | * - The minimum and maximum number of pdflush instances are bound |
79 | * by nr_pdflush_threads_min and nr_pdflush_threads_max. | 71 | * by MIN_PDFLUSH_THREADS and MAX_PDFLUSH_THREADS. |
80 | * | 72 | * |
81 | * - If there have been no idle pdflush instances for 1 second, create | 73 | * - If there have been no idle pdflush instances for 1 second, create |
82 | * a new one. | 74 | * a new one. |
@@ -142,13 +134,14 @@ static int __pdflush(struct pdflush_work *my_work) | |||
142 | * To throttle creation, we reset last_empty_jifs. | 134 | * To throttle creation, we reset last_empty_jifs. |
143 | */ | 135 | */ |
144 | if (time_after(jiffies, last_empty_jifs + 1 * HZ)) { | 136 | if (time_after(jiffies, last_empty_jifs + 1 * HZ)) { |
145 | if (list_empty(&pdflush_list) && | 137 | if (list_empty(&pdflush_list)) { |
146 | nr_pdflush_threads < nr_pdflush_threads_max) { | 138 | if (nr_pdflush_threads < MAX_PDFLUSH_THREADS) { |
147 | last_empty_jifs = jiffies; | 139 | last_empty_jifs = jiffies; |
148 | nr_pdflush_threads++; | 140 | nr_pdflush_threads++; |
149 | spin_unlock_irq(&pdflush_lock); | 141 | spin_unlock_irq(&pdflush_lock); |
150 | start_one_pdflush_thread(); | 142 | start_one_pdflush_thread(); |
151 | spin_lock_irq(&pdflush_lock); | 143 | spin_lock_irq(&pdflush_lock); |
144 | } | ||
152 | } | 145 | } |
153 | } | 146 | } |
154 | 147 | ||
@@ -160,7 +153,7 @@ static int __pdflush(struct pdflush_work *my_work) | |||
160 | */ | 153 | */ |
161 | if (list_empty(&pdflush_list)) | 154 | if (list_empty(&pdflush_list)) |
162 | continue; | 155 | continue; |
163 | if (nr_pdflush_threads <= nr_pdflush_threads_min) | 156 | if (nr_pdflush_threads <= MIN_PDFLUSH_THREADS) |
164 | continue; | 157 | continue; |
165 | pdf = list_entry(pdflush_list.prev, struct pdflush_work, list); | 158 | pdf = list_entry(pdflush_list.prev, struct pdflush_work, list); |
166 | if (time_after(jiffies, pdf->when_i_went_to_sleep + 1 * HZ)) { | 159 | if (time_after(jiffies, pdf->when_i_went_to_sleep + 1 * HZ)) { |
@@ -266,9 +259,9 @@ static int __init pdflush_init(void) | |||
266 | * Pre-set nr_pdflush_threads... If we fail to create, | 259 | * Pre-set nr_pdflush_threads... If we fail to create, |
267 | * the count will be decremented. | 260 | * the count will be decremented. |
268 | */ | 261 | */ |
269 | nr_pdflush_threads = nr_pdflush_threads_min; | 262 | nr_pdflush_threads = MIN_PDFLUSH_THREADS; |
270 | 263 | ||
271 | for (i = 0; i < nr_pdflush_threads_min; i++) | 264 | for (i = 0; i < MIN_PDFLUSH_THREADS; i++) |
272 | start_one_pdflush_thread(); | 265 | start_one_pdflush_thread(); |
273 | return 0; | 266 | return 0; |
274 | } | 267 | } |
@@ -60,6 +60,7 @@ | |||
60 | #include <linux/kernel.h> | 60 | #include <linux/kernel.h> |
61 | #include <linux/slab.h> | 61 | #include <linux/slab.h> |
62 | #include <linux/mm.h> | 62 | #include <linux/mm.h> |
63 | #include <linux/swap.h> /* struct reclaim_state */ | ||
63 | #include <linux/cache.h> | 64 | #include <linux/cache.h> |
64 | #include <linux/init.h> | 65 | #include <linux/init.h> |
65 | #include <linux/module.h> | 66 | #include <linux/module.h> |
@@ -255,6 +256,8 @@ static void *slob_new_pages(gfp_t gfp, int order, int node) | |||
255 | 256 | ||
256 | static void slob_free_pages(void *b, int order) | 257 | static void slob_free_pages(void *b, int order) |
257 | { | 258 | { |
259 | if (current->reclaim_state) | ||
260 | current->reclaim_state->reclaimed_slab += 1 << order; | ||
258 | free_pages((unsigned long)b, order); | 261 | free_pages((unsigned long)b, order); |
259 | } | 262 | } |
260 | 263 | ||
@@ -407,7 +410,7 @@ static void slob_free(void *block, int size) | |||
407 | spin_unlock_irqrestore(&slob_lock, flags); | 410 | spin_unlock_irqrestore(&slob_lock, flags); |
408 | clear_slob_page(sp); | 411 | clear_slob_page(sp); |
409 | free_slob_page(sp); | 412 | free_slob_page(sp); |
410 | free_page((unsigned long)b); | 413 | slob_free_pages(b, 0); |
411 | return; | 414 | return; |
412 | } | 415 | } |
413 | 416 | ||
@@ -9,6 +9,7 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/mm.h> | 11 | #include <linux/mm.h> |
12 | #include <linux/swap.h> /* struct reclaim_state */ | ||
12 | #include <linux/module.h> | 13 | #include <linux/module.h> |
13 | #include <linux/bit_spinlock.h> | 14 | #include <linux/bit_spinlock.h> |
14 | #include <linux/interrupt.h> | 15 | #include <linux/interrupt.h> |
@@ -1170,6 +1171,8 @@ static void __free_slab(struct kmem_cache *s, struct page *page) | |||
1170 | 1171 | ||
1171 | __ClearPageSlab(page); | 1172 | __ClearPageSlab(page); |
1172 | reset_page_mapcount(page); | 1173 | reset_page_mapcount(page); |
1174 | if (current->reclaim_state) | ||
1175 | current->reclaim_state->reclaimed_slab += pages; | ||
1173 | __free_pages(page, order); | 1176 | __free_pages(page, order); |
1174 | } | 1177 | } |
1175 | 1178 | ||
@@ -1909,7 +1912,7 @@ static inline int calculate_order(int size) | |||
1909 | * Doh this slab cannot be placed using slub_max_order. | 1912 | * Doh this slab cannot be placed using slub_max_order. |
1910 | */ | 1913 | */ |
1911 | order = slab_order(size, 1, MAX_ORDER, 1); | 1914 | order = slab_order(size, 1, MAX_ORDER, 1); |
1912 | if (order <= MAX_ORDER) | 1915 | if (order < MAX_ORDER) |
1913 | return order; | 1916 | return order; |
1914 | return -ENOSYS; | 1917 | return -ENOSYS; |
1915 | } | 1918 | } |
@@ -2522,6 +2525,7 @@ __setup("slub_min_order=", setup_slub_min_order); | |||
2522 | static int __init setup_slub_max_order(char *str) | 2525 | static int __init setup_slub_max_order(char *str) |
2523 | { | 2526 | { |
2524 | get_option(&str, &slub_max_order); | 2527 | get_option(&str, &slub_max_order); |
2528 | slub_max_order = min(slub_max_order, MAX_ORDER - 1); | ||
2525 | 2529 | ||
2526 | return 1; | 2530 | return 1; |
2527 | } | 2531 | } |
diff --git a/mm/vmstat.c b/mm/vmstat.c index 66f6130976cb..74d66dba0cbe 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c | |||
@@ -509,22 +509,11 @@ static void pagetypeinfo_showblockcount_print(struct seq_file *m, | |||
509 | continue; | 509 | continue; |
510 | 510 | ||
511 | page = pfn_to_page(pfn); | 511 | page = pfn_to_page(pfn); |
512 | #ifdef CONFIG_ARCH_FLATMEM_HAS_HOLES | 512 | |
513 | /* | 513 | /* Watch for unexpected holes punched in the memmap */ |
514 | * Ordinarily, memory holes in flatmem still have a valid | 514 | if (!memmap_valid_within(pfn, page, zone)) |
515 | * memmap for the PFN range. However, an architecture for | ||
516 | * embedded systems (e.g. ARM) can free up the memmap backing | ||
517 | * holes to save memory on the assumption the memmap is | ||
518 | * never used. The page_zone linkages are then broken even | ||
519 | * though pfn_valid() returns true. Skip the page if the | ||
520 | * linkages are broken. Even if this test passed, the impact | ||
521 | * is that the counters for the movable type are off but | ||
522 | * fragmentation monitoring is likely meaningless on small | ||
523 | * systems. | ||
524 | */ | ||
525 | if (page_zone(page) != zone) | ||
526 | continue; | 515 | continue; |
527 | #endif | 516 | |
528 | mtype = get_pageblock_migratetype(page); | 517 | mtype = get_pageblock_migratetype(page); |
529 | 518 | ||
530 | if (mtype < MIGRATE_TYPES) | 519 | if (mtype < MIGRATE_TYPES) |