diff options
| author | Oleg Nesterov <oleg@redhat.com> | 2014-10-09 15:25:34 -0700 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2016-09-28 15:15:10 +0200 |
| commit | d117ddb5a40c31f1d66a9785e1c0f1767bed978d (patch) | |
| tree | 016497a76da8784caac33074ced64cde6ffa97a9 /kernel/debug/debug_core.c | |
| parent | b1ab995bf91d5ded49152536220b558b26a31126 (diff) | |
fs/proc/task_mmu.c: kill the suboptimal and confusing m->version logic
m_start() carefully documents, checks, and sets "m->version = -1" if
we are going to return NULL. The only problem is that we will be never
called again if m_start() returns NULL, so this is simply pointless
and misleading.
Otoh, ->show() methods m->version = 0 if vma == tail_vma and this is
just wrong, we want -1 in this case. And in fact we also want -1 if
->vm_next == NULL and ->tail_vma == NULL.
And it is not used consistently, the "scan vmas" loop in m_start()
should update last_addr too.
Finally, imo the whole "last_addr" logic in m_start() looks horrible.
find_vma(last_addr) is called unconditionally even if we are not going
to use the result. But the main problem is that this code participates
in tail_vma-or-NULL mess, and this looks simply unfixable.
Remove this optimization. We will add it back after some cleanups.
Signed-off-by: Oleg 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: W4TCH0UT <ateekujjawal@gmail.com>
Signed-off-by: Anik1199 <anik9280@gmail.com>
Conflicts:
fs/proc/task_mmu.c
Conflicts:
fs/proc/task_mmu.c
Diffstat (limited to 'kernel/debug/debug_core.c')
0 files changed, 0 insertions, 0 deletions
