aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/Kconfig2
-rw-r--r--mm/migrate.c36
-rw-r--r--mm/oom_kill.c2
3 files changed, 18 insertions, 22 deletions
diff --git a/mm/Kconfig b/mm/Kconfig
index 17b8947aa7da..d34c2b971032 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -195,7 +195,7 @@ config BOUNCE
195config NR_QUICK 195config NR_QUICK
196 int 196 int
197 depends on QUICKLIST 197 depends on QUICKLIST
198 default "2" if SUPERH || AVR32 198 default "2" if AVR32
199 default "1" 199 default "1"
200 200
201config VIRT_TO_BUS 201config VIRT_TO_BUS
diff --git a/mm/migrate.c b/mm/migrate.c
index 9a0db5bbabe4..880bd592d38e 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1002,33 +1002,27 @@ static int do_pages_stat(struct mm_struct *mm, unsigned long nr_pages,
1002#define DO_PAGES_STAT_CHUNK_NR 16 1002#define DO_PAGES_STAT_CHUNK_NR 16
1003 const void __user *chunk_pages[DO_PAGES_STAT_CHUNK_NR]; 1003 const void __user *chunk_pages[DO_PAGES_STAT_CHUNK_NR];
1004 int chunk_status[DO_PAGES_STAT_CHUNK_NR]; 1004 int chunk_status[DO_PAGES_STAT_CHUNK_NR];
1005 unsigned long i, chunk_nr = DO_PAGES_STAT_CHUNK_NR;
1006 int err;
1007 1005
1008 for (i = 0; i < nr_pages; i += chunk_nr) { 1006 while (nr_pages) {
1009 if (chunk_nr > nr_pages - i) 1007 unsigned long chunk_nr;
1010 chunk_nr = nr_pages - i;
1011 1008
1012 err = copy_from_user(chunk_pages, &pages[i], 1009 chunk_nr = nr_pages;
1013 chunk_nr * sizeof(*chunk_pages)); 1010 if (chunk_nr > DO_PAGES_STAT_CHUNK_NR)
1014 if (err) { 1011 chunk_nr = DO_PAGES_STAT_CHUNK_NR;
1015 err = -EFAULT; 1012
1016 goto out; 1013 if (copy_from_user(chunk_pages, pages, chunk_nr * sizeof(*chunk_pages)))
1017 } 1014 break;
1018 1015
1019 do_pages_stat_array(mm, chunk_nr, chunk_pages, chunk_status); 1016 do_pages_stat_array(mm, chunk_nr, chunk_pages, chunk_status);
1020 1017
1021 err = copy_to_user(&status[i], chunk_status, 1018 if (copy_to_user(status, chunk_status, chunk_nr * sizeof(*status)))
1022 chunk_nr * sizeof(*chunk_status)); 1019 break;
1023 if (err) {
1024 err = -EFAULT;
1025 goto out;
1026 }
1027 }
1028 err = 0;
1029 1020
1030out: 1021 pages += chunk_nr;
1031 return err; 1022 status += chunk_nr;
1023 nr_pages -= chunk_nr;
1024 }
1025 return nr_pages ? -EFAULT : 0;
1032} 1026}
1033 1027
1034/* 1028/*
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index f52481b1c1e5..237050478f28 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -459,6 +459,8 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
459 list_for_each_entry(c, &p->children, sibling) { 459 list_for_each_entry(c, &p->children, sibling) {
460 if (c->mm == p->mm) 460 if (c->mm == p->mm)
461 continue; 461 continue;
462 if (mem && !task_in_mem_cgroup(c, mem))
463 continue;
462 if (!oom_kill_task(c)) 464 if (!oom_kill_task(c))
463 return 0; 465 return 0;
464 } 466 }