]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm-introduce-vm_lockonfault-v9
authorEric B Munson <emunson@akamai.com>
Wed, 21 Oct 2015 22:03:25 +0000 (09:03 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 21 Oct 2015 22:03:25 +0000 (09:03 +1100)
Signed-off-by: Eric B Munson <emunson@akamai.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Documentation/filesystems/proc.txt
drivers/gpu/drm/drm_vm.c
fs/proc/task_mmu.c
include/linux/mm.h
kernel/fork.c
mm/hugetlb.c
mm/mlock.c
mm/mmap.c
mm/rmap.c

index 937c9d3c4449a88f6bd9ea664f37576636ceb9bb..d6f259eaa5efb384cb503d312808ec06660efba5 100644 (file)
@@ -481,7 +481,6 @@ manner. The codes are the following:
     rr  - random read advise provided
     dc  - do not copy area on fork
     de  - do not expand area on remapping
-    lf  - mark area to lock pages when faulted in, do not pre-populate
     ac  - area is accountable
     nr  - swap space is not reserved for the area
     ht  - area uses huge tlb pages
index 103a5f6b969a87e6bfd0be346554809adb2443b2..aab49ee4ed40d2ce5b525554209fd3ffe40340b4 100644 (file)
@@ -699,15 +699,9 @@ int drm_vma_info(struct seq_file *m, void *data)
                   (void *)(unsigned long)virt_to_phys(high_memory));
 
        list_for_each_entry(pt, &dev->vmalist, head) {
-               char lock_flag = '-';
-
                vma = pt->vma;
                if (!vma)
                        continue;
-               if (vma->vm_flags & VM_LOCKONFAULT)
-                       lock_flag = 'f';
-               else if (vma->vm_flags & VM_LOCKED)
-                       lock_flag = 'l';
                seq_printf(m,
                           "\n%5d 0x%pK-0x%pK %c%c%c%c%c%c 0x%08lx000",
                           pt->pid,
@@ -716,7 +710,7 @@ int drm_vma_info(struct seq_file *m, void *data)
                           vma->vm_flags & VM_WRITE ? 'w' : '-',
                           vma->vm_flags & VM_EXEC ? 'x' : '-',
                           vma->vm_flags & VM_MAYSHARE ? 's' : 'p',
-                          lock_flag,
+                          vma->vm_flags & VM_LOCKED ? 'l' : '-',
                           vma->vm_flags & VM_IO ? 'i' : '-',
                           vma->vm_pgoff);
 
index 8ad0116e225b8a997c2792a73817d4412ada0911..a323b6258bf3ea508f23fa48702c5df068dcc376 100644 (file)
@@ -601,7 +601,6 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma)
                [ilog2(VM_RAND_READ)]   = "rr",
                [ilog2(VM_DONTCOPY)]    = "dc",
                [ilog2(VM_DONTEXPAND)]  = "de",
-               [ilog2(VM_LOCKONFAULT)] = "lf",
                [ilog2(VM_ACCOUNT)]     = "ac",
                [ilog2(VM_NORESERVE)]   = "nr",
                [ilog2(VM_HUGETLB)]     = "ht",
index 505e19c45f6aa67d920692be90367d7851242d99..906c46a0570712d88481efb5ef9d077836124707 100644 (file)
@@ -203,6 +203,9 @@ extern unsigned int kobjsize(const void *objp);
 /* This mask defines which mm->def_flags a process can inherit its parent */
 #define VM_INIT_DEF_MASK       VM_NOHUGEPAGE
 
+/* This mask is used to clear all the VMA flags used by mlock */
+#define VM_LOCKED_CLEAR_MASK   (~(VM_LOCKED | VM_LOCKONFAULT))
+
 /*
  * mapping from the currently active vm_flags protection bits (the
  * low four bits) to a page protection mask..
index 69504920965780a67eee85284c103ed84cd46e56..fe7968901bea81a8f9bc40ae0a28f473c28e832b 100644 (file)
@@ -454,8 +454,8 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
                tmp->vm_mm = mm;
                if (anon_vma_fork(tmp, mpnt))
                        goto fail_nomem_anon_vma_fork;
-               tmp->vm_flags &= ~(VM_LOCKED | VM_UFFD_MISSING | VM_UFFD_WP |
-                                       VM_LOCKONFAULT);
+               tmp->vm_flags &=
+                       ~(VM_LOCKED|VM_LOCKONFAULT|VM_UFFD_MISSING|VM_UFFD_WP);
                tmp->vm_next = tmp->vm_prev = NULL;
                tmp->vm_userfaultfd_ctx = NULL_VM_UFFD_CTX;
                file = tmp->vm_file;
index c3e78521c44a4224e0b28d38f9fac1e00ea06cfb..089cccfa8b02421c8e7c33ad0dd5bf8e3f6ebbba 100644 (file)
@@ -4171,8 +4171,8 @@ static unsigned long page_table_shareable(struct vm_area_struct *svma,
        unsigned long s_end = sbase + PUD_SIZE;
 
        /* Allow segments to share if only one is marked locked */
-       unsigned long vm_flags = vma->vm_flags & ~(VM_LOCKED|VM_LOCKONFAULT);
-       unsigned long svm_flags = svma->vm_flags & ~(VM_LOCKED|VM_LOCKONFAULT);
+       unsigned long vm_flags = vma->vm_flags & VM_LOCKED_CLEAR_MASK;
+       unsigned long svm_flags = svma->vm_flags & VM_LOCKED_CLEAR_MASK;
 
        /*
         * match the virtual addresses, permission and the alignment of the
index 15c94d8ae05c0b1727c61b2f36213020877651f7..ca3894113b974963aefa547fa36c7a11ad672d16 100644 (file)
@@ -422,7 +422,7 @@ static unsigned long __munlock_pagevec_fill(struct pagevec *pvec,
 void munlock_vma_pages_range(struct vm_area_struct *vma,
                             unsigned long start, unsigned long end)
 {
-       vma->vm_flags &= ~(VM_LOCKED | VM_LOCKONFAULT);
+       vma->vm_flags &= VM_LOCKED_CLEAR_MASK;
 
        while (start < end) {
                struct page *page = NULL;
index 03b654ecf5fb99d7a5ee27fe320f36a8ec0ec971..2ce04a649f6b4977e54b76a29be9d5bac5e71dab 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1661,7 +1661,7 @@ out:
                                        vma == get_gate_vma(current->mm)))
                        mm->locked_vm += (len >> PAGE_SHIFT);
                else
-                       vma->vm_flags &= ~(VM_LOCKED | VM_LOCKONFAULT);
+                       vma->vm_flags &= VM_LOCKED_CLEAR_MASK;
        }
 
        if (file)
index 50664c54df982424398858fc48dc6ce6358cec60..b577fbb98d4baf352fa5e51cc536d02356b8392e 100644 (file)
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -848,8 +848,7 @@ static int page_referenced_one(struct page *page, struct vm_area_struct *vma,
 
                if (vma->vm_flags & VM_LOCKED) {
                        spin_unlock(ptl);
-                       pra->vm_flags |=
-                               (vma->vm_flags & (VM_LOCKED | VM_LOCKONFAULT));
+                       pra->vm_flags |= VM_LOCKED;
                        return SWAP_FAIL; /* To break the loop */
                }
 
@@ -870,8 +869,7 @@ static int page_referenced_one(struct page *page, struct vm_area_struct *vma,
 
                if (vma->vm_flags & VM_LOCKED) {
                        pte_unmap_unlock(pte, ptl);
-                       pra->vm_flags |=
-                               (vma->vm_flags & (VM_LOCKED | VM_LOCKONFAULT));
+                       pra->vm_flags |= VM_LOCKED;
                        return SWAP_FAIL; /* To break the loop */
                }