proc: change first_tid() to use while_each_thread() rather than next_thread()

Rerwrite the main loop to use while_each_thread() instead of
next_thread().  We are going to fix or replace while_each_thread(),
next_thread() should be avoided whenever possible.

Signed-off-by: Oleg Nesterov <>
Cc: "Eric W. Biederman" <>
Cc: Michal Hocko <>
Cc: Sameer Nanda <>
Cc: Sergey Dyasly <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
1 file changed