On Thu, Oct 29, 2020 at 07:33:48PM +0000, Matthew Wilcox (Oracle) wrote: > +static inline bool thp_last_tail(struct page *head, pgoff_t index) > +{ > + if (!PageTransCompound(head) || PageHuge(head)) > + return true; Do we need the branch? It's going to be reduced to index == head->index for non-THP anyway. It should be fine, right? > + return index == head->index + thp_nr_pages(head) - 1; > +} > + It's true for non-THP, so name is somewhat misleading. Maybe is_last_subpage() or something? -- Kirill A. Shutemov