All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mel Gorman <mgorman@techsingularity.net>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Rik van Riel <riel@redhat.com>,
	David Rientjes <rientjes@google.com>,
	Johannes Weiner <hannes@cmpxchg.org>
Subject: Re: [PATCH] mm, page_alloc: fix potential false positive in __zone_watermark_ok
Date: Thu, 2 Nov 2017 13:23:20 +0000	[thread overview]
Message-ID: <20171102132320.c5gvc3xttguklwwi@techsingularity.net> (raw)
In-Reply-To: <20171102125001.23708-1-vbabka@suse.cz>

On Thu, Nov 02, 2017 at 01:50:01PM +0100, Vlastimil Babka wrote:
> Since commit 97a16fc82a7c ("mm, page_alloc: only enforce watermarks for order-0
> allocations"), __zone_watermark_ok() check for high-order allocations will
> shortcut per-migratetype free list checks for ALLOC_HARDER allocations, and
> return true as long as there's free page of any migratetype. The intention is
> that ALLOC_HARDER can allocate from MIGRATE_HIGHATOMIC free lists, while normal
> allocations can't.
> 
> However, as a side effect, the watermark check will then also return true when
> there are pages only on the MIGRATE_ISOLATE list, or (prior to CMA conversion
> to ZONE_MOVABLE) on the MIGRATE_CMA list. Since the allocation cannot actually
> obtain isolated pages, and might not be able to obtain CMA pages, this can
> result in a false positive.
> 
> The condition should be rare and perhaps the outcome is not a fatal one. Still,
> it's better if the watermark check is correct. There also shouldn't be a
> performance tradeoff here.
> 
> Fixes: 97a16fc82a7c ("mm, page_alloc: only enforce watermarks for order-0 allocations")
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>

That outcome shouldn't be fatal or even misleading as the subsequent
allocation attempt should fail due to not finding pages on an
appropriate list. Still, as you say, the watermark check should not be
misleading.

Acked-by: Mel Gorman <mgorman@techsingularity.net>

-- 
Mel Gorman
SUSE Labs

WARNING: multiple messages have this Message-ID (diff)
From: Mel Gorman <mgorman@techsingularity.net>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Rik van Riel <riel@redhat.com>,
	David Rientjes <rientjes@google.com>,
	Johannes Weiner <hannes@cmpxchg.org>
Subject: Re: [PATCH] mm, page_alloc: fix potential false positive in __zone_watermark_ok
Date: Thu, 2 Nov 2017 13:23:20 +0000	[thread overview]
Message-ID: <20171102132320.c5gvc3xttguklwwi@techsingularity.net> (raw)
In-Reply-To: <20171102125001.23708-1-vbabka@suse.cz>

On Thu, Nov 02, 2017 at 01:50:01PM +0100, Vlastimil Babka wrote:
> Since commit 97a16fc82a7c ("mm, page_alloc: only enforce watermarks for order-0
> allocations"), __zone_watermark_ok() check for high-order allocations will
> shortcut per-migratetype free list checks for ALLOC_HARDER allocations, and
> return true as long as there's free page of any migratetype. The intention is
> that ALLOC_HARDER can allocate from MIGRATE_HIGHATOMIC free lists, while normal
> allocations can't.
> 
> However, as a side effect, the watermark check will then also return true when
> there are pages only on the MIGRATE_ISOLATE list, or (prior to CMA conversion
> to ZONE_MOVABLE) on the MIGRATE_CMA list. Since the allocation cannot actually
> obtain isolated pages, and might not be able to obtain CMA pages, this can
> result in a false positive.
> 
> The condition should be rare and perhaps the outcome is not a fatal one. Still,
> it's better if the watermark check is correct. There also shouldn't be a
> performance tradeoff here.
> 
> Fixes: 97a16fc82a7c ("mm, page_alloc: only enforce watermarks for order-0 allocations")
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>

That outcome shouldn't be fatal or even misleading as the subsequent
allocation attempt should fail due to not finding pages on an
appropriate list. Still, as you say, the watermark check should not be
misleading.

Acked-by: Mel Gorman <mgorman@techsingularity.net>

-- 
Mel Gorman
SUSE Labs

--
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-11-02 13:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-02 12:50 [PATCH] mm, page_alloc: fix potential false positive in __zone_watermark_ok Vlastimil Babka
2017-11-02 12:50 ` Vlastimil Babka
2017-11-02 13:23 ` Mel Gorman [this message]
2017-11-02 13:23   ` Mel Gorman

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=20171102132320.c5gvc3xttguklwwi@techsingularity.net \
    --to=mgorman@techsingularity.net \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=riel@redhat.com \
    --cc=rientjes@google.com \
    --cc=vbabka@suse.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.