Re: [PATCH 2/5] mm: limit pagecache folio refcount when splicing into pipes
From: David Hildenbrand (Arm)
Date: Fri Nov 06 2026 - 17:44:12 EST
On 11/6/26 11:03, Lance Yang wrote:
>
> On Thu, Nov 05, 2026 at 02:10:11PM +0100, David Hildenbrand (Arm) wrote:
>> Similar to mapping pagecache folios into page tables, let's reject splicing
>> folios into a pipe if the refcount is at it's limit, similar to how we
>> handle it during GUP.
>>
>> This will prevent more cases of possible folio refcount overflows with
>> large pagecache folios.
>>
>> Let's keep it simple and check in the two callers of
>> splice_folio_into_pipe().
>>
>> Also check in try_get_page() to cover pipe-buffer duplication by tee()
>> and partial pipe-to-pipe splicing.
>
> What about fuse_ref_folio()? Buffered FUSE_WRITE requests can carry
> pagecache folios into a pipe through /dev/fuse without going through
> splice_folio_into_pipe() or try_get_page() ...
Of course it has its own handling ... :)
Thanks! I was hoping the number of folio references would be bounded ... I guess
one reference per pipe buffer is not the end of the world, but, let's just add
it, and fallback to copying.
--
Cheers,
David