Messages in this thread Patch in this message | | | Subject | [PATCH RFC 04/13] exit: Small refactoring mm_update_next_owner() | From | Kirill Tkhai <> | Date | Mon, 25 May 2015 20:44:41 +0300 |
| |
This will be used in next patches. No functionality change.
Signed-off-by: Kirill Tkhai <ktkhai@odin.com> --- kernel/exit.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/kernel/exit.c b/kernel/exit.c index a1b2bf7..5e82787 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -322,16 +322,20 @@ void mm_update_next_owner(struct mm_struct *mm) * Search in the children */ list_for_each_entry(c, &p->children, sibling) { - if (c->mm == mm) + if (c->mm == mm) { + get_task_struct(c); goto assign_new_owner; + } } /* * Search in the siblings */ list_for_each_entry(c, &p->real_parent->children, sibling) { - if (c->mm == mm) + if (c->mm == mm) { + get_task_struct(c); goto assign_new_owner; + } } /* @@ -341,8 +345,10 @@ void mm_update_next_owner(struct mm_struct *mm) if (g->flags & PF_KTHREAD) continue; for_each_thread(g, c) { - if (c->mm == mm) + if (c->mm == mm) { + get_task_struct(c); goto assign_new_owner; + } if (c->mm) break; } @@ -358,7 +364,6 @@ void mm_update_next_owner(struct mm_struct *mm) assign_new_owner: BUG_ON(c == p); - get_task_struct(c); /* * The task_lock protects c->mm from changing. * We always want mm->owner->mm == mm
| |