lkml.org 
[lkml]   [2022]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4/7] mm/page_alloc: Remove mistaken page == NULL check in rmqueue
    Date
    If a page allocation fails, the ZONE_BOOSTER_WATERMARK should be tested,
    cleared and kswapd woken whether the allocation attempt was via the PCP
    or directly via the buddy list.

    Remove the page == NULL so the ZONE_BOOSTED_WATERMARK bit is checked
    unconditionally. As it is unlikely that ZONE_BOOSTED_WATERMARK is set,
    mark the branch accordingly.

    Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
    Acked-by: Vlastimil Babka <vbabka@suse.cz>
    ---
    mm/page_alloc.c | 4 +---
    1 file changed, 1 insertion(+), 3 deletions(-)

    diff --git a/mm/page_alloc.c b/mm/page_alloc.c
    index 44d198af4b35..7fb262eeec2f 100644
    --- a/mm/page_alloc.c
    +++ b/mm/page_alloc.c
    @@ -3777,12 +3777,10 @@ struct page *rmqueue(struct zone *preferred_zone,

    page = rmqueue_buddy(preferred_zone, zone, order, alloc_flags,
    migratetype);
    - if (unlikely(!page))
    - return NULL;

    out:
    /* Separate test+clear to avoid unnecessary atomics */
    - if (test_bit(ZONE_BOOSTED_WATERMARK, &zone->flags)) {
    + if (unlikely(test_bit(ZONE_BOOSTED_WATERMARK, &zone->flags))) {
    clear_bit(ZONE_BOOSTED_WATERMARK, &zone->flags);
    wakeup_kswapd(zone, 0, 0, zone_idx(zone));
    }
    --
    2.35.3
    \
     
     \ /
      Last update: 2022-06-13 19:37    [W:2.125 / U:0.084 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site