On Tue 28-11-17 15:12:11, Michal Hocko wrote: [...] > +/* > + * Internal hugetlb specific page flag. Do not use outside of the hugetlb > + * code > + */ > +static inline bool PageHugeTemporary(struct page *page) > +{ > + if (!PageHuge(page)) > + return false; > + > + return page[2].flags == -1U; > +} > + > +static inline void SetPageHugeTemporary(struct page *page) > +{ > + page[2].flags = -1U; > +} > + > +static inline void ClearPageHugeTemporary(struct page *page) > +{ > + page[2].flags = 0; > +} Ups, this is obviously not OK. I was just lucky to not hit BUG_ONs because I am clearly overwriting node/zone data in flags. I will have to find something else to abuse. I will go with my favorite mapping pointer which is not used at all. --- diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 1be43563e226..db7544a0b7b6 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1259,17 +1259,17 @@ static inline bool PageHugeTemporary(struct page *page) if (!PageHuge(page)) return false; - return page[2].flags == -1U; + return page[2].mapping == -1U; } static inline void SetPageHugeTemporary(struct page *page) { - page[2].flags = -1U; + page[2].mapping = -1U; } static inline void ClearPageHugeTemporary(struct page *page) { - page[2].flags = 0; + page[2].mapping = NULL; } void free_huge_page(struct page *page) -- Michal Hocko SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>