Skip to content
  • Oleg Nesterov's avatar
    fs/proc/task_mmu.c: reintroduce m->version logic · b8c20a9b
    Oleg Nesterov authored
    
    
    Add the "last_addr" optimization back. Like before, every ->show()
    method checks !seq_overflow() and sets m->version = vma->vm_start.
    
    However, it also checks that m_next_vma(vma) != NULL, otherwise it
    sets m->version = -1 for the lockless "EOF" fast-path in m_start().
    
    m_start() can simply do find_vma() + m_next_vma() if last_addr is
    not zero, the code looks clear and simple and this case is clearly
    separated from "scan vmas" path.
    
    Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
    Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
    Cc: Cyrill Gorcunov <gorcunov@openvz.org>
    Cc: "Eric W. Biederman" <ebiederm@xmission.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    b8c20a9b