linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Reduce the amount of time compaction disables IRQs for
@ 2011-02-25 18:00 Mel Gorman
  2011-02-25 18:00 ` [PATCH 1/2] mm: compaction: Minimise the time IRQs are disabled while isolating free pages Mel Gorman
  2011-02-25 18:00 ` [PATCH 2/2] mm: compaction: Minimise the time IRQs are disabled while isolating pages for migration Mel Gorman
  0 siblings, 2 replies; 7+ messages in thread
From: Mel Gorman @ 2011-02-25 18:00 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arthur Marsh, Clemens Ladisch, Andrea Arcangeli, Mel Gorman,
	Linux-MM, Linux Kernel Mailing List

The following two patches are aimed at reducing the amount of time IRQs are
disabled. It was reported by some ALSA people that transparent hugepages was
causing slowdowns on MIDI playback but I strongly suspect that compaction
running for smaller orders was also a factor. The theory was that IRQs
were being disabled for too long and sure enough, compaction was found to
be disabling IRQs for a long time. The patches reduce the length of time
IRQs are disabled when scanning for free pages and for pages to migrate.

It's late in the cycle but the IRQs disabled times are sufficiently bad
that it would be desirable to have these merged for 2.6.38 if possible.

 mm/compaction.c |   35 ++++++++++++++++++++++++++++++-----
 1 files changed, 30 insertions(+), 5 deletions(-)

-- 
1.7.2.3

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] mm: compaction: Minimise the time IRQs are disabled while isolating free pages
  2011-02-25 18:00 [PATCH 0/2] Reduce the amount of time compaction disables IRQs for Mel Gorman
@ 2011-02-25 18:00 ` Mel Gorman
  2011-02-25 18:00 ` [PATCH 2/2] mm: compaction: Minimise the time IRQs are disabled while isolating pages for migration Mel Gorman
  1 sibling, 0 replies; 7+ messages in thread
From: Mel Gorman @ 2011-02-25 18:00 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arthur Marsh, Clemens Ladisch, Andrea Arcangeli, Mel Gorman,
	Linux-MM, Linux Kernel Mailing List

compaction_alloc() isolates free pages to be used as migration targets.
While its scanning, IRQs are disabled on the mistaken assumption the scanning
should be short. Analysis showed that IRQs were in fact being disabled for
substantial time. A simple test was run using large anonymous mappings with
transparent hugepage support enabled to trigger frequent compactions. A
monitor sampled what the worst IRQ-off latencies were and a post-processing
tool found the following;

Total sampled time IRQs off (not real total time): 22355
Event compaction_alloc..compaction_alloc                 8409 us count 1
Event compaction_alloc..compaction_alloc                 7341 us count 1
Event compaction_alloc..compaction_alloc                 2463 us count 1
Event compaction_alloc..compaction_alloc                 2054 us count 1
Event shrink_inactive_list..shrink_zone                  1864 us count 1
Event shrink_inactive_list..shrink_zone                    88 us count 1
Event save_args..call_softirq                              36 us count 1
Event save_args..call_softirq                              35 us count 2
Event __make_request..__blk_run_queue                      24 us count 1
Event __alloc_pages_nodemask..__alloc_pages_nodemask        6 us count 1

i.e. compaction is disabled IRQs for a prolonged period of time - 8ms in
one instance. The full report generated by the tool can be found at
http://www.csn.ul.ie/~mel/postings/minfree-20110225/irqsoff-vanilla-micro.report .
This patch reduces the time IRQs are disabled by simply disabling IRQs
at the last possible minute. An updated IRQs-off summary report then
looks like;

Total sampled time IRQs off (not real total time): 5493
Event shrink_inactive_list..shrink_zone                  1596 us count 1
Event shrink_inactive_list..shrink_zone                  1530 us count 1
Event shrink_inactive_list..shrink_zone                   956 us count 1
Event shrink_inactive_list..shrink_zone                   541 us count 1
Event shrink_inactive_list..shrink_zone                   531 us count 1
Event split_huge_page..add_to_swap                        232 us count 1
Event save_args..call_softirq                              36 us count 1
Event save_args..call_softirq                              35 us count 2
Event __wake_up..__wake_up                                  1 us count 1

A full report is again available at
http://www.csn.ul.ie/~mel/postings/minfree-20110225/irqsoff-minimiseirq-free-v1r4-micro.report .
. As should be obvious, IRQ disabled latencies due to compaction are
almost elimimnated for this particular test.

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
---
 mm/compaction.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/mm/compaction.c b/mm/compaction.c
index 8be430b8..f47de94 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -155,7 +155,6 @@ static void isolate_freepages(struct zone *zone,
 	 * pages on cc->migratepages. We stop searching if the migrate
 	 * and free page scanners meet or enough free pages are isolated.
 	 */
-	spin_lock_irqsave(&zone->lock, flags);
 	for (; pfn > low_pfn && cc->nr_migratepages > nr_freepages;
 					pfn -= pageblock_nr_pages) {
 		unsigned long isolated;
@@ -178,9 +177,18 @@ static void isolate_freepages(struct zone *zone,
 		if (!suitable_migration_target(page))
 			continue;
 
-		/* Found a block suitable for isolating free pages from */
-		isolated = isolate_freepages_block(zone, pfn, freelist);
-		nr_freepages += isolated;
+		/*
+		 * Found a block suitable for isolating free pages from. Now
+		 * we disabled interrupts, double check things are ok and
+		 * isolate the pages. This is to minimise the time IRQs
+		 * are disabled
+		 */
+		spin_lock_irqsave(&zone->lock, flags);
+		if (suitable_migration_target(page)) {
+			isolated = isolate_freepages_block(zone, pfn, freelist);
+			nr_freepages += isolated;
+		}
+		spin_unlock_irqrestore(&zone->lock, flags);
 
 		/*
 		 * Record the highest PFN we isolated pages from. When next
@@ -190,7 +198,6 @@ static void isolate_freepages(struct zone *zone,
 		if (isolated)
 			high_pfn = max(high_pfn, pfn);
 	}
-	spin_unlock_irqrestore(&zone->lock, flags);
 
 	/* split_free_page does not map the pages */
 	list_for_each_entry(page, freelist, lru) {
-- 
1.7.2.3

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] mm: compaction: Minimise the time IRQs are disabled while isolating pages for migration
  2011-02-25 18:00 [PATCH 0/2] Reduce the amount of time compaction disables IRQs for Mel Gorman
  2011-02-25 18:00 ` [PATCH 1/2] mm: compaction: Minimise the time IRQs are disabled while isolating free pages Mel Gorman
@ 2011-02-25 18:00 ` Mel Gorman
  1 sibling, 0 replies; 7+ messages in thread
From: Mel Gorman @ 2011-02-25 18:00 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arthur Marsh, Clemens Ladisch, Andrea Arcangeli, Mel Gorman,
	Linux-MM, Linux Kernel Mailing List

From: Andrea Arcangeli <aarcange@redhat.com>

compaction_alloc() isolates pages for migration in isolate_migratepages. While
it's scanning, IRQs are disabled on the mistaken assumption the scanning
should be short. Tests show this to be true for the most part but
contention times on the LRU lock can be increased. Before this patch,
the IRQ disabled times for a simple test looked like

Total sampled time IRQs off (not real total time): 5493
Event shrink_inactive_list..shrink_zone                  1596 us count 1
Event shrink_inactive_list..shrink_zone                  1530 us count 1
Event shrink_inactive_list..shrink_zone                   956 us count 1
Event shrink_inactive_list..shrink_zone                   541 us count 1
Event shrink_inactive_list..shrink_zone                   531 us count 1
Event split_huge_page..add_to_swap                        232 us count 1
Event save_args..call_softirq                              36 us count 1
Event save_args..call_softirq                              35 us count 2
Event __wake_up..__wake_up                                  1 us count 1

This patch reduces the worst-case IRQs-disabled latencies by releasing the
lock every SWAP_CLUSTER_MAX pages that are scanned and releasing the CPU if
necessary. The cost of this is that the processing performing compaction will
be slower but IRQs being disabled for too long a time has worse consequences
as the following report shows;

Total sampled time IRQs off (not real total time): 4367
Event shrink_inactive_list..shrink_zone                   881 us count 1
Event shrink_inactive_list..shrink_zone                   875 us count 1
Event shrink_inactive_list..shrink_zone                   868 us count 1
Event shrink_inactive_list..shrink_zone                   555 us count 1
Event split_huge_page..add_to_swap                        495 us count 1
Event compact_zone..compact_zone_order                    269 us count 1
Event split_huge_page..add_to_swap                        266 us count 1
Event shrink_inactive_list..shrink_zone                    85 us count 1
Event save_args..call_softirq                              36 us count 2
Event __wake_up..__wake_up                                  1 us count 1

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
---
 mm/compaction.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/mm/compaction.c b/mm/compaction.c
index f47de94..5babbbb 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -278,9 +278,27 @@ static unsigned long isolate_migratepages(struct zone *zone,
 	}
 
 	/* Time to isolate some pages for migration */
+	cond_resched();
 	spin_lock_irq(&zone->lru_lock);
 	for (; low_pfn < end_pfn; low_pfn++) {
 		struct page *page;
+		bool unlocked = false;
+
+		/* give a chance to irqs before checking need_resched() */
+		if (!((low_pfn+1) % SWAP_CLUSTER_MAX)) {
+			spin_unlock_irq(&zone->lru_lock);
+			unlocked = true;
+		}
+		if (need_resched() || spin_is_contended(&zone->lru_lock)) {
+			if (!unlocked)
+				spin_unlock_irq(&zone->lru_lock);
+			cond_resched();
+			spin_lock_irq(&zone->lru_lock);
+			if (fatal_signal_pending(current))
+				break;
+		} else if (unlocked)
+			spin_lock_irq(&zone->lru_lock);
+
 		if (!pfn_valid_within(low_pfn))
 			continue;
 		nr_scanned++;
-- 
1.7.2.3

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 1/2] mm: compaction: Minimise the time IRQs are disabled while isolating free pages
  2011-02-25 20:04 [PATCH 0/2] Reduce the amount of time compaction disables IRQs for V2 Mel Gorman
@ 2011-02-25 20:04 ` Mel Gorman
  2011-02-25 22:34   ` Johannes Weiner
                     ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Mel Gorman @ 2011-02-25 20:04 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arthur Marsh, Clemens Ladisch, Andrea Arcangeli, Mel Gorman,
	Linux-MM, Linux Kernel Mailing List

compaction_alloc() isolates free pages to be used as migration targets.
While its scanning, IRQs are disabled on the mistaken assumption the scanning
should be short. Analysis showed that IRQs were in fact being disabled for
substantial time. A simple test was run using large anonymous mappings with
transparent hugepage support enabled to trigger frequent compactions. A
monitor sampled what the worst IRQ-off latencies were and a post-processing
tool found the following;

Total sampled time IRQs off (not real total time): 22355
Event compaction_alloc..compaction_alloc                 8409 us count 1
Event compaction_alloc..compaction_alloc                 7341 us count 1
Event compaction_alloc..compaction_alloc                 2463 us count 1
Event compaction_alloc..compaction_alloc                 2054 us count 1
Event shrink_inactive_list..shrink_zone                  1864 us count 1
Event shrink_inactive_list..shrink_zone                    88 us count 1
Event save_args..call_softirq                              36 us count 1
Event save_args..call_softirq                              35 us count 2
Event __make_request..__blk_run_queue                      24 us count 1
Event __alloc_pages_nodemask..__alloc_pages_nodemask        6 us count 1

i.e. compaction is disabled IRQs for a prolonged period of time - 8ms in
one instance. The full report generated by the tool can be found at
http://www.csn.ul.ie/~mel/postings/minfree-20110225/irqsoff-vanilla-micro.report .
This patch reduces the time IRQs are disabled by simply disabling IRQs
at the last possible minute. An updated IRQs-off summary report then
looks like;

Total sampled time IRQs off (not real total time): 5493
Event shrink_inactive_list..shrink_zone                  1596 us count 1
Event shrink_inactive_list..shrink_zone                  1530 us count 1
Event shrink_inactive_list..shrink_zone                   956 us count 1
Event shrink_inactive_list..shrink_zone                   541 us count 1
Event shrink_inactive_list..shrink_zone                   531 us count 1
Event split_huge_page..add_to_swap                        232 us count 1
Event save_args..call_softirq                              36 us count 1
Event save_args..call_softirq                              35 us count 2
Event __wake_up..__wake_up                                  1 us count 1

A full report is again available at
http://www.csn.ul.ie/~mel/postings/minfree-20110225/irqsoff-minimiseirq-free-v1r4-micro.report .
. As should be obvious, IRQ disabled latencies due to compaction are
almost elimimnated for this particular test.

[aarcange@redhat.com: Fix initialisation of isolated]
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
---
 mm/compaction.c |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/mm/compaction.c b/mm/compaction.c
index 8be430b8..11d88a2 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -155,7 +155,6 @@ static void isolate_freepages(struct zone *zone,
 	 * pages on cc->migratepages. We stop searching if the migrate
 	 * and free page scanners meet or enough free pages are isolated.
 	 */
-	spin_lock_irqsave(&zone->lock, flags);
 	for (; pfn > low_pfn && cc->nr_migratepages > nr_freepages;
 					pfn -= pageblock_nr_pages) {
 		unsigned long isolated;
@@ -178,9 +177,19 @@ static void isolate_freepages(struct zone *zone,
 		if (!suitable_migration_target(page))
 			continue;
 
-		/* Found a block suitable for isolating free pages from */
-		isolated = isolate_freepages_block(zone, pfn, freelist);
-		nr_freepages += isolated;
+		/*
+		 * Found a block suitable for isolating free pages from. Now
+		 * we disabled interrupts, double check things are ok and
+		 * isolate the pages. This is to minimise the time IRQs
+		 * are disabled
+		 */
+		isolated = 0;
+		spin_lock_irqsave(&zone->lock, flags);
+		if (suitable_migration_target(page)) {
+			isolated = isolate_freepages_block(zone, pfn, freelist);
+			nr_freepages += isolated;
+		}
+		spin_unlock_irqrestore(&zone->lock, flags);
 
 		/*
 		 * Record the highest PFN we isolated pages from. When next
@@ -190,7 +199,6 @@ static void isolate_freepages(struct zone *zone,
 		if (isolated)
 			high_pfn = max(high_pfn, pfn);
 	}
-	spin_unlock_irqrestore(&zone->lock, flags);
 
 	/* split_free_page does not map the pages */
 	list_for_each_entry(page, freelist, lru) {
-- 
1.7.2.3

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] mm: compaction: Minimise the time IRQs are disabled while isolating free pages
  2011-02-25 20:04 ` [PATCH 1/2] mm: compaction: Minimise the time IRQs are disabled while isolating free pages Mel Gorman
@ 2011-02-25 22:34   ` Johannes Weiner
  2011-02-28  1:55   ` KAMEZAWA Hiroyuki
  2011-02-28 22:08   ` Minchan Kim
  2 siblings, 0 replies; 7+ messages in thread
From: Johannes Weiner @ 2011-02-25 22:34 UTC (permalink / raw)
  To: Mel Gorman
  Cc: Andrew Morton, Arthur Marsh, Clemens Ladisch, Andrea Arcangeli,
	Linux-MM, Linux Kernel Mailing List

On Fri, Feb 25, 2011 at 08:04:58PM +0000, Mel Gorman wrote:
> compaction_alloc() isolates free pages to be used as migration targets.
> While its scanning, IRQs are disabled on the mistaken assumption the scanning
> should be short. Analysis showed that IRQs were in fact being disabled for
> substantial time. A simple test was run using large anonymous mappings with
> transparent hugepage support enabled to trigger frequent compactions. A
> monitor sampled what the worst IRQ-off latencies were and a post-processing
> tool found the following;
> 
> Total sampled time IRQs off (not real total time): 22355
> Event compaction_alloc..compaction_alloc                 8409 us count 1
> Event compaction_alloc..compaction_alloc                 7341 us count 1
> Event compaction_alloc..compaction_alloc                 2463 us count 1
> Event compaction_alloc..compaction_alloc                 2054 us count 1
> Event shrink_inactive_list..shrink_zone                  1864 us count 1
> Event shrink_inactive_list..shrink_zone                    88 us count 1
> Event save_args..call_softirq                              36 us count 1
> Event save_args..call_softirq                              35 us count 2
> Event __make_request..__blk_run_queue                      24 us count 1
> Event __alloc_pages_nodemask..__alloc_pages_nodemask        6 us count 1
> 
> i.e. compaction is disabled IRQs for a prolonged period of time - 8ms in
> one instance. The full report generated by the tool can be found at
> http://www.csn.ul.ie/~mel/postings/minfree-20110225/irqsoff-vanilla-micro.report .
> This patch reduces the time IRQs are disabled by simply disabling IRQs
> at the last possible minute. An updated IRQs-off summary report then
> looks like;
> 
> Total sampled time IRQs off (not real total time): 5493
> Event shrink_inactive_list..shrink_zone                  1596 us count 1
> Event shrink_inactive_list..shrink_zone                  1530 us count 1
> Event shrink_inactive_list..shrink_zone                   956 us count 1
> Event shrink_inactive_list..shrink_zone                   541 us count 1
> Event shrink_inactive_list..shrink_zone                   531 us count 1
> Event split_huge_page..add_to_swap                        232 us count 1
> Event save_args..call_softirq                              36 us count 1
> Event save_args..call_softirq                              35 us count 2
> Event __wake_up..__wake_up                                  1 us count 1
> 
> A full report is again available at
> http://www.csn.ul.ie/~mel/postings/minfree-20110225/irqsoff-minimiseirq-free-v1r4-micro.report .
> . As should be obvious, IRQ disabled latencies due to compaction are
> almost elimimnated for this particular test.
> 
> [aarcange@redhat.com: Fix initialisation of isolated]
> Signed-off-by: Mel Gorman <mel@csn.ul.ie>

Acked-by: Johannes Weiner <hannes@cmpxchg.org>

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] mm: compaction: Minimise the time IRQs are disabled while isolating free pages
  2011-02-25 20:04 ` [PATCH 1/2] mm: compaction: Minimise the time IRQs are disabled while isolating free pages Mel Gorman
  2011-02-25 22:34   ` Johannes Weiner
@ 2011-02-28  1:55   ` KAMEZAWA Hiroyuki
  2011-02-28 22:08   ` Minchan Kim
  2 siblings, 0 replies; 7+ messages in thread
From: KAMEZAWA Hiroyuki @ 2011-02-28  1:55 UTC (permalink / raw)
  To: Mel Gorman
  Cc: Andrew Morton, Arthur Marsh, Clemens Ladisch, Andrea Arcangeli,
	Linux-MM, Linux Kernel Mailing List

On Fri, 25 Feb 2011 20:04:58 +0000
Mel Gorman <mel@csn.ul.ie> wrote:

> compaction_alloc() isolates free pages to be used as migration targets.
> While its scanning, IRQs are disabled on the mistaken assumption the scanning
> should be short. Analysis showed that IRQs were in fact being disabled for
> substantial time. A simple test was run using large anonymous mappings with
> transparent hugepage support enabled to trigger frequent compactions. A
> monitor sampled what the worst IRQ-off latencies were and a post-processing
> tool found the following;
> 
> Total sampled time IRQs off (not real total time): 22355
> Event compaction_alloc..compaction_alloc                 8409 us count 1
> Event compaction_alloc..compaction_alloc                 7341 us count 1
> Event compaction_alloc..compaction_alloc                 2463 us count 1
> Event compaction_alloc..compaction_alloc                 2054 us count 1
> Event shrink_inactive_list..shrink_zone                  1864 us count 1
> Event shrink_inactive_list..shrink_zone                    88 us count 1
> Event save_args..call_softirq                              36 us count 1
> Event save_args..call_softirq                              35 us count 2
> Event __make_request..__blk_run_queue                      24 us count 1
> Event __alloc_pages_nodemask..__alloc_pages_nodemask        6 us count 1
> 
> i.e. compaction is disabled IRQs for a prolonged period of time - 8ms in
> one instance. The full report generated by the tool can be found at
> http://www.csn.ul.ie/~mel/postings/minfree-20110225/irqsoff-vanilla-micro.report .
> This patch reduces the time IRQs are disabled by simply disabling IRQs
> at the last possible minute. An updated IRQs-off summary report then
> looks like;
> 
> Total sampled time IRQs off (not real total time): 5493
> Event shrink_inactive_list..shrink_zone                  1596 us count 1
> Event shrink_inactive_list..shrink_zone                  1530 us count 1
> Event shrink_inactive_list..shrink_zone                   956 us count 1
> Event shrink_inactive_list..shrink_zone                   541 us count 1
> Event shrink_inactive_list..shrink_zone                   531 us count 1
> Event split_huge_page..add_to_swap                        232 us count 1
> Event save_args..call_softirq                              36 us count 1
> Event save_args..call_softirq                              35 us count 2
> Event __wake_up..__wake_up                                  1 us count 1
> 
> A full report is again available at
> http://www.csn.ul.ie/~mel/postings/minfree-20110225/irqsoff-minimiseirq-free-v1r4-micro.report .
> . As should be obvious, IRQ disabled latencies due to compaction are
> almost elimimnated for this particular test.
> 
> [aarcange@redhat.com: Fix initialisation of isolated]
> Signed-off-by: Mel Gorman <mel@csn.ul.ie>

Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujisu.com>

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] mm: compaction: Minimise the time IRQs are disabled while isolating free pages
  2011-02-25 20:04 ` [PATCH 1/2] mm: compaction: Minimise the time IRQs are disabled while isolating free pages Mel Gorman
  2011-02-25 22:34   ` Johannes Weiner
  2011-02-28  1:55   ` KAMEZAWA Hiroyuki
@ 2011-02-28 22:08   ` Minchan Kim
  2 siblings, 0 replies; 7+ messages in thread
From: Minchan Kim @ 2011-02-28 22:08 UTC (permalink / raw)
  To: Mel Gorman
  Cc: Andrew Morton, Arthur Marsh, Clemens Ladisch, Andrea Arcangeli,
	Linux-MM, Linux Kernel Mailing List

On Fri, Feb 25, 2011 at 08:04:58PM +0000, Mel Gorman wrote:
> compaction_alloc() isolates free pages to be used as migration targets.
> While its scanning, IRQs are disabled on the mistaken assumption the scanning
> should be short. Analysis showed that IRQs were in fact being disabled for
> substantial time. A simple test was run using large anonymous mappings with
> transparent hugepage support enabled to trigger frequent compactions. A
> monitor sampled what the worst IRQ-off latencies were and a post-processing
> tool found the following;
> 
> Total sampled time IRQs off (not real total time): 22355
> Event compaction_alloc..compaction_alloc                 8409 us count 1
> Event compaction_alloc..compaction_alloc                 7341 us count 1
> Event compaction_alloc..compaction_alloc                 2463 us count 1
> Event compaction_alloc..compaction_alloc                 2054 us count 1
> Event shrink_inactive_list..shrink_zone                  1864 us count 1
> Event shrink_inactive_list..shrink_zone                    88 us count 1
> Event save_args..call_softirq                              36 us count 1
> Event save_args..call_softirq                              35 us count 2
> Event __make_request..__blk_run_queue                      24 us count 1
> Event __alloc_pages_nodemask..__alloc_pages_nodemask        6 us count 1
> 
> i.e. compaction is disabled IRQs for a prolonged period of time - 8ms in
> one instance. The full report generated by the tool can be found at
> http://www.csn.ul.ie/~mel/postings/minfree-20110225/irqsoff-vanilla-micro.report .
> This patch reduces the time IRQs are disabled by simply disabling IRQs
> at the last possible minute. An updated IRQs-off summary report then
> looks like;
> 
> Total sampled time IRQs off (not real total time): 5493
> Event shrink_inactive_list..shrink_zone                  1596 us count 1
> Event shrink_inactive_list..shrink_zone                  1530 us count 1
> Event shrink_inactive_list..shrink_zone                   956 us count 1
> Event shrink_inactive_list..shrink_zone                   541 us count 1
> Event shrink_inactive_list..shrink_zone                   531 us count 1
> Event split_huge_page..add_to_swap                        232 us count 1
> Event save_args..call_softirq                              36 us count 1
> Event save_args..call_softirq                              35 us count 2
> Event __wake_up..__wake_up                                  1 us count 1
> 
> A full report is again available at
> http://www.csn.ul.ie/~mel/postings/minfree-20110225/irqsoff-minimiseirq-free-v1r4-micro.report .
> . As should be obvious, IRQ disabled latencies due to compaction are
> almost elimimnated for this particular test.
> 
> [aarcange@redhat.com: Fix initialisation of isolated]
> Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>

-- 
Kind regards,
Minchan Kim

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-02-28 22:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-25 18:00 [PATCH 0/2] Reduce the amount of time compaction disables IRQs for Mel Gorman
2011-02-25 18:00 ` [PATCH 1/2] mm: compaction: Minimise the time IRQs are disabled while isolating free pages Mel Gorman
2011-02-25 18:00 ` [PATCH 2/2] mm: compaction: Minimise the time IRQs are disabled while isolating pages for migration Mel Gorman
  -- strict thread matches above, loose matches on Subject: below --
2011-02-25 20:04 [PATCH 0/2] Reduce the amount of time compaction disables IRQs for V2 Mel Gorman
2011-02-25 20:04 ` [PATCH 1/2] mm: compaction: Minimise the time IRQs are disabled while isolating free pages Mel Gorman
2011-02-25 22:34   ` Johannes Weiner
2011-02-28  1:55   ` KAMEZAWA Hiroyuki
2011-02-28 22:08   ` Minchan Kim

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).