mm: unrig VMA cache hit ratio
[cascardo/linux.git] / mm / vmacache.c
index fd09dc9..035fdeb 100644 (file)
@@ -87,11 +87,11 @@ struct vm_area_struct *vmacache_find(struct mm_struct *mm, unsigned long addr)
 {
        int i;
 
+       count_vm_vmacache_event(VMACACHE_FIND_CALLS);
+
        if (!vmacache_valid(mm))
                return NULL;
 
-       count_vm_vmacache_event(VMACACHE_FIND_CALLS);
-
        for (i = 0; i < VMACACHE_SIZE; i++) {
                struct vm_area_struct *vma = current->vmacache[i];
 
@@ -115,11 +115,11 @@ struct vm_area_struct *vmacache_find_exact(struct mm_struct *mm,
 {
        int i;
 
+       count_vm_vmacache_event(VMACACHE_FIND_CALLS);
+
        if (!vmacache_valid(mm))
                return NULL;
 
-       count_vm_vmacache_event(VMACACHE_FIND_CALLS);
-
        for (i = 0; i < VMACACHE_SIZE; i++) {
                struct vm_area_struct *vma = current->vmacache[i];