On Thu, Apr 21, 2022 at 01:02:25PM -0700, Andrew Morton wrote: > On Thu, 21 Apr 2022 15:51:03 -0400 Peter Xu wrote: > > > > - * file-backed memory. This should only be specified when we will completely > > > - * drop the page in the mm, either by truncation or unmapping of the vma. By > > > - * default, the flag is not set. > > > - */ > > > -#define ZAP_FLAG_DROP_MARKER ((__force zap_flags_t) BIT(0)) > > > - > > > #endif /* _LINUX_MM_H */ > > > _ > > > > > > > Andrew, > > > > It may work, but I have worry that zap_flags_t should still be a common > > struct for mm not hugetlb specific, let's say it's still legal some .c file > > wants to reference it without hugetlb knowledge? > > > > >From that POV, could we perhaps move these chunk into mm_types.h (which > > hugetlb.h includes anyway)? > > > > Sure. ZAP_FLAG_DROP_MARKER isn't a type so how about we leave that in > mm.h? Sounds good, thanks! > > > --- a/include/linux/mm.h~mm-hugetlb-only-drop-uffd-wp-special-pte-if-required-fix-fix > +++ a/include/linux/mm.h > @@ -3431,8 +3431,6 @@ madvise_set_anon_name(struct mm_struct * > } > #endif > > -typedef unsigned int __bitwise zap_flags_t; > - > /* > * Whether to drop the pte markers, for example, the uffd-wp information for > * file-backed memory. This should only be specified when we will completely > --- a/include/linux/mm_types.h~mm-hugetlb-only-drop-uffd-wp-special-pte-if-required-fix-fix > +++ a/include/linux/mm_types.h > @@ -850,4 +850,6 @@ enum fault_flag { > FAULT_FLAG_ORIG_PTE_VALID = 1 << 11, > }; > > +typedef unsigned int __bitwise zap_flags_t; > + > #endif /* _LINUX_MM_TYPES_H */ > _ > -- Peter Xu