Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1248676

Re: [PATCH] mm: reset migratetype if the range spans two pageblocks

From Vlastimil Babka <vbabka@suse.cz>
Newsgroups linux.kernel
Subject Re: [PATCH] mm: reset migratetype if the range spans two pageblocks
Date 2015-10-16 14:10 +0200
Message-ID <qkbZE-5OX-17@gated-at.bofh.it> (permalink)
References <qka7w-31d-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 10/16/2015 12:06 PM, Xishi Qiu wrote:
> __rmqueue_fallback() will change the migratetype of pageblock,
> so it is possible that two continuous pageblocks have different
> migratetypes.
>
> When freeing all pages of the two blocks, they will be merged
> to 4M, and added to the buddy list which the migratetype is the
> first pageblock's.
>
> If later alloc some pages and split the 4M, the second pageblock
> will be added to the buddy list, and the migratetype is the first
> pageblock's, so it is different from the its pageblock's.
>
> That means the page in buddy list's migratetype is different from
> the page in pageblock's migratetype. This will make confusion.

So what will be the bad effects of this confusion? There are many 
situations where a free page (of any size) will be on different list 
than the pageblock's migratetype.

In case of full free pageblock, it IIRC doesn't really matter on which 
freelist it is, as the fallback scenarios for all migratetypes are 
trivial and non-fragmenting (just grab the whole pageblock, which means 
the migratetype is updated).

Maybe compaction will get it wrong when deciding which pageblocks are 
suitable for scanning, but that's not critical.

> However,if we change the hotpath, it will be performance degradation,
> so any better ideas?

I don't see immediately a way to fix that outside of hotpath, and don't 
see the reasons being strong enough to fix it in the hotpath.

>
> Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
> ---
>   mm/page_alloc.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 48aaf7b..5c91348 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -726,6 +726,9 @@ static inline void __free_one_page(struct page *page,
>   	list_add(&page->lru, &zone->free_area[order].free_list[migratetype]);
>   out:
>   	zone->free_area[order].nr_free++;
> +	/* If the range spans two pageblocks, reset the migratetype. */
> +	if (order > pageblock_order)
> +		change_pageblock_range(page, order, migratetype);
>   }
>
>   static inline int free_pages_check(struct page *page)
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] mm: reset migratetype if the range spans two pageblocks Xishi Qiu <qiuxishi@huawei.com> - 2015-10-16 12:10 +0200
  Re: [PATCH] mm: reset migratetype if the range spans two pageblocks Xishi Qiu <qiuxishi@huawei.com> - 2015-10-16 12:20 +0200
  Re: [PATCH] mm: reset migratetype if the range spans two pageblocks kbuild test robot <lkp@intel.com> - 2015-10-16 13:10 +0200
  Re: [PATCH] mm: reset migratetype if the range spans two pageblocks Vlastimil Babka <vbabka@suse.cz> - 2015-10-16 14:10 +0200

csiph-web