On 29/05/26 8:52 pm, Michael S. Tsirkin wrote: > Remove the !CONFIG_HUGETLB_PAGE stub for alloc_hugetlb_folio(). > > The stub is dead code: all callers are in mm/hugetlb.c > (CONFIG_HUGETLB_PAGE) or fs/hugetlbfs/inode.c (CONFIG_HUGETLBFS), > and CONFIG_HUGETLB_PAGE is def_bool HUGETLBFS with nothing > selecting it independently. > > The stub is also broken: it returns NULL, but all callers check > IS_ERR(folio), so a NULL return would not be caught and would > crash on the subsequent folio dereference. > > Remove it now since follow-up patches change the signature of > alloc_hugetlb_folio and would otherwise need to update the > broken stub too. > > Signed-off-by: Michael S. Tsirkin <[email protected]> > Reviewed-by: Gregory Price <[email protected]> > Assisted-by: Claude:claude-opus-4-6 > --- Reviewed-by: Dev Jain <[email protected]> > include/linux/hugetlb.h | 7 ------- > 1 file changed, 7 deletions(-) > > diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h > index 93418625d3c5..f016bc2e8936 100644 > --- a/include/linux/hugetlb.h > +++ b/include/linux/hugetlb.h > @@ -1129,13 +1129,6 @@ static inline void wait_for_freed_hugetlb_folios(void) > { > } > > -static inline struct folio *alloc_hugetlb_folio(struct vm_area_struct *vma, > - unsigned long addr, > - bool cow_from_owner) > -{ > - return NULL; > -} > - > static inline struct folio * > alloc_hugetlb_folio_reserve(struct hstate *h, int preferred_nid, > nodemask_t *nmask, gfp_t gfp_mask)
- [PATCH v9 11/37] mm: page_alloc: move prep_compound_pag... Michael S. Tsirkin
- [PATCH v9 19/37] mm: use __GFP_ZERO in vma_alloc_anon_f... Michael S. Tsirkin
- [PATCH v9 29/37] mm: page_reporting: add flush paramete... Michael S. Tsirkin
- [PATCH v9 16/37] mm: alloc_swap_folio: pass raw fault a... Michael S. Tsirkin
- [PATCH v9 18/37] mm: vma_alloc_anon_folio_pmd: pass raw... Michael S. Tsirkin
- [PATCH v9 25/37] mm: page_alloc: clear PG_zeroed on bud... Michael S. Tsirkin
- [PATCH v9 02/37] mm: memory-failure: serialize TestSetP... Michael S. Tsirkin
- [PATCH v9 28/37] virtio_balloon: disable indirect descr... Michael S. Tsirkin
- [PATCH v9 37/37] virtio_balloon: implement VIRTIO_BALLO... Michael S. Tsirkin
- [PATCH v9 05/37] mm: hugetlb: remove dead alloc_hugetlb... Michael S. Tsirkin
- Re: [PATCH v9 05/37] mm: hugetlb: remove dead allo... Dev Jain
- [PATCH v9 32/37] virtio_balloon: disable reporting zero... Michael S. Tsirkin
- [PATCH v9 33/37] mm: add free_frozen_pages_zeroed Michael S. Tsirkin
- [PATCH v9 08/37] mm: add alloc_contig_frozen_pages_user... Michael S. Tsirkin
- [PATCH v9 10/37] mm: add folio_zero_user stub for confi... Michael S. Tsirkin
- [PATCH v9 04/37] mm: page_reporting: allow driver to se... Michael S. Tsirkin
- [PATCH v9 17/37] mm: use __GFP_ZERO in alloc_anon_folio Michael S. Tsirkin
- [PATCH v9 15/37] mm: alloc_anon_folio: pass raw fault a... Michael S. Tsirkin
- [PATCH v9 23/37] mm: page_alloc: use aliasing checks in... Michael S. Tsirkin
- [PATCH v9 01/37] mm: mempolicy: fix interleave index ca... Michael S. Tsirkin
- [PATCH v9 31/37] virtio_balloon: skip zeroing for host-... Michael S. Tsirkin

