Re: [PATCH 5/7] exec: In setup_new_exec cache current in the local variable me

From: Kees Cook
Date: Tue May 05 2020 - 16:51:13 EST


On Tue, May 05, 2020 at 02:44:28PM -0500, Eric W. Biederman wrote:
>
> At least gcc 8.3 when generating code for x86_64 has a hard time
> consolidating multiple calls to current aka get_current(), and winds
> up unnecessarily rereading %gs:current_task several times in
> setup_new_exec.
>
> Caching the value of current in the local variable of me generates
> slightly better and shorter assembly.
>
> Signed-off-by: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx>

Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx>

--
Kees Cook