Re: [MEH PATCH] fs: move fd_install() slowpath into a dedicated routine and provide commentary

From: Al Viro
Date: Mon Nov 10 2025 - 01:41:22 EST


On Sun, Nov 09, 2025 at 01:02:59PM +0100, Mateusz Guzik wrote:

> +/*
> + * Install a file pointer in the fd array while it is being resized.
> + *
> + * We need to make sure our update to the array does not get lost as the resizing
> + * thread can be copying the content as we modify it.
> + *
> + * We have two ways to do it:
> + * - go off CPU waiting for resize_in_progress to clear
> + * - take the spin lock
> + *
> + * The latter is trivial to implement and saves us from having to might_sleep()
> + * for debugging purposes.
> + *
> + * This is moved out of line from fd_install() to convince gcc to optimize that
> + * routine better.
> + */

Does it become seriously worse if you move rcu_read_unlock_sched() into the caller?