lkml.org 
[lkml]   [2020]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 06/25] mm: Allow hpages to be arbitrary order
On Thu, Feb 13, 2020 at 05:11:07PM +0300, Kirill A. Shutemov wrote:
> On Tue, Feb 11, 2020 at 08:18:26PM -0800, Matthew Wilcox wrote:
> > From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
> >
> > Remove the assumption in hpage_nr_pages() that compound pages are
> > necessarily PMD sized. The return type needs to be signed as we need
> > to use the negative value, eg when calling update_lru_size().
>
> But should it be long?
> Any reason to use macros instead of inline function?

Huh, that does look like a bit of a weird change now you point it out.
I'll change it back:

static inline int hpage_nr_pages(struct page *page)
{
- if (unlikely(PageTransHuge(page)))
- return HPAGE_PMD_NR;
- return 1;
+ return compound_nr(page);
}

\
 
 \ /
  Last update: 2020-02-13 15:31    [W:0.046 / U:17.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site