lkml.org 
[lkml]   [2021]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 6/6] mm/page_alloc.c: avoid allocating highmem pages via alloc_pages_exact_nid()
    On Mon, Aug 30, 2021 at 10:10:51PM +0800, Miaohe Lin wrote:
    > Don't use with __GFP_HIGHMEM because page_address() cannot represent
    > highmem pages without kmap(). Newly allocated pages would leak as
    > page_address() will return NULL for highmem pages here. But It works
    > now because the only caller does not specify __GFP_HIGHMEM now.

    This is a misunderstanding of how alloc_pages_exact() /
    alloc_pages_exact_nid() work. You simply can't call them with
    GFP_HIGHMEM.

    If you really must change anything here,
    s/__GFP_COMP/(__GFP_COMP|__GFP_HIGHMEM)/g throughout both
    alloc_pages_exact() and alloc_pages_exact_nid().

    \
     
     \ /
      Last update: 2021-08-30 16:28    [W:4.514 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site