On 27/10/2023 07:18, Christoph Hellwig wrote: >> >> - __bio_add_page(bio, page, len, 0); >> + while (len) { >> + unsigned int io_len = min_t(unsigned int, len, PAGE_SIZE); >> + >> + __bio_add_page(bio, page, io_len, 0); >> + len -= io_len; >> + } > > Maybe out of self-interest, but shouldn't we replace ZERO_PAGE with a > sufficiently larger ZERO_FOLIO? Right now I have a case where I have > to have a zero padding of up to MAX_PAGECACHE_ORDER minus block size, > so having a MAX_PAGECACHE_ORDER folio would have been really helpful > for me, but I suspect there are many other such cases as well. I think that would definitely be useful. I also noticed this pattern in fscrypt_zeroout_range_inline_crypt(). Probably there are more places which could use a ZERO_FOLIO directly instead of iterating with ZERO_PAGE. Chinner also had a similar comment. It would be nice if we can reserve a zero huge page that is the size of MAX_PAGECACHE_ORDER and add it as one folio to the bio.