CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP is broken, was Re: [RFC PATCH 0/6] Deep talk about folio vmap

Christoph Hellwig
2025-04-04T09:01:20Z

After the btrfs compressed bio discussion I think the hugetlb changes that
skip the tail pages are fundamentally unsafe in the current kernel.

That is because the bio_vec representation assumes tail pages do exist, so
as soon as you are doing direct I/O that generates a bvec starting beyond
the present head page things will blow up. Other users of bio_vecs might
do the same, but the way the block bio_vecs are generated are very suspect
to that. So we'll first need to sort that out and a few other things
before we can even think of enabling such a feature.