Re: [PATCH] kill do_each_thread()

Oleg Nesterov <[email protected]>
Newsgroups gmane.linux.ports.ia64,gmane.linux.kernel
Message-ID <[email protected]>
On 08/18, Jiri Slaby wrote:
>
> On 17. 08. 23, 18:37, Oleg Nesterov wrote:
> >Eric has pointed out that we still have 3 users of do_each_thread().
> >Change them to use for_each_process_thread() and kill this helper.
>
> Is there any change in behavior?

No.

Well, there is a subtle change, after do_each_thread/while_each_thread
g == t == &init_task, while after for_each_process_thread() they both
point to nowhere, but this doesn't matter.

> Why is for_each_process_thread() better than do_each_thread()?

Say, for_each_process_thread() is rcu safe, do_each_thread() is not.

And certainly

	for_each_process_thread(p, t) {
		do_something(p, t);
	}

looks better than

	do_each_thread(p, t) {
		do_something(p, t);
	} while_each_thread(p, t);

And again, there are only 3 users of this awkward helper left.
It should have been killed years ago and in fact I thought it
had already been killed. It uses while_each_thread() which needs
some changes.

Oleg.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.