linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Mel Gorman <mgorman@techsingularity.net>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Christoph Lameter <cl@linux.com>,
	Vlastimil Babka <vbabka@suse.cz>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Linux-MM <linux-mm@kvack.org>,
	Linux-Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: page_alloc: High-order per-cpu page allocator v3
Date: Wed, 30 Nov 2016 15:59:53 +0100	[thread overview]
Message-ID: <20161130145952.GI18432@dhcp22.suse.cz> (raw)
In-Reply-To: <20161130141613.gnf63khbrzrps7ip@techsingularity.net>

On Wed 30-11-16 14:16:13, Mel Gorman wrote:
> On Wed, Nov 30, 2016 at 02:05:50PM +0100, Michal Hocko wrote:
[...]
> > But...  Unless I am missing something this effectively means that we do
> > not exercise high order atomic reserves. Shouldn't we fallback to
> > the locked __rmqueue_smallest(zone, order, MIGRATE_HIGHATOMIC) for
> > order > 0 && ALLOC_HARDER ? Or is this just hidden in some other code
> > path which I am not seeing?
> > 
> 
> Good spot, would this be acceptable to you?

It's not a queen of beauty but it works. A more elegant solution would
require more surgery I guess which is probably not worth it at this
stage.

> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 91dc68c2a717..94808f565f74 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -2609,9 +2609,18 @@ struct page *buffered_rmqueue(struct zone *preferred_zone,
>  				int nr_pages = rmqueue_bulk(zone, order,
>  						pcp->batch, list,
>  						migratetype, cold);
> -				pcp->count += (nr_pages << order);
> -				if (unlikely(list_empty(list)))
> +				if (unlikely(list_empty(list))) {
> +					/*
> +					 * Retry high-order atomic allocs
> +					 * from the buddy list which may
> +					 * use MIGRATE_HIGHATOMIC.
> +					 */
> +					if (order && (alloc_flags & ALLOC_HARDER))
> +						goto try_buddylist;
> +
>  					goto failed;
> +				}
> +				pcp->count += (nr_pages << order);
>  			}
>  
>  			if (cold)
> @@ -2624,6 +2633,7 @@ struct page *buffered_rmqueue(struct zone *preferred_zone,
>  
>  		} while (check_new_pcp(page));
>  	} else {
> +try_buddylist:
>  		/*
>  		 * We most definitely don't want callers attempting to
>  		 * allocate greater than order-1 page units with __GFP_NOFAIL.
> -- 
> 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>

-- 
Michal Hocko
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:[~2016-11-30 14:59 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-27 13:19 [PATCH] mm: page_alloc: High-order per-cpu page allocator v3 Mel Gorman
2016-11-28 11:00 ` Vlastimil Babka
2016-11-28 11:45   ` Mel Gorman
2016-11-30  8:55   ` Mel Gorman
2016-11-28 15:39 ` Christoph Lameter
2016-11-28 16:21   ` Mel Gorman
2016-11-28 16:38     ` Christoph Lameter
2016-11-28 18:47       ` Mel Gorman
2016-11-28 18:54         ` Christoph Lameter
2016-11-28 20:59           ` Vlastimil Babka
2016-11-28 19:54 ` Johannes Weiner
2016-11-30 12:40 ` Jesper Dangaard Brouer
2016-11-30 14:06   ` Mel Gorman
2016-11-30 15:06     ` Jesper Dangaard Brouer
2016-11-30 16:35       ` Mel Gorman
2016-12-01 17:34         ` Jesper Dangaard Brouer
2016-12-01 22:17           ` Paolo Abeni
2016-12-02 15:37             ` Jesper Dangaard Brouer
2016-12-02 15:44               ` Paolo Abeni
2016-11-30 13:05 ` Michal Hocko
2016-11-30 14:16   ` Mel Gorman
2016-11-30 14:59     ` Michal Hocko [this message]

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=20161130145952.GI18432@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).