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


Groups > linux.kernel > #1580445

Re: [PATCH v2 04/10] mm, page_alloc: count movable pages when stealing from pageblock

From Xishi Qiu <qiuxishi@huawei.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 04/10] mm, page_alloc: count movable pages when stealing from pageblock
Date 2017-02-14 11:10 +0100
Message-ID <taIdz-sN-5@gated-at.bofh.it> (permalink)
References <t9nXA-6ZO-5@gated-at.bofh.it> <t9nXA-6ZO-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2017/2/11 1:23, Vlastimil Babka wrote:

> When stealing pages from pageblock of a different migratetype, we count how
> many free pages were stolen, and change the pageblock's migratetype if more
> than half of the pageblock was free. This might be too conservative, as there
> might be other pages that are not free, but were allocated with the same
> migratetype as our allocation requested.
> 
> While we cannot determine the migratetype of allocated pages precisely (at
> least without the page_owner functionality enabled), we can count pages that
> compaction would try to isolate for migration - those are either on LRU or
> __PageMovable(). The rest can be assumed to be MIGRATE_RECLAIMABLE or
> MIGRATE_UNMOVABLE, which we cannot easily distinguish. This counting can be
> done as part of free page stealing with little additional overhead.
> 
> The page stealing code is changed so that it considers free pages plus pages
> of the "good" migratetype for the decision whether to change pageblock's
> migratetype.
> 
> The result should be more accurate migratetype of pageblocks wrt the actual
> pages in the pageblocks, when stealing from semi-occupied pageblocks. This
> should help the efficiency of page grouping by mobility.
> 
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>

Hi Vlastimil,

How about these two changes?

1. If we steal some free pages, we will add these page at the head of start_migratetype
list, it will cause more fixed, because these pages will be allocated more easily.
So how about use list_move_tail instead of list_move?

__rmqueue_fallback
	steal_suitable_fallback
		move_freepages_block
			move_freepages
				list_move

2. When doing expand() - list_add(), usually the list is empty, but in the
following case, the list is not empty, because we did move_freepages_block()
before.

__rmqueue_fallback
	steal_suitable_fallback
		move_freepages_block  // move to the list of start_migratetype
	expand  // split the largest order
		list_add  // add to the list of start_migratetype

So how about use list_add_tail instead of list_add? Then we can merge the large
block again as soon as the page freed.

Thanks,
Xishi Qiu

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


Thread

[PATCH v2 04/10] mm, page_alloc: count movable pages when stealing from pageblock Vlastimil Babka <vbabka@suse.cz> - 2017-02-10 19:20 +0100
  Re: [PATCH v2 04/10] mm, page_alloc: count movable pages when  stealing from pageblock Mel Gorman <mgorman@techsingularity.net> - 2017-02-13 12:00 +0100
  Re: [PATCH v2 04/10] mm, page_alloc: count movable pages when stealing  from pageblock Xishi Qiu <qiuxishi@huawei.com> - 2017-02-14 11:10 +0100
    Re: [PATCH v2 04/10] mm, page_alloc: count movable pages when  stealing from pageblock Vlastimil Babka <vbabka@suse.cz> - 2017-02-15 11:50 +0100
      Re: [PATCH v2 04/10] mm, page_alloc: count movable pages when stealing  from pageblock Xishi Qiu <qiuxishi@huawei.com> - 2017-02-15 13:00 +0100
        Re: [PATCH v2 04/10] mm, page_alloc: count movable pages when  stealing from pageblock Vlastimil Babka <vbabka@suse.cz> - 2017-02-17 17:30 +0100
  Re: [PATCH v2 04/10] mm, page_alloc: count movable pages when  stealing from pageblock Johannes Weiner <hannes@cmpxchg.org> - 2017-02-14 19:20 +0100
    Re: [PATCH v2 04/10] mm, page_alloc: count movable pages when  stealing from pageblock Vlastimil Babka <vbabka@suse.cz> - 2017-02-17 17:20 +0100

csiph-web