lkml.org 
[lkml]   [2009]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [PATCH 07/22] Calculate the preferred zone for allocation only once
    On Wed, 22 Apr 2009 14:53:12 +0100
    Mel Gorman <mel@csn.ul.ie> wrote:

    > get_page_from_freelist() can be called multiple times for an allocation.
    > Part of this calculates the preferred_zone which is the first usable zone
    > in the zonelist but the zone depends on the GFP flags specified at the
    > beginning of the allocation call. This patch calculates preferred_zone
    > once. It's safe to do this because if preferred_zone is NULL at the start
    > of the call, no amount of direct reclaim or other actions will change the
    > fact the allocation will fail.
    >
    >
    > ...
    >
    > - (void)first_zones_zonelist(zonelist, high_zoneidx, nodemask,
    > -
    > &preferred_zone);
    > ...
    >
    > + /* The preferred zone is used for statistics later */
    > + (void)first_zones_zonelist(zonelist, high_zoneidx, nodemask,

    Let's quietly zap that dopey cast.

    --- a/mm/page_alloc.c~page-allocator-calculate-the-preferred-zone-for-allocation-only-once-fix
    +++ a/mm/page_alloc.c
    @@ -1775,8 +1775,7 @@ __alloc_pages_nodemask(gfp_t gfp_mask, u
    return NULL;

    /* The preferred zone is used for statistics later */
    - (void)first_zones_zonelist(zonelist, high_zoneidx, nodemask,
    - &preferred_zone);
    + first_zones_zonelist(zonelist, high_zoneidx, nodemask, &preferred_zone);
    if (!preferred_zone)
    return NULL;

    _


    \
     
     \ /
      Last update: 2009-04-24 00:57    [W:0.024 / U:2.432 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site