lkml.org 
[lkml]   [2023]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH mm-unstable 3/8] mm/hugetlb: convert dequeue_hugetlb_page_node functions to folios
    On Tue, Jan 03, 2023 at 01:13:35PM -0600, Sidhartha Kumar wrote:
    > +static struct folio *dequeue_hugetlb_folio_node_exact(struct hstate *h,
    > + int nid)
    > {
    > struct page *page;
    > + struct folio *folio;
    > bool pin = !!(current->flags & PF_MEMALLOC_PIN);
    >
    > lockdep_assert_held(&hugetlb_lock);
    > list_for_each_entry(page, &h->hugepage_freelists[nid], lru) {
    > - if (pin && !is_longterm_pinnable_page(page))
    > + folio = page_folio(page);

    I'd argue that you can pull folios directly off the hugepage_freelists.
    Since they're attached through the 'lru', you know they're not tail
    pages, because lru.prev aliases with compound_head.

    The rest looks good.

    \
     
     \ /
      Last update: 2023-03-26 23:26    [W:4.355 / U:0.468 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site