linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: js1304@gmail.com, Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@kernel.org>,
	linux-mm@kvack.org, David Rientjes <rientjes@google.com>,
	Mel Gorman <mgorman@suse.de>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>
Subject: Re: [RFC PATCH 3/5] mm: introduce exponential moving average to unusable free index
Date: Thu, 19 Jan 2017 13:52:38 +0100	[thread overview]
Message-ID: <fbd7ad3f-3ed3-983a-b3d1-b2e72f79cd6a@suse.cz> (raw)
In-Reply-To: <1484291673-2239-4-git-send-email-iamjoonsoo.kim@lge.com>

On 01/13/2017 08:14 AM, js1304@gmail.com wrote:
> From: Joonsoo Kim <iamjoonsoo.kim@lge.com>
> 
> We have a statistic about memory fragmentation but it would be fluctuated
> a lot within very short term so it's hard to accurately measure
> system's fragmentation state while workload is actively running. Without
> stable statistic, it's not possible to determine if the system is
> fragmented or not.
> 
> Meanwhile, recently, there were a lot of reports about fragmentation
> problem and we tried some changes. However, since there is no way
> to measure fragmentation ratio stably, we cannot make sure how these
> changes help the fragmentation.
> 
> There are some methods to measure fragmentation but I think that they
> have some problems.
> 
> 1. buddyinfo: it fluctuated a lot within very short term
> 2. tracepoint: it shows how steal happens between buddylists of different
> migratetype. It means fragmentation indirectly but would not be accurate.
> 3. pageowner: it shows the number of mixed pageblocks but it is not
> suitable for production system since it requires some additional memory.
> 
> Therefore, this patch try to calculate exponential moving average to
> unusable free index. Since it is a moving average, it is quite stable
> even if fragmentation state of memory fluctuate a lot.

I suspect that the fluctuation of the underlying unusable free index
isn't so much because the number of high-order free blocks would
fluctuate, but because of allocation vs reclaim changing the total
number of free blocks, which is used in the equation. Reclaim uses LRU
which I expect to have low correlation with pfn, so the freed pages tend
towards order-0. And the allocation side tries not to split large pages
so it also consumes mostly order-0.

So I would expect just plain free_blocks_order from contig_page_info to
be a good metric without need for averaging, at least for costly orders
and when we have enough free memory - if we are below e.g. the high
(order-0) watermark, then we should let kswapd do its job first anyway
before considering proactive compaction.

> I made this patch 3 month ago and implementation detail looks not
> good to me now. Maybe, it's better to rule out update code in allocation
> path and make it timer based. Anyway, this patch is just for RFC.

Yeah, any hooks in allocation/free hotpaths are going to meet strong
resistance :)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-01-19 12:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-13  7:14 [RFC PATCH 0/5] pro-active compaction js1304
2017-01-13  7:14 ` [RFC PATCH 1/5] mm/vmstat: retrieve suitable free pageblock information just once js1304
2017-01-19 10:47   ` Vlastimil Babka
2017-01-23  3:17     ` Joonsoo Kim
2017-01-19 11:51   ` Michal Hocko
2017-01-19 12:06     ` Vlastimil Babka
2017-01-13  7:14 ` [RFC PATCH 2/5] mm/vmstat: rename variables/functions about buddyinfo js1304
2017-01-13  7:14 ` [RFC PATCH 3/5] mm: introduce exponential moving average to unusable free index js1304
2017-01-19 12:52   ` Vlastimil Babka [this message]
2017-01-23  5:27     ` Joonsoo Kim
2017-01-13  7:14 ` [RFC PATCH 4/5] mm/vmstat: introduce /proc/fraginfo to get fragmentation stat stably js1304
2017-01-13  7:14 ` [RFC PATCH 5/5] mm/compaction: run the compaction whenever fragmentation ratio exceeds the threshold js1304
2017-01-19 13:39   ` Vlastimil Babka
2017-01-13  9:24 ` [RFC PATCH 0/5] pro-active compaction Michal Hocko
2017-01-17  0:48   ` Joonsoo Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fbd7ad3f-3ed3-983a-b3d1-b2e72f79cd6a@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=js1304@gmail.com \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@kernel.org \
    --cc=rientjes@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox