Re: [PATCH 6/6] mm/swap: rename __swap_writepage() to __swap_writeout()

From: Tal Zussman

Date: Mon Aug 10 2026 - 07:19:39 EST


On 8/7/26 3:05 PM, Matthew Wilcox wrote:
> On Fri, Aug 07, 2026 at 01:01:08PM -0400, Johannes Weiner wrote:
>> On Thu, Aug 06, 2026 at 06:55:38PM -0400, Tal Zussman wrote:
>> > Commit 84798514db50 ("mm: Remove swap_writepage() and
>> > shmem_writepage()") renamed swap_writepage() to swap_writeout(). Rename
>> > __swap_writepage(), which operates on a folio, to match its caller.
>> > Update a stale reference to swap_writepage() in swapfile.c as well.
>> >
>> > Signed-off-by: Tal Zussman <tz2294@xxxxxxxxxxxx>
>>
>> Looking at that commit, I can only guess that pageout() had an
>> influence on the swap_writeout() name.
>>
>> However, on the read side of the page_io.c API, we're following
>> swap_read_folio* consistently.
>>
>> [__]swap_write_folio* would seem more symmetrical?
>
> I wanted to be sure that filesystem authors see this as something unusual
> rather than something they should implement as a counterpart to their
> read_folio operation. So it was intentionally asymmetric. I'm open
> to discussion of better names, but my hope is that we get closer to the
> 'do direct IO' model and shmem doesn't need to swizzle its folios into
> the swapcache to get them into the swap system.
>

This message only came in on my end after I responded to Johannes. I'll
leave it as [__]swap_writeout() for now.

>> [ At the risk of starting something, should the file itself be
>> renamed? swap_rw.c or swap_io.c or something. ]
>
> I'm not opposed to that either!
>