Re: [PATCH v5] do_wait: make PIDTYPE_PID case O(1) instead of O(n)
From: Oleg Nesterov
Date: Sat Mar 13 2021 - 12:26:29 EST
On 03/12, Eric W. Biederman wrote:
>
> I am going to kibitz just a little bit more.
>
> When I looked at this a second time it became apparent that using
> pid_task twice should actually be faster as it removes a dependent load
> caused by thread_group_leader, and replaces it by accessing two adjacent
> pointers in the same cache line.
Heh, I think this code should be optimized for the reader in the first place ;)
But as I said I won't argue, readability is very subjective, I am fine with your
version too.
Oleg.