Re: [PATCH vfs/for-next 1/3] pipe: Move pipe wakeup helpers out of splice
From: Jens Axboe
Date: Mon Mar 24 2025 - 18:16:10 EST
On 3/22/25 2:35 PM, Joe Damato wrote:
> Splice code has helpers to wakeup pipe readers and writers. Move these
> helpers out of splice, rename them from "wakeup_pipe_*" to
> "pipe_wakeup_*" and update call sites in splice.
This looks good to me, as it's moving the code to where it belongs.
One minor note:
> +void pipe_wakeup_readers(struct pipe_inode_info *pipe)
> +{
> + smp_mb();
> + if (waitqueue_active(&pipe->rd_wait))
> + wake_up_interruptible(&pipe->rd_wait);
> + kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
> +}
> +
> +void pipe_wakeup_writers(struct pipe_inode_info *pipe)
> +{
> + smp_mb();
> + if (waitqueue_active(&pipe->wr_wait))
> + wake_up_interruptible(&pipe->wr_wait);
> + kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT);
> +}
Both of these really should use wq_has_sleeper() - not related to your
change, as it makes more sense to keep the code while moving it. But
just spotted it while looking at it, just a note for the future... In
any case:
Reviewed-by: Jens Axboe <axboe@xxxxxxxxx>
--
Jens Axboe