linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: Mel Gorman <mgorman@suse.de>
Cc: linux-mm@kvack.org, Michal Nazarewicz <mina86@mina86.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>
Subject: Re: [PATCH] cma: cached pageblock type fixup
Date: Tue, 19 Jun 2012 13:28:50 +0200	[thread overview]
Message-ID: <201206191328.50781.b.zolnierkie@samsung.com> (raw)
In-Reply-To: <20120619090015.GE20467@suse.de>

On Tuesday 19 June 2012 11:00:15 Mel Gorman wrote:
> On Wed, May 23, 2012 at 09:22:00AM +0200, Bartlomiej Zolnierkiewicz wrote:
> > From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> > Subject: [PATCH] cma: cached pageblock type fixup
> > 
> > CMA pages added to per-cpu pages lists in free_hot_cold_page()
> > have private field set to MIGRATE_CMA pageblock type .  If this
> > happes just before start_isolate_page_range() in alloc_contig_range()
> > changes pageblock type of the page to MIGRATE_ISOLATE it may result
> > in the cached pageblock type being stale in free_pcppages_bulk()
> > (which may be triggered by drain_all_pages() in alloc_contig_range()),
> 
> So what?

"page being added to MIGRATE_CMA free list instead of MIGRATE_ISOLATE
one in __free_one_page() and (if the page is reused just before
test_pages_isolated() check) causing alloc_contig_range() failure."

> The pages get freed to the MIGRATE_CMA region. At worst they will be
> used for an allocation request that is compatible with being migrated by
> CMA. This will delay the allocation time of alloc_contig_range() but is
> hardly critical.

There is no waiting on MIGRATE_CMA pages in alloc_contig_range() to
become free again.  If the conversion to MIGRATE_ISOLATE fails then
the whole alloc_contig_range() allocation fails on test_pages_isolated()
check.

> Your fix on the other hand adds another call to get_pageblock_type() to
> free_pcppages_bulk which is expensive. The change made to
> buffered_rmqueue() is horrific. It takes the per-cpu page allocation
> path and adds a spin lock to it which completely defeats the purpose of
> having the per-cpu allocation avoid taking locks. This will have a very
> heavy impact on performance, particularly on parallel workloads.
> 
> As the impact of the race should be marginal and the cost of the fix is
> so unbelivably high I'm nacking this patch. If this race is a problem then
> it should be handled in alloc_contig_range() not in the allocator fast paths.

Do you have any idea how this race can be handled in alloc_contig_range()?

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung Poland R&D Center

--
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:[~2012-06-19 11:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-23  7:22 Bartlomiej Zolnierkiewicz
2012-06-14 13:19 ` Marek Szyprowski
2012-06-19  9:00 ` Mel Gorman
2012-06-19 11:28   ` Bartlomiej Zolnierkiewicz [this message]
2012-06-19 12:00     ` Mel Gorman
2012-06-19 13:04       ` Bartlomiej Zolnierkiewicz
2012-06-19 16:26         ` 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=201206191328.50781.b.zolnierkie@samsung.com \
    --to=b.zolnierkie@samsung.com \
    --cc=linux-mm@kvack.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mgorman@suse.de \
    --cc=mina86@mina86.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