public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-mm:;
Subject: Re: [PATCH v5 02/14] mm, compaction: defer each zone individually instead of preferred zone
Date: Tue, 29 Jul 2014 11:02:08 +0200	[thread overview]
Message-ID: <53D76310.6000006@suse.cz> (raw)
In-Reply-To: <alpine.DEB.2.02.1407281649570.8998@chino.kir.corp.google.com>

On 07/29/2014 01:59 AM, David Rientjes wrote:
>> --- a/mm/compaction.c
>> +++ b/mm/compaction.c
>> @@ -1122,28 +1122,27 @@ int sysctl_extfrag_threshold = 500;
>>    * @nodemask: The allowed nodes to allocate from
>>    * @mode: The migration mode for async, sync light, or sync migration
>>    * @contended: Return value that is true if compaction was aborted due to lock contention
>> - * @page: Optionally capture a free page of the requested order during compaction
>
> Never noticed this non-existant formal before.

It's a leftover from the first Mel's page capture attempt that was 
partially reverted.

>> + * @candidate_zone: Return the zone where we think allocation should succeed
>>    *
>>    * This is the main entry point for direct page compaction.
>>    */
>>   unsigned long try_to_compact_pages(struct zonelist *zonelist,
>>   			int order, gfp_t gfp_mask, nodemask_t *nodemask,
>> -			enum migrate_mode mode, bool *contended)
>> +			enum migrate_mode mode, bool *contended,
>> +			struct zone **candidate_zone)
>>   {
>>   	enum zone_type high_zoneidx = gfp_zone(gfp_mask);
>>   	int may_enter_fs = gfp_mask & __GFP_FS;
>>   	int may_perform_io = gfp_mask & __GFP_IO;
>>   	struct zoneref *z;
>>   	struct zone *zone;
>> -	int rc = COMPACT_SKIPPED;
>> +	int rc = COMPACT_DEFERRED;
>>   	int alloc_flags = 0;
>>
>>   	/* Check if the GFP flags allow compaction */
>>   	if (!order || !may_enter_fs || !may_perform_io)
>>   		return rc;
>>
>
> It doesn't seem right that if we called try_to_compact_pages() in a
> context where it is useless (order-0 or non-GFP_KERNEL allocation) that we
> would return COMPACT_DEFERRED.  I think the existing semantics before the
> patch, that is
>
>   - deferred: compaction was tried but failed, so avoid subsequent calls in
>     the near future that may be potentially expensive, and
>
>   - skipped: compaction wasn't tried because it will be useless
>
> is correct and deferred shouldn't take on another meaning, which now will
> set deferred_compaction == true in the page allocator.  It probably
> doesn't matter right now because the only check of deferred_compaction is
> effective for __GFP_NO_KSWAPD, i.e. it is both high-order and GFP_KERNEL,
> but it seems returning COMPACT_SKIPPED here would also work fine and be
> more appropriate.

You're right. That was an oversight, not intention. Thanks for catching 
that.


  reply	other threads:[~2014-07-29  9:02 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-28 13:11 [PATCH v5 00/14] compaction: balancing overhead and success rates Vlastimil Babka
2014-07-28 13:11 ` [PATCH v5 01/14] mm, THP: don't hold mmap_sem in khugepaged when allocating THP Vlastimil Babka
2014-07-28 23:39   ` David Rientjes
2014-07-28 13:11 ` [PATCH v5 02/14] mm, compaction: defer each zone individually instead of preferred zone Vlastimil Babka
2014-07-28 23:59   ` David Rientjes
2014-07-29  9:02     ` Vlastimil Babka [this message]
2014-07-29  6:38   ` Joonsoo Kim
2014-07-29  9:12     ` Vlastimil Babka
2014-07-30 16:22       ` Vlastimil Babka
2014-08-01  8:51         ` Vlastimil Babka
2014-08-04  6:45           ` Joonsoo Kim
2014-07-28 13:11 ` [PATCH v5 03/14] mm, compaction: do not count compact_stall if all zones skipped compaction Vlastimil Babka
2014-07-29  0:04   ` David Rientjes
2014-07-28 13:11 ` [PATCH v5 04/14] mm, compaction: do not recheck suitable_migration_target under lock Vlastimil Babka
2014-07-28 13:11 ` [PATCH v5 05/14] mm, compaction: move pageblock checks up from isolate_migratepages_range() Vlastimil Babka
2014-07-29  0:29   ` David Rientjes
2014-07-29  9:27     ` Vlastimil Babka
2014-07-29 23:02       ` David Rientjes
2014-07-29 23:21         ` Kirill A. Shutemov
2014-07-29 23:51           ` David Rientjes
2014-07-30  9:27             ` Vlastimil Babka
2014-07-30  9:39         ` Vlastimil Babka
2014-07-28 13:11 ` [PATCH v5 06/14] mm, compaction: reduce zone checking frequency in the migration scanner Vlastimil Babka
2014-07-29  0:44   ` David Rientjes
2014-07-29  9:31     ` Vlastimil Babka
2014-07-28 13:11 ` [PATCH v5 07/14] mm, compaction: khugepaged should not give up due to need_resched() Vlastimil Babka
2014-07-29  0:59   ` David Rientjes
2014-07-29  9:45     ` Vlastimil Babka
2014-07-29 22:57       ` David Rientjes
2014-07-29  6:53   ` Joonsoo Kim
2014-07-29  7:31     ` David Rientjes
2014-07-29  8:27       ` Joonsoo Kim
2014-07-29  9:16         ` David Rientjes
2014-07-29  9:49       ` Vlastimil Babka
2014-07-29 22:53         ` David Rientjes
2014-07-30  9:08           ` Vlastimil Babka
2014-07-28 13:11 ` [PATCH v5 08/14] mm, compaction: periodically drop lock and restore IRQs in scanners Vlastimil Babka
2014-07-29  1:03   ` David Rientjes
2014-07-28 13:11 ` [PATCH v5 09/14] mm, compaction: skip rechecks when lock was already held Vlastimil Babka
2014-07-28 13:11 ` [PATCH v5 10/14] mm, compaction: remember position within pageblock in free pages scanner Vlastimil Babka
2014-07-28 13:11 ` [PATCH v5 11/14] mm, compaction: skip buddy pages by their order in the migrate scanner Vlastimil Babka
2014-07-29  1:05   ` David Rientjes
2014-07-28 13:11 ` [PATCH v5 12/14] mm: rename allocflags_to_migratetype for clarity Vlastimil Babka
2014-07-28 13:11 ` [PATCH v5 13/14] mm, compaction: pass gfp mask to compact_control Vlastimil Babka
2014-07-28 13:11 ` [PATCH v5 14/14] mm, compaction: try to capture the just-created high-order freepage Vlastimil Babka
2014-07-29  7:34   ` Joonsoo Kim
2014-07-29 15:34     ` Vlastimil Babka
2014-07-30  8:39       ` Joonsoo Kim
2014-07-30  9:56         ` Vlastimil Babka
2014-07-30 14:19           ` Joonsoo Kim
2014-07-30 15:05             ` Vlastimil Babka

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=53D76310.6000006@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.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