Re: [PATCH] hotplug: Optimize {get,put}_online_cpus()

2013-10-02 Thread Srivatsa S. Bhat
On 10/01/2013 11:44 PM, Srivatsa S. Bhat wrote: > On 10/01/2013 11:06 PM, Peter Zijlstra wrote: >> On Tue, Oct 01, 2013 at 10:41:15PM +0530, Srivatsa S. Bhat wrote: >>> However, as Oleg said, its definitely worth considering whether this >>> proposed >>> cha

Re: [PATCH] hotplug: Optimize {get,put}_online_cpus()

2013-10-02 Thread Srivatsa S. Bhat
On 10/01/2013 11:44 PM, Srivatsa S. Bhat wrote: On 10/01/2013 11:06 PM, Peter Zijlstra wrote: On Tue, Oct 01, 2013 at 10:41:15PM +0530, Srivatsa S. Bhat wrote: However, as Oleg said, its definitely worth considering whether this proposed change in semantics is going to hurt us in the future

Re: [PATCH] hotplug: Optimize {get,put}_online_cpus()

2013-10-01 Thread Srivatsa S. Bhat
On 10/01/2013 11:26 PM, Peter Zijlstra wrote: > On Tue, Oct 01, 2013 at 07:45:08PM +0200, Oleg Nesterov wrote: >> On 10/01, Peter Zijlstra wrote: >>> >>> On Tue, Oct 01, 2013 at 10:41:15PM +0530, Srivatsa S. Bhat wrote: >>>> However, as Oleg said, i

Re: [PATCH] hotplug: Optimize {get,put}_online_cpus()

2013-10-01 Thread Srivatsa S. Bhat
On 10/01/2013 11:44 PM, Srivatsa S. Bhat wrote: > On 10/01/2013 11:06 PM, Peter Zijlstra wrote: >> On Tue, Oct 01, 2013 at 10:41:15PM +0530, Srivatsa S. Bhat wrote: >>> However, as Oleg said, its definitely worth considering whether this >>> proposed >>> cha

Re: [PATCH] hotplug: Optimize {get,put}_online_cpus()

2013-10-01 Thread Srivatsa S. Bhat
On 10/01/2013 11:06 PM, Peter Zijlstra wrote: > On Tue, Oct 01, 2013 at 10:41:15PM +0530, Srivatsa S. Bhat wrote: >> However, as Oleg said, its definitely worth considering whether this proposed >> change in semantics is going to hurt us in the future. CPU_POST_DEAD has >>

Re: [PATCH] hotplug: Optimize {get,put}_online_cpus()

2013-10-01 Thread Srivatsa S. Bhat
(and suspend/resume) as things stand today, but I don't think these problems are insurmountable though.. However, as Oleg said, its definitely worth considering whether this proposed change in semantics is going to hurt us in the future. CPU_POST_DEAD has certainly proved to be very useful in certain

Re: [PATCH 2/2] cpufreq: make sure frequency transitions are serialized

2013-10-01 Thread Srivatsa S. Bhat
ly, these two things should be independent of the notifiers and the > notifications should only be done between "begin transition" and "end > transition" and only by whoever called the "begin transition" to start with. > > Now, question is what should happen if

Re: [PATCH 2/2] cpufreq: make sure frequency transitions are serialized

2013-10-01 Thread Srivatsa S. Bhat
to get things wrong in these cases. Regards, Srivatsa S. Bhat -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH] hotplug: Optimize {get,put}_online_cpus()

2013-10-01 Thread Srivatsa S. Bhat
not to undermine its utility. Regards, Srivatsa S. Bhat -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH] hotplug: Optimize {get,put}_online_cpus()

2013-10-01 Thread Srivatsa S. Bhat
On 10/01/2013 11:06 PM, Peter Zijlstra wrote: On Tue, Oct 01, 2013 at 10:41:15PM +0530, Srivatsa S. Bhat wrote: However, as Oleg said, its definitely worth considering whether this proposed change in semantics is going to hurt us in the future. CPU_POST_DEAD has certainly proved to be very

Re: [PATCH] hotplug: Optimize {get,put}_online_cpus()

2013-10-01 Thread Srivatsa S. Bhat
On 10/01/2013 11:44 PM, Srivatsa S. Bhat wrote: On 10/01/2013 11:06 PM, Peter Zijlstra wrote: On Tue, Oct 01, 2013 at 10:41:15PM +0530, Srivatsa S. Bhat wrote: However, as Oleg said, its definitely worth considering whether this proposed change in semantics is going to hurt us in the future

Re: [PATCH] hotplug: Optimize {get,put}_online_cpus()

2013-10-01 Thread Srivatsa S. Bhat
On 10/01/2013 11:26 PM, Peter Zijlstra wrote: On Tue, Oct 01, 2013 at 07:45:08PM +0200, Oleg Nesterov wrote: On 10/01, Peter Zijlstra wrote: On Tue, Oct 01, 2013 at 10:41:15PM +0530, Srivatsa S. Bhat wrote: However, as Oleg said, its definitely worth considering whether this proposed

Re: [RFC PATCH v4 06/40] mm: Demarcate and maintain pageblocks in region-order in the zones' freelists

2013-09-27 Thread Srivatsa S. Bhat
On 09/27/2013 03:46 AM, Dave Hansen wrote: > On 09/25/2013 04:14 PM, Srivatsa S. Bhat wrote: >> @@ -605,16 +713,22 @@ static inline void __free_one_page(struct page *page, >> buddy_idx = __find_buddy_index(combined_idx, order + 1); >> highe

Re: [RFC PATCH v4 06/40] mm: Demarcate and maintain pageblocks in region-order in the zones' freelists

2013-09-27 Thread Srivatsa S. Bhat
On 09/27/2013 03:46 AM, Dave Hansen wrote: On 09/25/2013 04:14 PM, Srivatsa S. Bhat wrote: @@ -605,16 +713,22 @@ static inline void __free_one_page(struct page *page, buddy_idx = __find_buddy_index(combined_idx, order + 1); higher_buddy = higher_page + (buddy_idx

Re: [Results] [RFC PATCH v4 00/40] mm: Memory Power Management

2013-09-26 Thread Srivatsa S. Bhat
hem more deeply and choose the ones that give us the most benefits with least cost/overhead. > >> >> Also, I didn't fully understand how NUMA policy will help in this case.. >> If you want to group memory allocations/references into fewer memory >> reg

Re: [Results] [RFC PATCH v4 00/40] mm: Memory Power Management

2013-09-26 Thread Srivatsa S. Bhat
On 09/26/2013 09:28 PM, Arjan van de Ven wrote: > On 9/26/2013 6:42 AM, Srivatsa S. Bhat wrote: >> On 09/26/2013 08:29 AM, Andrew Morton wrote: >>> On Thu, 26 Sep 2013 03:50:16 +0200 Andi Kleen >>> wrote: >>> >>>> On Wed, Sep 25, 2013 at 06:21:29PM

Re: [Results] [RFC PATCH v4 00/40] mm: Memory Power Management

2013-09-26 Thread Srivatsa S. Bhat
numbers seem to be positive. > > OK. But why are "a whole chunk of these patches not actually needed on SNB > (or anything else Intel sells or sold)"? What's the difference between > Intel products and whatever-it-is-this-patchset-was-designed-for? > Arjan, are you referring to th

Re: [Results] [RFC PATCH v4 00/40] mm: Memory Power Management

2013-09-26 Thread Srivatsa S. Bhat
able to show up to around 120 free-regions at the end of test run. http://article.gmane.org/gmane.linux.kernel.mm/106283 This version of the patchset with the added aggressive logic (targeted compaction) makes it only better: the free-regions number comes up to 202. > At least right now the nu

Re: [Results] [RFC PATCH v4 00/40] mm: Memory Power Management

2013-09-26 Thread Srivatsa S. Bhat
rimary memory power savings is expected to come from content-preserving states. So its not like this patchset was designed only for content-losing/full-poweroff type of scenarios). Regards, Srivatsa S. Bhat -- To unsubscribe from this list: send the line "unsubscribe linux-kernel&

Re: [Results] [RFC PATCH v4 00/40] mm: Memory Power Management

2013-09-26 Thread Srivatsa S. Bhat
ing actual power-measurements. Hence, so far I was focussing on the algorithmic aspects of the patchset and was trying to get an excellent consolidation ratio, without hurting performance too much. Going forward, I'll work on getting the power-measurements as well on the powerpc platform that

Re: [Results] [RFC PATCH v4 00/40] mm: Memory Power Management

2013-09-26 Thread Srivatsa S. Bhat
On 09/26/2013 05:10 AM, Andrew Morton wrote: > On Thu, 26 Sep 2013 04:56:32 +0530 "Srivatsa S. Bhat" > wrote: > >> Experimental Results: >> >> >> Test setup: >> -- >> >> x86 Sandybridge dual-socket quad c

Re: [Results] [RFC PATCH v4 00/40] mm: Memory Power Management

2013-09-26 Thread Srivatsa S. Bhat
On 09/26/2013 05:10 AM, Andrew Morton wrote: On Thu, 26 Sep 2013 04:56:32 +0530 Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com wrote: Experimental Results: Test setup: -- x86 Sandybridge dual-socket quad core HT-enabled machine, with 128GB RAM. Memory

Re: [Results] [RFC PATCH v4 00/40] mm: Memory Power Management

2013-09-26 Thread Srivatsa S. Bhat
an excellent consolidation ratio, without hurting performance too much. Going forward, I'll work on getting the power-measurements as well on the powerpc platform that I have. Regards, Srivatsa S. Bhat -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message

Re: [Results] [RFC PATCH v4 00/40] mm: Memory Power Management

2013-09-26 Thread Srivatsa S. Bhat
this patchset was designed only for content-losing/full-poweroff type of scenarios). Regards, Srivatsa S. Bhat -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [Results] [RFC PATCH v4 00/40] mm: Memory Power Management

2013-09-26 Thread Srivatsa S. Bhat
. :-) Regards, Srivatsa S. Bhat -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [Results] [RFC PATCH v4 00/40] mm: Memory Power Management

2013-09-26 Thread Srivatsa S. Bhat
and whatever-it-is-this-patchset-was-designed-for? Arjan, are you referring to the fact that Intel/SNB systems can exploit memory self-refresh only when the entire system goes idle? Is that why this patchset won't turn out to be that useful on those platforms? Regards, Srivatsa S. Bhat

Re: [Results] [RFC PATCH v4 00/40] mm: Memory Power Management

2013-09-26 Thread Srivatsa S. Bhat
On 09/26/2013 09:28 PM, Arjan van de Ven wrote: On 9/26/2013 6:42 AM, Srivatsa S. Bhat wrote: On 09/26/2013 08:29 AM, Andrew Morton wrote: On Thu, 26 Sep 2013 03:50:16 +0200 Andi Kleen a...@firstfloor.org wrote: On Wed, Sep 25, 2013 at 06:21:29PM -0700, Andrew Morton wrote: On Wed, 25 Sep

Re: [Results] [RFC PATCH v4 00/40] mm: Memory Power Management

2013-09-26 Thread Srivatsa S. Bhat
, in this patchset, everything (all the allocation/reference shaping) is done _within_ the NUMA boundary, assuming that the memory regions are subsets of a NUMA node. Regards, Srivatsa S. Bhat -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord

[RFC PATCH v4 36/40] kthread: Split out kthread-worker bits to avoid circular header-file dependency

2013-09-25 Thread Srivatsa S. Bhat
sched.h. So extract the definitions related to kthread-work/worker from kthread.h into a new header-file named kthread-work.h (which doesn't include sched.h), so that it can be easily included inside mmzone.h when required. Signed-off-by: Srivatsa S. Bhat --- include/linux/kthread-w

[RFC PATCH v4 39/40] mm: Add intelligence in kmempowerd to ignore regions unsuitable for evacuation

2013-09-25 Thread Srivatsa S. Bhat
and might not be justifiable. Also, compacting region 0 would be pointless, since that is the target of all our compaction runs. Add these checks in the region-evacuator. Signed-off-by: Srivatsa S. Bhat --- include/linux/mmzone.h |2 ++ mm/compaction.c| 25

[RFC PATCH v4 38/40] mm: Add a mechanism to queue work to the kmempowerd kthread

2013-09-25 Thread Srivatsa S. Bhat
to the kthread. Signed-off-by: Srivatsa S. Bhat --- mm/compaction.c | 26 ++ mm/internal.h |3 +++ 2 files changed, 29 insertions(+) diff --git a/mm/compaction.c b/mm/compaction.c index 0511eae..b56be89 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1271,6

[RFC PATCH v4 40/40] mm: Add triggers in the page-allocator to kick off region evacuation

2013-09-25 Thread Srivatsa S. Bhat
. Apart from them, also perform the same eligibility checks that the region-evacuator employs, to avoid useless wakeups of kmempowerd. Signed-off-by: Srivatsa S. Bhat --- mm/page_alloc.c | 38 -- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/mm

[RFC PATCH v4 37/40] mm: Add a kthread to perform targeted compaction for memory power management

2013-09-25 Thread Srivatsa S. Bhat
inal bitmask becomes empty (no bits set, so no more work to do). Signed-off-by: Srivatsa S. Bhat --- include/linux/mmzone.h | 10 ++ mm/compaction.c| 80 2 files changed, 90 insertions(+) diff --git a/include/linux/mmzone.h b/in

[RFC PATCH v4 34/40] mm: Restructure the compaction part of CMA for wider use

2013-09-25 Thread Srivatsa S. Bhat
. Signed-off-by: Srivatsa S. Bhat --- mm/compaction.c | 81 +++ mm/internal.h | 40 +++ mm/page_alloc.c | 51 +-- 3 files changed, 134 insertions(+), 38 deletions(-) diff --git a/mm

[RFC PATCH v4 35/40] mm: Add infrastructure to evacuate memory regions using compaction

2013-09-25 Thread Srivatsa S. Bhat
on the fast buddy allocator itself. But we are careful to abort the compaction run when the buddy allocator starts giving free pages in this region itself or higher regions (because in that case, if we proceed, it would be defeating the purpose of the entire effort). Signed-off-by: Srivatsa S. Bhat

[RFC PATCH v4 27/40] mm: Update the freepage migratetype of pages during region allocation

2013-09-25 Thread Srivatsa S. Bhat
that upon freeing the pages or during buddy expansion, the pages are added back to the freelists of the migratetype for which the pages were originally requested from the region allocator. Signed-off-by: Srivatsa S. Bhat --- mm/page_alloc.c |3 +++ 1 file changed, 3 insertions(+) diff --git

[RFC PATCH v4 32/40] mm: Set pageblock migratetype when allocating regions from region allocator

2013-09-25 Thread Srivatsa S. Bhat
, since it doesn't have to keep track of memory in smaller chunks than a memory region. Signed-off-by: Srivatsa S. Bhat --- mm/page_alloc.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index fd32533..c4cbd80 100644 --- a/mm/page_alloc.c

[RFC PATCH v4 33/40] mm: Use a cache between page-allocator and region-allocator

2013-09-25 Thread Srivatsa S. Bhat
chances of avoiding fallbacks to other migratetypes. So, don't return all free memory regions (in the page allocator) to the region allocator. Keep atleast one region as a cache, for future use. Signed-off-by: Srivatsa S. Bhat --- mm/page_alloc.c | 16 ++-- 1 file changed, 14

[RFC PATCH v4 31/40] mm: Never change migratetypes of pageblocks during freepage stealing

2013-09-25 Thread Srivatsa S. Bhat
it fragments the ownership of memory segments. So never change the ownership of pageblocks during freepage stealing. Signed-off-by: Srivatsa S. Bhat --- mm/page_alloc.c | 36 ++-- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/mm/page_alloc.c b/mm

[RFC PATCH v4 28/40] mm: Provide a mechanism to check if a given page is in the region allocator

2013-09-25 Thread Srivatsa S. Bhat
whether the freepage resides in the region allocator or the buddy freelists. Signed-off-by: Srivatsa S. Bhat --- mm/page_alloc.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index ca7b959..ac04b45 100644 --- a/mm

[RFC PATCH v4 29/40] mm: Add a way to request pages of a particular region from the region allocator

2013-09-25 Thread Srivatsa S. Bhat
from that particular region. Signed-off-by: Srivatsa S. Bhat --- mm/page_alloc.c | 40 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index ac04b45..ed5298c 100644 --- a/mm/page_alloc.c +++ b/mm

[RFC PATCH v4 30/40] mm: Modify move_freepages() to handle pages in the region allocator properly

2013-09-25 Thread Srivatsa S. Bhat
freepage movement, we first move all the pages of that region from the region allocator to the MIGRATE_MOVABLE buddy freelist and then move the requested page(s) from MIGRATE_MOVABLE to the required migratetype. Signed-off-by: Srivatsa S. Bhat --- mm/page_alloc.c | 18 +- 1 file

[RFC PATCH v4 25/40] mm: Connect Page Allocator(PA) to Region Allocator(RA); add PA => RA flow

2013-09-25 Thread Srivatsa S. Bhat
implifying assumptions.) Signed-off-by: Srivatsa S. Bhat --- mm/page_alloc.c | 42 +- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 178f210..d08bc91 100644 --- a/mm/page_alloc.c +++ b/mm/pa

[RFC PATCH v4 23/40] mm: Fix vmstat to also account for freepages in the region allocator

2013-09-25 Thread Srivatsa S. Bhat
. Signed-off-by: Srivatsa S. Bhat --- mm/vmstat.c |8 1 file changed, 8 insertions(+) diff --git a/mm/vmstat.c b/mm/vmstat.c index bb44d30..4dc103e 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -868,6 +868,8 @@ static void frag_show_print(struct seq_file *m, pg_data_t *pgdat

[RFC PATCH v4 24/40] mm: Drop some very expensive sorted-buddy related checks under DEBUG_PAGEALLOC

2013-09-25 Thread Srivatsa S. Bhat
, as a precursor to benchmarking the performance). The check to see if a page given as input to del_from_freelist() indeed belongs to that freelist, is one such very expensive check. Drop it. Signed-off-by: Srivatsa S. Bhat --- mm/page_alloc.c |2 ++ 1 file changed, 2 insertions(+) diff --git

[RFC PATCH v4 22/40] mm: Propagate the sorted-buddy bias for picking free regions, to region allocator

2013-09-25 Thread Srivatsa S. Bhat
lower numbered regions while allocating regions to the page allocator. To do this efficiently, add a bitmap to represent the regions in the region allocator, and use bitmap operations to manage these regions and to pick the lowest numbered free region efficiently. Signed-off-by: Srivatsa S. Bhat

[RFC PATCH v4 21/40] mm: Maintain the counter for freepages in the region allocator

2013-09-25 Thread Srivatsa S. Bhat
. Signed-off-by: Srivatsa S. Bhat --- mm/page_alloc.c | 45 ++--- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d71d671..ee6c098 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -697,10

[RFC PATCH v4 26/40] mm: Connect Page Allocator(PA) to Region Allocator(RA); add PA <= RA flow

2013-09-25 Thread Srivatsa S. Bhat
ementation, so that one can quickly evaluate the benefits of the overall design without getting bogged down by too many corner cases and constraints. Of course future implementations will handle more scenarios and will have reduced dependence on such simplifying assumptions.) Signed-off-by: Srivat

[RFC PATCH v4 20/40] mm: Provide a mechanism to request free memory from the region allocator

2013-09-25 Thread Srivatsa S. Bhat
from the region allocator, the latter picks a free region and always allocates all the freepages belonging to that entire region. Signed-off-by: Srivatsa S. Bhat --- mm/page_alloc.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c

[RFC PATCH v4 19/40] mm: Provide a mechanism to release free memory to the region allocator

2013-09-25 Thread Srivatsa S. Bhat
the pages belonging to that region. Signed-off-by: Srivatsa S. Bhat --- mm/page_alloc.c | 20 1 file changed, 20 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d96746e..c727bba 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -919,6 +919,26 @@ static

[RFC PATCH v4 18/40] mm: Provide a mechanism to delete pages from buddy freelists in bulk

2013-09-25 Thread Srivatsa S. Bhat
freelists in one shot. Add this support, and also take care to update the nr-free statistics properly. Signed-off-by: Srivatsa S. Bhat --- mm/page_alloc.c | 55 +++ 1 file changed, 55 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c

[RFC PATCH v4 17/40] mm: Add a mechanism to add pages to buddy freelists in bulk

2013-09-25 Thread Srivatsa S. Bhat
-free statistics properly. Signed-off-by: Srivatsa S. Bhat --- mm/page_alloc.c | 46 ++ 1 file changed, 46 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 876c231..c3a2cda 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c

[RFC PATCH v4 15/40] mm: Add aggressive bias to prefer lower regions during page allocation

2013-09-25 Thread Srivatsa S. Bhat
to satisfy that allocation request. Signed-off-by: Srivatsa S. Bhat --- mm/page_alloc.c | 44 ++-- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index fbaa2dc..dc02a80 100644 --- a/mm/page_alloc.c +++ b/mm

[RFC PATCH v4 16/40] mm: Introduce a "Region Allocator" to manage entire memory regions

2013-09-25 Thread Srivatsa S. Bhat
ns <> Page<> Memory Region and Kernel Allocator Allocator Since the region allocator is supposed to function as a backend to the page allocator, we implement it on a per-zone basis (since the page-allocator is also per-zone). Signed-off-by:

[RFC PATCH v4 13/40] mm: Print memory region statistics to understand the buddy allocator behavior

2013-09-25 Thread Srivatsa S. Bhat
memory region accurately, we should be able to observe the new page allocator behavior to a reasonable degree of accuracy. Signed-off-by: Srivatsa S. Bhat --- mm/vmstat.c | 34 ++ 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/mm/vmstat.c b/mm

[RFC PATCH v4 14/40] mm: Enable per-memory-region fragmentation stats in pagetypeinfo

2013-09-25 Thread Srivatsa S. Bhat
memory allocation decisions at the page-allocator level and understand the extent to which they help in consolidation. Signed-off-by: Srivatsa S. Bhat --- mm/vmstat.c | 86 ++- 1 file changed, 84 insertions(+), 2 deletions(-) diff --git

[RFC PATCH v4 10/40] bitops: Document the difference in indexing between fls() and __fls()

2013-09-25 Thread Srivatsa S. Bhat
fls() indexes the bits starting with 1, ie., from 1 to BITS_PER_LONG whereas __fls() uses a zero-based indexing scheme (0 to BITS_PER_LONG - 1). Add comments to document this important difference. Signed-off-by: Srivatsa S. Bhat --- arch/x86/include/asm/bitops.h |4 include/asm

[RFC PATCH v4 11/40] mm: A new optimized O(log n) sorting algo to speed up buddy-sorting

2013-09-25 Thread Srivatsa S. Bhat
up the sorting. One of the other main advantages of this O(log n) design is that it can support large amounts of RAM (upto 2 TB and beyond) quite effortlessly. Signed-off-by: Srivatsa S. Bhat --- include/linux/mmzone.h |2 + mm/page_alloc.c|

[RFC PATCH v4 12/40] mm: Add support to accurately track per-memory-region allocation

2013-09-25 Thread Srivatsa S. Bhat
The page allocator can make smarter decisions to influence memory power management, if we track the per-region memory allocations closely. So add the necessary support to accurately track allocations on a per-region basis. Signed-off-by: Srivatsa S. Bhat --- include/linux/mmzone.h |2 + mm

[RFC PATCH v4 08/40] mm: Use the correct migratetype during buddy merging

2013-09-25 Thread Srivatsa S. Bhat
of the buddy page and use it while merging the buddies. Also, set the freepage migratetype of the buddy to the new one. Signed-off-by: Srivatsa S. Bhat --- mm/page_alloc.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index e31daf4

[RFC PATCH v4 09/40] mm: Add an optimized version of del_from_freelist to keep page allocation fast

2013-09-25 Thread Srivatsa S. Bhat
that, and use it to keep the fastpath of page allocation almost as fast as it would have been without memory regions. Signed-off-by: Srivatsa S. Bhat --- include/linux/mm.h | 14 +++ include/linux/mmzone.h |6 + mm/page_alloc.c| 62

[RFC PATCH v4 07/40] mm: Track the freepage migratetype of pages accurately

2013-09-25 Thread Srivatsa S. Bhat
we depend on tracking this info accurately, as outlined above). Signed-off-by: Srivatsa S. Bhat --- mm/page_alloc.c |7 +++ 1 file changed, 7 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d48eb04..e31daf4 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -950,6 +950

[RFC PATCH v4 05/40] mm: Add data-structures to describe memory regions within the zones' freelists

2013-09-25 Thread Srivatsa S. Bhat
the boundaries of zone memory regions and counters to track the number of free pageblocks within each region. Also, fixup the references to the freelist's list_head inside struct free_area. Signed-off-by: Srivatsa S. Bhat --- include/linux/mmzone.h | 17 - mm/compaction.c|2

[RFC PATCH v4 06/40] mm: Demarcate and maintain pageblocks in region-order in the zones' freelists

2013-09-25 Thread Srivatsa S. Bhat
The latter part is implemented in subsequent patches. Increasing region number--> Direction of allocation---><---Direction of reclaim/compaction Signed-off-by: Srivatsa S. Bhat --- mm/page_alloc.c | 154 +

[RFC PATCH v4 03/40] mm: Introduce and initialize zone memory regions

2013-09-25 Thread Srivatsa S. Bhat
solute region boundaries will be very useful in influencing the MM decisions at those places. Signed-off-by: Srivatsa S. Bhat --- include/linux/mmzone.h | 11 + mm/page_alloc.c| 62 +++- 2 files changed, 72 insertions(+), 1 deletion(-) diff --

[RFC PATCH v4 04/40] mm: Add helpers to retrieve node region and zone region for a given page

2013-09-25 Thread Srivatsa S. Bhat
quickly obtain the zone memory region to which a given page belongs. Signed-off-by: Srivatsa S. Bhat --- include/linux/mm.h | 24 include/linux/mmzone.h |7 +++ mm/page_alloc.c| 22 ++ 3 files changed, 53 insertions(+) diff --gi

[RFC PATCH v4 02/40] mm: Initialize node memory regions during boot

2013-09-25 Thread Srivatsa S. Bhat
Initialize the node's memory-regions structures with the information about the region-boundaries, at boot time. Based-on-patch-by: Ankita Garg Signed-off-by: Srivatsa S. Bhat --- include/linux/mm.h |4 mm/page_alloc.c| 28 2 files changed, 32

[RFC PATCH v4 01/40] mm: Introduce memory regions data-structure to capture region boundaries within nodes

2013-09-25 Thread Srivatsa S. Bhat
Signed-off-by: Srivatsa S. Bhat --- include/linux/mmzone.h | 12 1 file changed, 12 insertions(+) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index bd791e4..d3288b0 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -35,6 +35,8 @@ *

[RFC PATCH v4 00/40] mm: Memory Power Management

2013-09-25 Thread Srivatsa S. Bhat
ter2003.pdf [6]. ACPI 5.0 and MPST support http://www.acpi.info/spec.htm Section 5.2.21 Memory Power State Table (MPST) [7]. Prototype implementation of parsing of ACPI 5.0 MPST tables, by Srinivas Pandruvada. https://lkml.org/lkml/2013/4/18/349 Srivatsa S. Bhat (40): mm: Intr

[RFC PATCH v4 00/40] mm: Memory Power Management

2013-09-25 Thread Srivatsa S. Bhat
/spec.htm Section 5.2.21 Memory Power State Table (MPST) [7]. Prototype implementation of parsing of ACPI 5.0 MPST tables, by Srinivas Pandruvada. https://lkml.org/lkml/2013/4/18/349 Srivatsa S. Bhat (40): mm: Introduce memory regions data-structure to capture region boundaries

[RFC PATCH v4 02/40] mm: Initialize node memory regions during boot

2013-09-25 Thread Srivatsa S. Bhat
Initialize the node's memory-regions structures with the information about the region-boundaries, at boot time. Based-on-patch-by: Ankita Garg gargank...@gmail.com Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- include/linux/mm.h |4 mm/page_alloc.c| 28

[RFC PATCH v4 01/40] mm: Introduce memory regions data-structure to capture region boundaries within nodes

2013-09-25 Thread Srivatsa S. Bhat
-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- include/linux/mmzone.h | 12 1 file changed, 12 insertions(+) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index bd791e4..d3288b0 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -35,6 +35,8

[RFC PATCH v4 04/40] mm: Add helpers to retrieve node region and zone region for a given page

2013-09-25 Thread Srivatsa S. Bhat
region to which a given page belongs. Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- include/linux/mm.h | 24 include/linux/mmzone.h |7 +++ mm/page_alloc.c| 22 ++ 3 files changed, 53 insertions(+) diff --git

[RFC PATCH v4 03/40] mm: Introduce and initialize zone memory regions

2013-09-25 Thread Srivatsa S. Bhat
decisions at those places. Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- include/linux/mmzone.h | 11 + mm/page_alloc.c| 62 +++- 2 files changed, 72 insertions(+), 1 deletion(-) diff --git a/include/linux

[RFC PATCH v4 05/40] mm: Add data-structures to describe memory regions within the zones' freelists

2013-09-25 Thread Srivatsa S. Bhat
the boundaries of zone memory regions and counters to track the number of free pageblocks within each region. Also, fixup the references to the freelist's list_head inside struct free_area. Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- include/linux/mmzone.h | 17

[RFC PATCH v4 06/40] mm: Demarcate and maintain pageblocks in region-order in the zones' freelists

2013-09-25 Thread Srivatsa S. Bhat
. Increasing region number-- Direction of allocation------Direction of reclaim/compaction Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- mm/page_alloc.c | 154 +-- 1

[RFC PATCH v4 07/40] mm: Track the freepage migratetype of pages accurately

2013-09-25 Thread Srivatsa S. Bhat
on tracking this info accurately, as outlined above). Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- mm/page_alloc.c |7 +++ 1 file changed, 7 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d48eb04..e31daf4 100644 --- a/mm/page_alloc.c +++ b/mm

[RFC PATCH v4 08/40] mm: Use the correct migratetype during buddy merging

2013-09-25 Thread Srivatsa S. Bhat
of the buddy page and use it while merging the buddies. Also, set the freepage migratetype of the buddy to the new one. Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- mm/page_alloc.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mm/page_alloc.c b

[RFC PATCH v4 09/40] mm: Add an optimized version of del_from_freelist to keep page allocation fast

2013-09-25 Thread Srivatsa S. Bhat
that, and use it to keep the fastpath of page allocation almost as fast as it would have been without memory regions. Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- include/linux/mm.h | 14 +++ include/linux/mmzone.h |6 + mm/page_alloc.c| 62

[RFC PATCH v4 12/40] mm: Add support to accurately track per-memory-region allocation

2013-09-25 Thread Srivatsa S. Bhat
The page allocator can make smarter decisions to influence memory power management, if we track the per-region memory allocations closely. So add the necessary support to accurately track allocations on a per-region basis. Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com

[RFC PATCH v4 10/40] bitops: Document the difference in indexing between fls() and __fls()

2013-09-25 Thread Srivatsa S. Bhat
fls() indexes the bits starting with 1, ie., from 1 to BITS_PER_LONG whereas __fls() uses a zero-based indexing scheme (0 to BITS_PER_LONG - 1). Add comments to document this important difference. Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- arch/x86/include/asm/bitops.h

[RFC PATCH v4 11/40] mm: A new optimized O(log n) sorting algo to speed up buddy-sorting

2013-09-25 Thread Srivatsa S. Bhat
the sorting. One of the other main advantages of this O(log n) design is that it can support large amounts of RAM (upto 2 TB and beyond) quite effortlessly. Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- include/linux/mmzone.h |2 + mm/page_alloc.c| 142

[RFC PATCH v4 13/40] mm: Print memory region statistics to understand the buddy allocator behavior

2013-09-25 Thread Srivatsa S. Bhat
memory region accurately, we should be able to observe the new page allocator behavior to a reasonable degree of accuracy. Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- mm/vmstat.c | 34 ++ 1 file changed, 30 insertions(+), 4 deletions

[RFC PATCH v4 16/40] mm: Introduce a Region Allocator to manage entire memory regions

2013-09-25 Thread Srivatsa S. Bhat
Memory Region and Kernel Allocator Allocator Since the region allocator is supposed to function as a backend to the page allocator, we implement it on a per-zone basis (since the page-allocator is also per-zone). Signed-off-by: Srivatsa S. Bhat srivatsa.b

[RFC PATCH v4 14/40] mm: Enable per-memory-region fragmentation stats in pagetypeinfo

2013-09-25 Thread Srivatsa S. Bhat
memory allocation decisions at the page-allocator level and understand the extent to which they help in consolidation. Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- mm/vmstat.c | 86 ++- 1 file changed, 84 insertions

[RFC PATCH v4 15/40] mm: Add aggressive bias to prefer lower regions during page allocation

2013-09-25 Thread Srivatsa S. Bhat
to satisfy that allocation request. Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- mm/page_alloc.c | 44 ++-- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index fbaa2dc..dc02a80 100644

[RFC PATCH v4 18/40] mm: Provide a mechanism to delete pages from buddy freelists in bulk

2013-09-25 Thread Srivatsa S. Bhat
freelists in one shot. Add this support, and also take care to update the nr-free statistics properly. Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- mm/page_alloc.c | 55 +++ 1 file changed, 55 insertions(+) diff --git

[RFC PATCH v4 17/40] mm: Add a mechanism to add pages to buddy freelists in bulk

2013-09-25 Thread Srivatsa S. Bhat
-free statistics properly. Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- mm/page_alloc.c | 46 ++ 1 file changed, 46 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 876c231..c3a2cda 100644 --- a/mm

[RFC PATCH v4 20/40] mm: Provide a mechanism to request free memory from the region allocator

2013-09-25 Thread Srivatsa S. Bhat
from the region allocator, the latter picks a free region and always allocates all the freepages belonging to that entire region. Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- mm/page_alloc.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/mm

[RFC PATCH v4 19/40] mm: Provide a mechanism to release free memory to the region allocator

2013-09-25 Thread Srivatsa S. Bhat
the pages belonging to that region. Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- mm/page_alloc.c | 20 1 file changed, 20 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d96746e..c727bba 100644 --- a/mm/page_alloc.c +++ b/mm

[RFC PATCH v4 26/40] mm: Connect Page Allocator(PA) to Region Allocator(RA); add PA = RA flow

2013-09-25 Thread Srivatsa S. Bhat
, so that one can quickly evaluate the benefits of the overall design without getting bogged down by too many corner cases and constraints. Of course future implementations will handle more scenarios and will have reduced dependence on such simplifying assumptions.) Signed-off-by: Srivatsa S. Bhat

[RFC PATCH v4 25/40] mm: Connect Page Allocator(PA) to Region Allocator(RA); add PA = RA flow

2013-09-25 Thread Srivatsa S. Bhat
assumptions.) Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- mm/page_alloc.c | 42 +- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 178f210..d08bc91 100644 --- a/mm/page_alloc.c

[RFC PATCH v4 23/40] mm: Fix vmstat to also account for freepages in the region allocator

2013-09-25 Thread Srivatsa S. Bhat
. Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- mm/vmstat.c |8 1 file changed, 8 insertions(+) diff --git a/mm/vmstat.c b/mm/vmstat.c index bb44d30..4dc103e 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -868,6 +868,8 @@ static void frag_show_print(struct seq_file *m

[RFC PATCH v4 24/40] mm: Drop some very expensive sorted-buddy related checks under DEBUG_PAGEALLOC

2013-09-25 Thread Srivatsa S. Bhat
, as a precursor to benchmarking the performance). The check to see if a page given as input to del_from_freelist() indeed belongs to that freelist, is one such very expensive check. Drop it. Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- mm/page_alloc.c |2 ++ 1 file changed

[RFC PATCH v4 22/40] mm: Propagate the sorted-buddy bias for picking free regions, to region allocator

2013-09-25 Thread Srivatsa S. Bhat
lower numbered regions while allocating regions to the page allocator. To do this efficiently, add a bitmap to represent the regions in the region allocator, and use bitmap operations to manage these regions and to pick the lowest numbered free region efficiently. Signed-off-by: Srivatsa S. Bhat

[RFC PATCH v4 21/40] mm: Maintain the counter for freepages in the region allocator

2013-09-25 Thread Srivatsa S. Bhat
. Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- mm/page_alloc.c | 45 ++--- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d71d671..ee6c098 100644 --- a/mm/page_alloc.c +++ b

[RFC PATCH v4 28/40] mm: Provide a mechanism to check if a given page is in the region allocator

2013-09-25 Thread Srivatsa S. Bhat
whether the freepage resides in the region allocator or the buddy freelists. Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- mm/page_alloc.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index ca7b959

[RFC PATCH v4 29/40] mm: Add a way to request pages of a particular region from the region allocator

2013-09-25 Thread Srivatsa S. Bhat
from that particular region. Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- mm/page_alloc.c | 40 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index ac04b45..ed5298c 100644 --- a/mm

[RFC PATCH v4 30/40] mm: Modify move_freepages() to handle pages in the region allocator properly

2013-09-25 Thread Srivatsa S. Bhat
freepage movement, we first move all the pages of that region from the region allocator to the MIGRATE_MOVABLE buddy freelist and then move the requested page(s) from MIGRATE_MOVABLE to the required migratetype. Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- mm/page_alloc.c

[RFC PATCH v4 27/40] mm: Update the freepage migratetype of pages during region allocation

2013-09-25 Thread Srivatsa S. Bhat
that upon freeing the pages or during buddy expansion, the pages are added back to the freelists of the migratetype for which the pages were originally requested from the region allocator. Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- mm/page_alloc.c |3 +++ 1 file

<    5   6   7   8   9   10   11   12   13   14   >