lkml.org 
[lkml]   [2014]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 10/10] mm/page_alloc: Stop merging pages on non-isolate and isolate buddy list
    Date
    If we merge pages on non-isolate buddy list and isolate buddy list,
    respectively, we should fixup freepage count, because we don't regard
    pages in isolate buddy list as freepage. But this will impose some
    overhead on __free_one_page() which is core function of page free path
    so this overhead looks undesirable to me. Instead, we can stop merging
    in this case. With this approach, we can skip to fixup freepage count
    with low overhead.

    The side-effect of this change is that some buddies equal or larger than
    pageblock order isn't merged if one of buddy is on isolate pageblock. But,
    I think that this is no problem, because isolation means that we will use
    page on isolate pageblock specially, so it will split soon in any case.

    Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
    ---
    mm/page_alloc.c | 18 ++++++++++++++++++
    1 file changed, 18 insertions(+)

    diff --git a/mm/page_alloc.c b/mm/page_alloc.c
    index 80c9bd8..da4da66 100644
    --- a/mm/page_alloc.c
    +++ b/mm/page_alloc.c
    @@ -648,6 +648,24 @@ static inline void __free_one_page(struct page *page,
    break;

    /*
    + * Stop merging between page on non-isolate buddy list and
    + * isolate buddy list, respectively. This case is only possible
    + * for pages equal or larger than pageblock_order, because
    + * pageblock migratetype can be changed in this granularity.
    + */
    + if (unlikely(order >= pageblock_order &&
    + has_isolate_pageblock(zone))) {
    + int buddy_mt = get_onbuddy_migratetype(buddy);
    +
    + if (migratetype != buddy_mt) {
    + if (is_migrate_isolate(migratetype))
    + break;
    + else if (is_migrate_isolate(buddy_mt))
    + break;
    + }
    + }
    +
    + /*
    * Our buddy is free or it is CONFIG_DEBUG_PAGEALLOC guard page,
    * merge with it and move up one order.
    */
    --
    1.7.9.5


    \
     
     \ /
      Last update: 2014-07-04 18:21    [W:4.117 / U:0.332 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site