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


Groups > linux.kernel > #1429910

Re: [PATCH v2 12/18] mm, compaction: more reliably increase direct compaction priority

Path csiph.com!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Vlastimil Babka <vbabka@suse.cz>
Newsgroups linux.kernel
Subject Re: [PATCH v2 12/18] mm, compaction: more reliably increase direct compaction priority
Date Thu, 23 Jun 2016 16:50:01 +0200
Message-ID <rNe77-2X7-3@gated-at.bofh.it> (permalink)
References <rERAJ-38J-1@gated-at.bofh.it> <rERKq-3dI-21@gated-at.bofh.it> <rFeQG-Fc-19@gated-at.bofh.it>
X-Original-To Michal Hocko <mhocko@kernel.org>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1
MIME-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 47
Organization linux.* mail to news gateway
X-Original-Cc Andrew Morton <akpm@linux-foundation.org>, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mel Gorman <mgorman@techsingularity.net>, Joonsoo Kim <iamjoonsoo.kim@lge.com>, David Rientjes <rientjes@google.com>, Rik van Riel <riel@redhat.com>
X-Original-Date Thu, 23 Jun 2016 16:41:53 +0200
X-Original-Message-ID <977bc795-d2e7-ee7b-df2e-a30ce5cf15cc@suse.cz>
X-Original-References <20160531130818.28724-1-vbabka@suse.cz> <20160531130818.28724-13-vbabka@suse.cz> <20160601135124.GS26601@dhcp22.suse.cz>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1429910

Show key headers only | View raw


On 06/01/2016 03:51 PM, Michal Hocko wrote:
> On Tue 31-05-16 15:08:12, Vlastimil Babka wrote:
>> During reclaim/compaction loop, compaction priority can be increased by the
>> should_compact_retry() function, but the current code is not optimal. Priority
>> is only increased when compaction_failed() is true, which means that compaction
>> has scanned the whole zone. This may not happen even after multiple attempts
>> with the lower priority due to parallel activity, so we might needlessly
>> struggle on the lower priority.
>>
>> We can remove these corner cases by increasing compaction priority regardless
>> of compaction_failed(). Examining further the compaction result can be
>> postponed only after reaching the highest priority. This is a simple solution
>> and we don't need to worry about reaching the highest priority "too soon" here,
>> because hen should_compact_retry() is called it means that the system is
>> already struggling and the allocation is supposed to either try as hard as
>> possible, or it cannot fail at all. There's not much point staying at lower
>> priorities with heuristics that may result in only partial compaction.
>>
>> The only exception here is the COMPACT_SKIPPED result, which means that
>> compaction could not run at all due to being below order-0 watermarks. In that
>> case, don't increase compaction priority, and check if compaction could proceed
>> when everything reclaimable was reclaimed. Before this patch, this was tied to
>> compaction_withdrawn(), but the other results considered there are in fact only
>> possible due to low compaction priority so we can ignore them thanks to the
>> patch. Since there are no other callers of compaction_withdrawn(), remove it.
>
> I agree with the change in general. I think that keeping compaction_withdrawn
> even with a single check is better because it abstracts the fact from a
> specific constant.

OK.

> Now that I think about that some more I guess you also want to update
> compaction_retries inside should_compact_retry as well, or at least
> update it only when we have reached the lowest priority. What do you
> think?

Makes sense, especially that after your suggestion, 
should_compact_retry() is not reached as long as should_reclaim_retry() 
returnes true. So I will do that.

>> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
>
> Other than that this makes sense
> Acked-by: Michal Hocko <mhocko@suse.com>

Thanks!

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


Thread

Re: [PATCH v2 12/18] mm, compaction: more reliably increase direct  compaction priority Vlastimil Babka <vbabka@suse.cz> - 2016-06-23 16:50 +0200

csiph-web