[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5165F508.4020207@linux.vnet.ibm.com>
Date: Wed, 10 Apr 2013 16:26:00 -0700
From: Cody P Schafer <cody@...ux.vnet.ibm.com>
To: "Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
CC: akpm@...ux-foundation.org, mgorman@...e.de,
matthew.garrett@...ula.com, dave@...1.net, rientjes@...gle.com,
riel@...hat.com, arjan@...ux.intel.com,
srinivas.pandruvada@...ux.intel.com,
maxime.coquelin@...ricsson.com, loic.pallardy@...ricsson.com,
kamezawa.hiroyu@...fujitsu.com, lenb@...nel.org, rjw@...k.pl,
gargankita@...il.com, paulmck@...ux.vnet.ibm.com,
amit.kachhap@...aro.org, svaidy@...ux.vnet.ibm.com,
andi@...stfloor.org, wujianguo@...wei.com, kmpark@...radead.org,
thomas.abraham@...aro.org, santosh.shilimkar@...com,
linux-pm@...r.kernel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH v2 14/15] mm: Add alloc-free handshake to trigger
memory region compaction
On 04/09/2013 02:48 PM, Srivatsa S. Bhat wrote:
> We need a way to decide when to trigger the worker threads to perform
> region evacuation/compaction. So the strategy used is as follows:
>
> Alloc path of page allocator:
> ----------------------------
>
> This accurately tracks the allocations and detects the first allocation
> in a new region and notes down that region number. Performing compaction
> rightaway is not going to be helpful because we need free pages in the
> lower regions to be able to do that. And the page allocator allocated in
> this region precisely because there was no memory available in lower regions.
> So the alloc path just notes down the freshly used region's id.
>
> Free path of page allocator:
> ---------------------------
>
> When we enter this path, we know that some memory is being freed. Here we
> check if the alloc path had noted down any region for compaction. If so,
> we trigger the worker function that tries to compact that memory.
>
> Also, we avoid any locking/synchronization overhead over this worker
> function in the alloc/free path, by attaching appropriate semantics to the
> available status flags etc, such that we won't need any special locking
> around them.
>
Can you explain why avoiding locking works in this case?
It appears the lack of locking is only on the worker side, and the
mem_power_ctrl is implicitly protected by zone->lock on the alloc & free
side.
In the previous patch I see smp_mb(), but no explanation is provided for
why they are needed. Are they related to/necessary for this lack of locking?
What happens when a region is passed over for compaction because the
worker is already compacting another region? Can this occur? Will the
compaction re-trigger appropriately?
I recommend combining this patch and the previous patch to make the
interface more clear, or make functions that explicitly handle the
interface for accessing mem_power_ctrl.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists