]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - mm/mlock.c
UBUNTU: Ubuntu-4.15.0-96.97
[mirror_ubuntu-bionic-kernel.git] / mm / mlock.c
index 46af369c13e5de4928c912fec2b5fd6aa87b48d2..5703dccb259cb2c9db4df96247447ff70cec3f90 100644 (file)
@@ -289,7 +289,7 @@ static void __munlock_pagevec(struct pagevec *pvec, struct zone *zone)
        struct pagevec pvec_putback;
        int pgrescued = 0;
 
-       pagevec_init(&pvec_putback, 0);
+       pagevec_init(&pvec_putback);
 
        /* Phase 1: page isolation */
        spin_lock_irq(zone_lru_lock(zone));
@@ -448,7 +448,7 @@ void munlock_vma_pages_range(struct vm_area_struct *vma,
                struct pagevec pvec;
                struct zone *zone;
 
-               pagevec_init(&pvec, 0);
+               pagevec_init(&pvec);
                /*
                 * Although FOLL_DUMP is intended for get_dump_page(),
                 * it just so happens that its special treatment of the
@@ -629,11 +629,11 @@ static int apply_vma_lock_flags(unsigned long start, size_t len,
  * is also counted.
  * Return value: previously mlocked page counts
  */
-static int count_mm_mlocked_page_nr(struct mm_struct *mm,
+static unsigned long count_mm_mlocked_page_nr(struct mm_struct *mm,
                unsigned long start, size_t len)
 {
        struct vm_area_struct *vma;
-       int count = 0;
+       unsigned long count = 0;
 
        if (mm == NULL)
                mm = current->mm;
@@ -670,8 +670,6 @@ static __must_check int do_mlock(unsigned long start, size_t len, vm_flags_t fla
        if (!can_do_mlock())
                return -EPERM;
 
-       lru_add_drain_all();    /* flush pagevec */
-
        len = PAGE_ALIGN(len + (offset_in_page(start)));
        start &= PAGE_MASK;
 
@@ -798,9 +796,6 @@ SYSCALL_DEFINE1(mlockall, int, flags)
        if (!can_do_mlock())
                return -EPERM;
 
-       if (flags & MCL_CURRENT)
-               lru_add_drain_all();    /* flush pagevec */
-
        lock_limit = rlimit(RLIMIT_MEMLOCK);
        lock_limit >>= PAGE_SHIFT;