aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/filemap.c2
-rw-r--r--mm/memory.c3
-rw-r--r--mm/mempolicy.c5
-rw-r--r--mm/migrate.c3
-rw-r--r--mm/mmap.c11
-rw-r--r--mm/mprotect.c6
-rw-r--r--mm/oom_kill.c15
7 files changed, 18 insertions, 27 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index 920366399eed..5209e47b7fe3 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -841,7 +841,7 @@ static void shrink_readahead_size_eio(struct file *filp,
841/** 841/**
842 * do_generic_mapping_read - generic file read routine 842 * do_generic_mapping_read - generic file read routine
843 * @mapping: address_space to be read 843 * @mapping: address_space to be read
844 * @_ra: file's readahead state 844 * @ra: file's readahead state
845 * @filp: the file to read 845 * @filp: the file to read
846 * @ppos: current file position 846 * @ppos: current file position
847 * @desc: read_descriptor 847 * @desc: read_descriptor
diff --git a/mm/memory.c b/mm/memory.c
index bd16dcaeefb8..142683df8755 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -259,9 +259,6 @@ void free_pgd_range(struct mmu_gather **tlb,
259 continue; 259 continue;
260 free_pud_range(*tlb, pgd, addr, next, floor, ceiling); 260 free_pud_range(*tlb, pgd, addr, next, floor, ceiling);
261 } while (pgd++, addr = next, addr != end); 261 } while (pgd++, addr = next, addr != end);
262
263 if (!(*tlb)->fullmm)
264 flush_tlb_pgtables((*tlb)->mm, start, end);
265} 262}
266 263
267void free_pgtables(struct mmu_gather **tlb, struct vm_area_struct *vma, 264void free_pgtables(struct mmu_gather **tlb, struct vm_area_struct *vma,
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 568152ae6caf..c1592a94582f 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -78,6 +78,7 @@
78#include <linux/slab.h> 78#include <linux/slab.h>
79#include <linux/string.h> 79#include <linux/string.h>
80#include <linux/module.h> 80#include <linux/module.h>
81#include <linux/nsproxy.h>
81#include <linux/interrupt.h> 82#include <linux/interrupt.h>
82#include <linux/init.h> 83#include <linux/init.h>
83#include <linux/compat.h> 84#include <linux/compat.h>
@@ -940,7 +941,7 @@ asmlinkage long sys_migrate_pages(pid_t pid, unsigned long maxnode,
940 941
941 /* Find the mm_struct */ 942 /* Find the mm_struct */
942 read_lock(&tasklist_lock); 943 read_lock(&tasklist_lock);
943 task = pid ? find_task_by_pid(pid) : current; 944 task = pid ? find_task_by_vpid(pid) : current;
944 if (!task) { 945 if (!task) {
945 read_unlock(&tasklist_lock); 946 read_unlock(&tasklist_lock);
946 return -ESRCH; 947 return -ESRCH;
@@ -1388,7 +1389,6 @@ EXPORT_SYMBOL(alloc_pages_current);
1388 * keeps mempolicies cpuset relative after its cpuset moves. See 1389 * keeps mempolicies cpuset relative after its cpuset moves. See
1389 * further kernel/cpuset.c update_nodemask(). 1390 * further kernel/cpuset.c update_nodemask().
1390 */ 1391 */
1391void *cpuset_being_rebound;
1392 1392
1393/* Slow path of a mempolicy copy */ 1393/* Slow path of a mempolicy copy */
1394struct mempolicy *__mpol_copy(struct mempolicy *old) 1394struct mempolicy *__mpol_copy(struct mempolicy *old)
@@ -2019,4 +2019,3 @@ out:
2019 m->version = (vma != priv->tail_vma) ? vma->vm_start : 0; 2019 m->version = (vma != priv->tail_vma) ? vma->vm_start : 0;
2020 return 0; 2020 return 0;
2021} 2021}
2022
diff --git a/mm/migrate.c b/mm/migrate.c
index 06d0877a66ef..4d6ee03db946 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -19,6 +19,7 @@
19#include <linux/pagemap.h> 19#include <linux/pagemap.h>
20#include <linux/buffer_head.h> 20#include <linux/buffer_head.h>
21#include <linux/mm_inline.h> 21#include <linux/mm_inline.h>
22#include <linux/nsproxy.h>
22#include <linux/pagevec.h> 23#include <linux/pagevec.h>
23#include <linux/rmap.h> 24#include <linux/rmap.h>
24#include <linux/topology.h> 25#include <linux/topology.h>
@@ -924,7 +925,7 @@ asmlinkage long sys_move_pages(pid_t pid, unsigned long nr_pages,
924 925
925 /* Find the mm_struct */ 926 /* Find the mm_struct */
926 read_lock(&tasklist_lock); 927 read_lock(&tasklist_lock);
927 task = pid ? find_task_by_pid(pid) : current; 928 task = pid ? find_task_by_vpid(pid) : current;
928 if (!task) { 929 if (!task) {
929 read_unlock(&tasklist_lock); 930 read_unlock(&tasklist_lock);
930 return -ESRCH; 931 return -ESRCH;
diff --git a/mm/mmap.c b/mm/mmap.c
index 4275e81e25ba..7a30c4988231 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1048,8 +1048,7 @@ int vma_wants_writenotify(struct vm_area_struct *vma)
1048 1048
1049 /* The open routine did something to the protections already? */ 1049 /* The open routine did something to the protections already? */
1050 if (pgprot_val(vma->vm_page_prot) != 1050 if (pgprot_val(vma->vm_page_prot) !=
1051 pgprot_val(protection_map[vm_flags & 1051 pgprot_val(vm_get_page_prot(vm_flags)))
1052 (VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)]))
1053 return 0; 1052 return 0;
1054 1053
1055 /* Specialty mapping? */ 1054 /* Specialty mapping? */
@@ -1130,8 +1129,7 @@ munmap_back:
1130 vma->vm_start = addr; 1129 vma->vm_start = addr;
1131 vma->vm_end = addr + len; 1130 vma->vm_end = addr + len;
1132 vma->vm_flags = vm_flags; 1131 vma->vm_flags = vm_flags;
1133 vma->vm_page_prot = protection_map[vm_flags & 1132 vma->vm_page_prot = vm_get_page_prot(vm_flags);
1134 (VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)];
1135 vma->vm_pgoff = pgoff; 1133 vma->vm_pgoff = pgoff;
1136 1134
1137 if (file) { 1135 if (file) {
@@ -2002,8 +2000,7 @@ unsigned long do_brk(unsigned long addr, unsigned long len)
2002 vma->vm_end = addr + len; 2000 vma->vm_end = addr + len;
2003 vma->vm_pgoff = pgoff; 2001 vma->vm_pgoff = pgoff;
2004 vma->vm_flags = flags; 2002 vma->vm_flags = flags;
2005 vma->vm_page_prot = protection_map[flags & 2003 vma->vm_page_prot = vm_get_page_prot(flags);
2006 (VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)];
2007 vma_link(mm, vma, prev, rb_link, rb_parent); 2004 vma_link(mm, vma, prev, rb_link, rb_parent);
2008out: 2005out:
2009 mm->total_vm += len >> PAGE_SHIFT; 2006 mm->total_vm += len >> PAGE_SHIFT;
@@ -2209,7 +2206,7 @@ int install_special_mapping(struct mm_struct *mm,
2209 vma->vm_end = addr + len; 2206 vma->vm_end = addr + len;
2210 2207
2211 vma->vm_flags = vm_flags | mm->def_flags; 2208 vma->vm_flags = vm_flags | mm->def_flags;
2212 vma->vm_page_prot = protection_map[vma->vm_flags & 7]; 2209 vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
2213 2210
2214 vma->vm_ops = &special_mapping_vmops; 2211 vma->vm_ops = &special_mapping_vmops;
2215 vma->vm_private_data = pages; 2212 vma->vm_private_data = pages;
diff --git a/mm/mprotect.c b/mm/mprotect.c
index 1d4d69790e59..55227845abbe 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -192,11 +192,9 @@ success:
192 * held in write mode. 192 * held in write mode.
193 */ 193 */
194 vma->vm_flags = newflags; 194 vma->vm_flags = newflags;
195 vma->vm_page_prot = protection_map[newflags & 195 vma->vm_page_prot = vm_get_page_prot(newflags);
196 (VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)];
197 if (vma_wants_writenotify(vma)) { 196 if (vma_wants_writenotify(vma)) {
198 vma->vm_page_prot = protection_map[newflags & 197 vma->vm_page_prot = vm_get_page_prot(newflags);
199 (VM_READ|VM_WRITE|VM_EXEC)];
200 dirty_accountable = 1; 198 dirty_accountable = 1;
201 } 199 }
202 200
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index a64decb5b13f..824cade07827 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -212,7 +212,7 @@ static struct task_struct *select_bad_process(unsigned long *ppoints)
212 if (!p->mm) 212 if (!p->mm)
213 continue; 213 continue;
214 /* skip the init task */ 214 /* skip the init task */
215 if (is_init(p)) 215 if (is_global_init(p))
216 continue; 216 continue;
217 217
218 /* 218 /*
@@ -265,7 +265,7 @@ static struct task_struct *select_bad_process(unsigned long *ppoints)
265 */ 265 */
266static void __oom_kill_task(struct task_struct *p, int verbose) 266static void __oom_kill_task(struct task_struct *p, int verbose)
267{ 267{
268 if (is_init(p)) { 268 if (is_global_init(p)) {
269 WARN_ON(1); 269 WARN_ON(1);
270 printk(KERN_WARNING "tried to kill init!\n"); 270 printk(KERN_WARNING "tried to kill init!\n");
271 return; 271 return;
@@ -278,7 +278,8 @@ static void __oom_kill_task(struct task_struct *p, int verbose)
278 } 278 }
279 279
280 if (verbose) 280 if (verbose)
281 printk(KERN_ERR "Killed process %d (%s)\n", p->pid, p->comm); 281 printk(KERN_ERR "Killed process %d (%s)\n",
282 task_pid_nr(p), p->comm);
282 283
283 /* 284 /*
284 * We give our sacrificial lamb high priority and access to 285 * We give our sacrificial lamb high priority and access to
@@ -326,7 +327,7 @@ static int oom_kill_task(struct task_struct *p)
326 * to memory reserves though, otherwise we might deplete all memory. 327 * to memory reserves though, otherwise we might deplete all memory.
327 */ 328 */
328 do_each_thread(g, q) { 329 do_each_thread(g, q) {
329 if (q->mm == mm && q->tgid != p->tgid) 330 if (q->mm == mm && !same_thread_group(q, p))
330 force_sig(SIGKILL, q); 331 force_sig(SIGKILL, q);
331 } while_each_thread(g, q); 332 } while_each_thread(g, q);
332 333
@@ -337,7 +338,6 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
337 unsigned long points, const char *message) 338 unsigned long points, const char *message)
338{ 339{
339 struct task_struct *c; 340 struct task_struct *c;
340 struct list_head *tsk;
341 341
342 if (printk_ratelimit()) { 342 if (printk_ratelimit()) {
343 printk(KERN_WARNING "%s invoked oom-killer: " 343 printk(KERN_WARNING "%s invoked oom-killer: "
@@ -357,11 +357,10 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
357 } 357 }
358 358
359 printk(KERN_ERR "%s: kill process %d (%s) score %li or a child\n", 359 printk(KERN_ERR "%s: kill process %d (%s) score %li or a child\n",
360 message, p->pid, p->comm, points); 360 message, task_pid_nr(p), p->comm, points);
361 361
362 /* Try to kill a child first */ 362 /* Try to kill a child first */
363 list_for_each(tsk, &p->children) { 363 list_for_each_entry(c, &p->children, sibling) {
364 c = list_entry(tsk, struct task_struct, sibling);
365 if (c->mm == p->mm) 364 if (c->mm == p->mm)
366 continue; 365 continue;
367 if (!oom_kill_task(c)) 366 if (!oom_kill_task(c))