Re: [PATCH 1/4] virtio_console: copy pipe buffers in splice_write()
From: Zi Yan
Date: Tue Nov 10 2026 - 11:34:18 EST
On 10 Nov 2026, at 9:52, Kiryl Shutsemau (Meta) wrote:
> pipe_to_sg() tries to steal the page of each pipe buffer and pass it to
> the host as it is. When the steal fails, it copies the data into a page
> of its own.
>
> Pages written into the pipe with write(), gifted user pages and page
> cache pages can be stolen. The ftrace ring buffer pages that
> virtio-trace splices cannot, so that in-tree user always gets the copy.
>
> Always copy. The data that reaches the host does not change.
>
> Preparation for removing ->try_steal() from pipe buffers.
>
> Suggested-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Kiryl Shutsemau (Meta) <kas@xxxxxxxxxx>
> ---
> drivers/char/virtio_console.c | 39 +++++++++++++----------------------
> 1 file changed, 14 insertions(+), 25 deletions(-)
>
LGTM.
Acked-by: Zi Yan <ziy@xxxxxxxxxx>
Best Regards,
Yan, Zi