Re: [PATCH -next] kdb: Use newer api for tasklist scanning

From: Davidlohr Bueso
Date: Mon Sep 07 2020 - 16:19:48 EST


On Mon, 07 Sep 2020, Daniel Thompson wrote:

No objections to the change but kdb doesn't use tsk->thread_group,
it uses do_each_thread/while_each_thread. Can we change this to
say that is osbsolete and racy to use while_each_thread() (that's
pretty much what the description of the patch that introduced
for_each_thread said)?

Well while_each_thread() is just a loop around next_thread(),
which uses tsk->thread_group. But sure, I can rephrase a v2 to say
while_each_thread.


Additionally the debug_core uses do_each_thread/while_each_thread.
Presumably that would like to be changed as well?

Are you referring to gdb_cmd_query()? Yeah, that's another one that
can be replaced. Because we need not worry about races, it's rather
simple to justify both replacements in the same patch, which I'll
add to v2.

Thanks,
Davidlohr