Merge tag 'arm-soc-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
[linux-2.6-microblaze.git] / mm / madvise.c
index a8d8d48..6a66085 100644 (file)
@@ -877,7 +877,6 @@ static long madvise_remove(struct vm_area_struct *vma,
 static int madvise_inject_error(int behavior,
                unsigned long start, unsigned long end)
 {
-       struct zone *zone;
        unsigned long size;
 
        if (!capable(CAP_SYS_ADMIN))
@@ -908,24 +907,13 @@ static int madvise_inject_error(int behavior,
                } else {
                        pr_info("Injecting memory failure for pfn %#lx at process virtual address %#lx\n",
                                 pfn, start);
-                       /*
-                        * Drop the page reference taken by get_user_pages_fast(). In
-                        * the absence of MF_COUNT_INCREASED the memory_failure()
-                        * routine is responsible for pinning the page to prevent it
-                        * from being released back to the page allocator.
-                        */
-                       put_page(page);
-                       ret = memory_failure(pfn, 0);
+                       ret = memory_failure(pfn, MF_COUNT_INCREASED);
                }
 
                if (ret)
                        return ret;
        }
 
-       /* Ensure that all poisoned pages are removed from per-cpu lists */
-       for_each_populated_zone(zone)
-               drain_all_pages(zone);
-
        return 0;
 }
 #endif
@@ -1204,8 +1192,7 @@ SYSCALL_DEFINE5(process_madvise, int, pidfd, const struct iovec __user *, vec,
                goto put_pid;
        }
 
-       if (task->mm != current->mm &&
-                       !process_madvise_behavior_valid(behavior)) {
+       if (!process_madvise_behavior_valid(behavior)) {
                ret = -EINVAL;
                goto release_task;
        }