All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Two fixes for patch vmscan-properly-account-for-the-number-of-page-cache-pages-zone_reclaim-can-reclaim.patch
@ 2009-06-15 11:14 ` Mel Gorman
  0 siblings, 0 replies; 10+ messages in thread
From: Mel Gorman @ 2009-06-15 11:14 UTC (permalink / raw)
  To: Mel Gorman, Andrew Morton, KOSAKI Motohiro
  Cc: Rik van Riel, Christoph Lameter, Wu Fengguang, linuxram, linux-mm, LKML

The following two patches fix up problems to patch
vmscan-properly-account-for-the-number-of-page-cache-pages-zone_reclaim-can-reclaim.patch
identified by Kosaki.

 Documentation/sysctl/vm.txt |   12 ++++++++----
 mm/vmscan.c                 |    6 +++++-
 2 files changed, 13 insertions(+), 5 deletions(-)


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

* [PATCH 0/2] Two fixes for patch vmscan-properly-account-for-the-number-of-page-cache-pages-zone_reclaim-can-reclaim.patch
@ 2009-06-15 11:14 ` Mel Gorman
  0 siblings, 0 replies; 10+ messages in thread
From: Mel Gorman @ 2009-06-15 11:14 UTC (permalink / raw)
  To: Mel Gorman, Andrew Morton, KOSAKI Motohiro
  Cc: Rik van Riel, Christoph Lameter, Wu Fengguang, linuxram, linux-mm, LKML

The following two patches fix up problems to patch
vmscan-properly-account-for-the-number-of-page-cache-pages-zone_reclaim-can-reclaim.patch
identified by Kosaki.

 Documentation/sysctl/vm.txt |   12 ++++++++----
 mm/vmscan.c                 |    6 +++++-
 2 files changed, 13 insertions(+), 5 deletions(-)

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

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

* [PATCH 1/2] vmscan: Fix use of delta in zone_pagecache_reclaimable()
  2009-06-15 11:14 ` Mel Gorman
@ 2009-06-15 11:14   ` Mel Gorman
  -1 siblings, 0 replies; 10+ messages in thread
From: Mel Gorman @ 2009-06-15 11:14 UTC (permalink / raw)
  To: Mel Gorman, Andrew Morton, KOSAKI Motohiro
  Cc: Rik van Riel, Christoph Lameter, Wu Fengguang, linuxram, linux-mm, LKML

zone_pagecache_reclaimable() works out how many pages are in a state
that zone_reclaim() can reclaim based on the current zone_reclaim_mode.
As part of this, it calculates a delta to the number of unmapped pages.
The code was meant to check delta would not cause underflows and then apply
it but it got accidentally removed.

This patch properly uses delta. It's excessively paranoid at the moment
because it's impossible to underflow but the current form will make future
patches to zone_pagecache_reclaimable() fixing any other scan-heuristic
breakage easier to read and acts as self-documentation reminding authors
of future patches to consider underflow.

This is a fix to patch
vmscan-properly-account-for-the-number-of-page-cache-pages-zone_reclaim-can-reclaim.patch
and they should be merged together.

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

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 026f452..bd8e3ed 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2398,7 +2398,11 @@ static long zone_pagecache_reclaimable(struct zone *zone)
 	if (!(zone_reclaim_mode & RECLAIM_WRITE))
 		delta += zone_page_state(zone, NR_FILE_DIRTY);
 
-	return nr_pagecache_reclaimable;
+	/* Watch for any possible underflows due to delta */
+	if (unlikely(delta > nr_pagecache_reclaimable))
+		delta = nr_pagecache_reclaimable;
+
+	return nr_pagecache_reclaimable - delta;
 }
 
 /*
-- 
1.5.6.5


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

* [PATCH 1/2] vmscan: Fix use of delta in zone_pagecache_reclaimable()
@ 2009-06-15 11:14   ` Mel Gorman
  0 siblings, 0 replies; 10+ messages in thread
From: Mel Gorman @ 2009-06-15 11:14 UTC (permalink / raw)
  To: Mel Gorman, Andrew Morton, KOSAKI Motohiro
  Cc: Rik van Riel, Christoph Lameter, Wu Fengguang, linuxram, linux-mm, LKML

zone_pagecache_reclaimable() works out how many pages are in a state
that zone_reclaim() can reclaim based on the current zone_reclaim_mode.
As part of this, it calculates a delta to the number of unmapped pages.
The code was meant to check delta would not cause underflows and then apply
it but it got accidentally removed.

This patch properly uses delta. It's excessively paranoid at the moment
because it's impossible to underflow but the current form will make future
patches to zone_pagecache_reclaimable() fixing any other scan-heuristic
breakage easier to read and acts as self-documentation reminding authors
of future patches to consider underflow.

This is a fix to patch
vmscan-properly-account-for-the-number-of-page-cache-pages-zone_reclaim-can-reclaim.patch
and they should be merged together.

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

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 026f452..bd8e3ed 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2398,7 +2398,11 @@ static long zone_pagecache_reclaimable(struct zone *zone)
 	if (!(zone_reclaim_mode & RECLAIM_WRITE))
 		delta += zone_page_state(zone, NR_FILE_DIRTY);
 
-	return nr_pagecache_reclaimable;
+	/* Watch for any possible underflows due to delta */
+	if (unlikely(delta > nr_pagecache_reclaimable))
+		delta = nr_pagecache_reclaimable;
+
+	return nr_pagecache_reclaimable - delta;
 }
 
 /*
-- 
1.5.6.5

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

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

* [PATCH 2/2] mm: Fix documentation of min_unmapped_ratio
  2009-06-15 11:14 ` Mel Gorman
@ 2009-06-15 11:14   ` Mel Gorman
  -1 siblings, 0 replies; 10+ messages in thread
From: Mel Gorman @ 2009-06-15 11:14 UTC (permalink / raw)
  To: Mel Gorman, Andrew Morton, KOSAKI Motohiro
  Cc: Rik van Riel, Christoph Lameter, Wu Fengguang, linuxram, linux-mm, LKML

Kosaki Motohiro pointed out that the documentation for
min_unmapped_ratio no longer matches the implementation. This patch
updates the documentation.

This patch can be merged with
vmscan-properly-account-for-the-number-of-page-cache-pages-zone_reclaim-can-re
claim.patch .

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
---
 Documentation/sysctl/vm.txt |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt
index 0ea5adb..c4de635 100644
--- a/Documentation/sysctl/vm.txt
+++ b/Documentation/sysctl/vm.txt
@@ -315,10 +315,14 @@ min_unmapped_ratio:
 
 This is available only on NUMA kernels.
 
-A percentage of the total pages in each zone.  Zone reclaim will only
-occur if more than this percentage of pages are file backed and unmapped.
-This is to insure that a minimal amount of local pages is still available for
-file I/O even if the node is overallocated.
+This is a percentage of the total pages in each zone. Zone reclaim will
+only occur if more than this percentage of pages are in a state that
+zone_reclaim_mode allows to be reclaimed.
+
+If zone_reclaim_mode has the value 4 OR'd, then the percentage is compared
+against all file-backed unmapped pages including swapcache pages and tmpfs
+files. Otherwise, only unmapped pages backed by normal files but not tmpfs
+files and similar are considered.
 
 The default is 1 percent.
 
-- 
1.5.6.5


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

* [PATCH 2/2] mm: Fix documentation of min_unmapped_ratio
@ 2009-06-15 11:14   ` Mel Gorman
  0 siblings, 0 replies; 10+ messages in thread
From: Mel Gorman @ 2009-06-15 11:14 UTC (permalink / raw)
  To: Mel Gorman, Andrew Morton, KOSAKI Motohiro
  Cc: Rik van Riel, Christoph Lameter, Wu Fengguang, linuxram, linux-mm, LKML

Kosaki Motohiro pointed out that the documentation for
min_unmapped_ratio no longer matches the implementation. This patch
updates the documentation.

This patch can be merged with
vmscan-properly-account-for-the-number-of-page-cache-pages-zone_reclaim-can-re
claim.patch .

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
---
 Documentation/sysctl/vm.txt |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt
index 0ea5adb..c4de635 100644
--- a/Documentation/sysctl/vm.txt
+++ b/Documentation/sysctl/vm.txt
@@ -315,10 +315,14 @@ min_unmapped_ratio:
 
 This is available only on NUMA kernels.
 
-A percentage of the total pages in each zone.  Zone reclaim will only
-occur if more than this percentage of pages are file backed and unmapped.
-This is to insure that a minimal amount of local pages is still available for
-file I/O even if the node is overallocated.
+This is a percentage of the total pages in each zone. Zone reclaim will
+only occur if more than this percentage of pages are in a state that
+zone_reclaim_mode allows to be reclaimed.
+
+If zone_reclaim_mode has the value 4 OR'd, then the percentage is compared
+against all file-backed unmapped pages including swapcache pages and tmpfs
+files. Otherwise, only unmapped pages backed by normal files but not tmpfs
+files and similar are considered.
 
 The default is 1 percent.
 
-- 
1.5.6.5

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

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

* Re: [PATCH 1/2] vmscan: Fix use of delta in zone_pagecache_reclaimable()
  2009-06-15 11:14   ` Mel Gorman
@ 2009-06-16  9:41     ` KOSAKI Motohiro
  -1 siblings, 0 replies; 10+ messages in thread
From: KOSAKI Motohiro @ 2009-06-16  9:41 UTC (permalink / raw)
  To: Mel Gorman
  Cc: kosaki.motohiro, Andrew Morton, Rik van Riel, Christoph Lameter,
	Wu Fengguang, linuxram, linux-mm, LKML

> zone_pagecache_reclaimable() works out how many pages are in a state
> that zone_reclaim() can reclaim based on the current zone_reclaim_mode.
> As part of this, it calculates a delta to the number of unmapped pages.
> The code was meant to check delta would not cause underflows and then apply
> it but it got accidentally removed.
> 
> This patch properly uses delta. It's excessively paranoid at the moment
> because it's impossible to underflow but the current form will make future
> patches to zone_pagecache_reclaimable() fixing any other scan-heuristic
> breakage easier to read and acts as self-documentation reminding authors
> of future patches to consider underflow.
> 
> This is a fix to patch
> vmscan-properly-account-for-the-number-of-page-cache-pages-zone_reclaim-can-reclaim.patch
> and they should be merged together.
> 
> Signed-off-by: Mel Gorman <mel@csn.ul.ie>
> ---
>  mm/vmscan.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 026f452..bd8e3ed 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -2398,7 +2398,11 @@ static long zone_pagecache_reclaimable(struct zone *zone)
>  	if (!(zone_reclaim_mode & RECLAIM_WRITE))
>  		delta += zone_page_state(zone, NR_FILE_DIRTY);
>  
> -	return nr_pagecache_reclaimable;
> +	/* Watch for any possible underflows due to delta */
> +	if (unlikely(delta > nr_pagecache_reclaimable))
> +		delta = nr_pagecache_reclaimable;
> +
> +	return nr_pagecache_reclaimable - delta;
>  }

looks good. thanks.




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

* Re: [PATCH 1/2] vmscan: Fix use of delta in zone_pagecache_reclaimable()
@ 2009-06-16  9:41     ` KOSAKI Motohiro
  0 siblings, 0 replies; 10+ messages in thread
From: KOSAKI Motohiro @ 2009-06-16  9:41 UTC (permalink / raw)
  To: Mel Gorman
  Cc: kosaki.motohiro, Andrew Morton, Rik van Riel, Christoph Lameter,
	Wu Fengguang, linuxram, linux-mm, LKML

> zone_pagecache_reclaimable() works out how many pages are in a state
> that zone_reclaim() can reclaim based on the current zone_reclaim_mode.
> As part of this, it calculates a delta to the number of unmapped pages.
> The code was meant to check delta would not cause underflows and then apply
> it but it got accidentally removed.
> 
> This patch properly uses delta. It's excessively paranoid at the moment
> because it's impossible to underflow but the current form will make future
> patches to zone_pagecache_reclaimable() fixing any other scan-heuristic
> breakage easier to read and acts as self-documentation reminding authors
> of future patches to consider underflow.
> 
> This is a fix to patch
> vmscan-properly-account-for-the-number-of-page-cache-pages-zone_reclaim-can-reclaim.patch
> and they should be merged together.
> 
> Signed-off-by: Mel Gorman <mel@csn.ul.ie>
> ---
>  mm/vmscan.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 026f452..bd8e3ed 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -2398,7 +2398,11 @@ static long zone_pagecache_reclaimable(struct zone *zone)
>  	if (!(zone_reclaim_mode & RECLAIM_WRITE))
>  		delta += zone_page_state(zone, NR_FILE_DIRTY);
>  
> -	return nr_pagecache_reclaimable;
> +	/* Watch for any possible underflows due to delta */
> +	if (unlikely(delta > nr_pagecache_reclaimable))
> +		delta = nr_pagecache_reclaimable;
> +
> +	return nr_pagecache_reclaimable - delta;
>  }

looks good. thanks.



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

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

* Re: [PATCH 2/2] mm: Fix documentation of min_unmapped_ratio
  2009-06-15 11:14   ` Mel Gorman
@ 2009-06-16  9:41     ` KOSAKI Motohiro
  -1 siblings, 0 replies; 10+ messages in thread
From: KOSAKI Motohiro @ 2009-06-16  9:41 UTC (permalink / raw)
  To: Mel Gorman
  Cc: kosaki.motohiro, Andrew Morton, Rik van Riel, Christoph Lameter,
	Wu Fengguang, linuxram, linux-mm, LKML

> -A percentage of the total pages in each zone.  Zone reclaim will only
> -occur if more than this percentage of pages are file backed and unmapped.
> -This is to insure that a minimal amount of local pages is still available for
> -file I/O even if the node is overallocated.
> +This is a percentage of the total pages in each zone. Zone reclaim will
> +only occur if more than this percentage of pages are in a state that
> +zone_reclaim_mode allows to be reclaimed.
> +
> +If zone_reclaim_mode has the value 4 OR'd, then the percentage is compared
> +against all file-backed unmapped pages including swapcache pages and tmpfs
> +files. Otherwise, only unmapped pages backed by normal files but not tmpfs
> +files and similar are considered.
>  
>  The default is 1 percent.

looks good.




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

* Re: [PATCH 2/2] mm: Fix documentation of min_unmapped_ratio
@ 2009-06-16  9:41     ` KOSAKI Motohiro
  0 siblings, 0 replies; 10+ messages in thread
From: KOSAKI Motohiro @ 2009-06-16  9:41 UTC (permalink / raw)
  To: Mel Gorman
  Cc: kosaki.motohiro, Andrew Morton, Rik van Riel, Christoph Lameter,
	Wu Fengguang, linuxram, linux-mm, LKML

> -A percentage of the total pages in each zone.  Zone reclaim will only
> -occur if more than this percentage of pages are file backed and unmapped.
> -This is to insure that a minimal amount of local pages is still available for
> -file I/O even if the node is overallocated.
> +This is a percentage of the total pages in each zone. Zone reclaim will
> +only occur if more than this percentage of pages are in a state that
> +zone_reclaim_mode allows to be reclaimed.
> +
> +If zone_reclaim_mode has the value 4 OR'd, then the percentage is compared
> +against all file-backed unmapped pages including swapcache pages and tmpfs
> +files. Otherwise, only unmapped pages backed by normal files but not tmpfs
> +files and similar are considered.
>  
>  The default is 1 percent.

looks good.



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

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

end of thread, other threads:[~2009-06-16  9:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-15 11:14 [PATCH 0/2] Two fixes for patch vmscan-properly-account-for-the-number-of-page-cache-pages-zone_reclaim-can-reclaim.patch Mel Gorman
2009-06-15 11:14 ` Mel Gorman
2009-06-15 11:14 ` [PATCH 1/2] vmscan: Fix use of delta in zone_pagecache_reclaimable() Mel Gorman
2009-06-15 11:14   ` Mel Gorman
2009-06-16  9:41   ` KOSAKI Motohiro
2009-06-16  9:41     ` KOSAKI Motohiro
2009-06-15 11:14 ` [PATCH 2/2] mm: Fix documentation of min_unmapped_ratio Mel Gorman
2009-06-15 11:14   ` Mel Gorman
2009-06-16  9:41   ` KOSAKI Motohiro
2009-06-16  9:41     ` KOSAKI Motohiro

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.