On Mon, 13 May 2019 15:43:08 +0300 Kirill Tkhai <ktkhai@xxxxxxxxxxxxx> wrote: > > +/* > > + * Returns the number of bytes in this potentially compound page. > > + * Must be called with the head page, not a tail page. > > + */ > > +static inline unsigned long page_size(struct page *page) > > +{ > > Maybe we should underline commented head page limitation with VM_BUG_ON()? VM_WARN_ONCE() if poss, please. The code bloatage from that is likely to be distressing. Perhaps adding an out-of-line compound_order_head_only() for this reason would help. In which case, just uninline the whole thing... > + return (unsigned long)PAGE_SIZE << compound_order(page); > + } Also, I suspect the cast here is unneeded. Architectures used to differe in the type of PAGE_SIZE but please tell me that's been fixed for a lomng time...