Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1447907 > unrolled thread

[PATCH 2/5] mm, vmscan: Remove highmem_file_pages

Started byMel Gorman <mgorman@techsingularity.net>
First post2016-07-21 16:20 +0200
Last post2016-07-25 11:30 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/5] mm, vmscan: Remove highmem_file_pages Mel Gorman <mgorman@techsingularity.net> - 2016-07-21 16:20 +0200
    Re: [PATCH 2/5] mm, vmscan: Remove highmem_file_pages Johannes Weiner <hannes@cmpxchg.org> - 2016-07-22 18:00 +0200
    Re: [PATCH 2/5] mm, vmscan: Remove highmem_file_pages Minchan Kim <minchan@kernel.org> - 2016-07-25 10:10 +0200
      [PATCH] mm, vmscan: remove highmem_file_pages -fix Mel Gorman <mgorman@techsingularity.net> - 2016-07-25 11:30 +0200

#1447907 — [PATCH 2/5] mm, vmscan: Remove highmem_file_pages

FromMel Gorman <mgorman@techsingularity.net>
Date2016-07-21 16:20 +0200
Subject[PATCH 2/5] mm, vmscan: Remove highmem_file_pages
Message-ID<rXmZs-8w7-13@gated-at.bofh.it>
With the reintroduction of per-zone LRU stats, highmem_file_pages is
redundant so remove it.

Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
---
 include/linux/mm_inline.h | 17 -----------------
 mm/page-writeback.c       | 12 ++++--------
 2 files changed, 4 insertions(+), 25 deletions(-)

diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h
index 9cc130f5feb2..71613e8a720f 100644
--- a/include/linux/mm_inline.h
+++ b/include/linux/mm_inline.h
@@ -4,22 +4,6 @@
 #include <linux/huge_mm.h>
 #include <linux/swap.h>
 
-#ifdef CONFIG_HIGHMEM
-extern atomic_t highmem_file_pages;
-
-static inline void acct_highmem_file_pages(int zid, enum lru_list lru,
-							int nr_pages)
-{
-	if (is_highmem_idx(zid) && is_file_lru(lru))
-		atomic_add(nr_pages, &highmem_file_pages);
-}
-#else
-static inline void acct_highmem_file_pages(int zid, enum lru_list lru,
-							int nr_pages)
-{
-}
-#endif
-
 /**
  * page_is_file_cache - should the page be on a file LRU or anon LRU?
  * @page: the page to test
@@ -47,7 +31,6 @@ static __always_inline void __update_lru_size(struct lruvec *lruvec,
 	__mod_node_page_state(pgdat, NR_LRU_BASE + lru, nr_pages);
 	__mod_zone_page_state(&pgdat->node_zones[zid],
 				NR_ZONE_LRU_BASE + lru, nr_pages);
-	acct_highmem_file_pages(zid, lru, nr_pages);
 }
 
 static __always_inline void update_lru_size(struct lruvec *lruvec,
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 573d138fa7a5..cfa78124c3c2 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -299,17 +299,13 @@ static unsigned long node_dirtyable_memory(struct pglist_data *pgdat)
 
 	return nr_pages;
 }
-#ifdef CONFIG_HIGHMEM
-atomic_t highmem_file_pages;
-#endif
 
 static unsigned long highmem_dirtyable_memory(unsigned long total)
 {
 #ifdef CONFIG_HIGHMEM
 	int node;
-	unsigned long x;
+	unsigned long x = 0;
 	int i;
-	unsigned long dirtyable = 0;
 
 	for_each_node_state(node, N_HIGH_MEMORY) {
 		for (i = ZONE_NORMAL + 1; i < MAX_NR_ZONES; i++) {
@@ -326,12 +322,12 @@ static unsigned long highmem_dirtyable_memory(unsigned long total)
 			nr_pages = zone_page_state(z, NR_FREE_PAGES);
 			/* watch for underflows */
 			nr_pages -= min(nr_pages, high_wmark_pages(z));
-			dirtyable += nr_pages;
+			nr_pages += zone_page_state(z, NR_INACTIVE_FILE);
+			nr_pages += zone_page_state(z, NR_ACTIVE_FILE);
+			x += nr_pages;
 		}
 	}
 
-	x = dirtyable + atomic_read(&highmem_file_pages);
-
 	/*
 	 * Unreclaimable memory (kernel memory or anonymous memory
 	 * without swap) can bring down the dirtyable pages below
-- 
2.6.4

[toc] | [next] | [standalone]


#1448656

FromJohannes Weiner <hannes@cmpxchg.org>
Date2016-07-22 18:00 +0200
Message-ID<rXL1M-7Ib-25@gated-at.bofh.it>
In reply to#1447907
On Thu, Jul 21, 2016 at 03:10:58PM +0100, Mel Gorman wrote:
> With the reintroduction of per-zone LRU stats, highmem_file_pages is
> redundant so remove it.
> 
> Signed-off-by: Mel Gorman <mgorman@techsingularity.net>

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

[toc] | [prev] | [next] | [standalone]


#1449348

FromMinchan Kim <minchan@kernel.org>
Date2016-07-25 10:10 +0200
Message-ID<rYJ7z-2aj-17@gated-at.bofh.it>
In reply to#1447907
On Thu, Jul 21, 2016 at 03:10:58PM +0100, Mel Gorman wrote:
> With the reintroduction of per-zone LRU stats, highmem_file_pages is
> redundant so remove it.
> 
> Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
> ---
>  include/linux/mm_inline.h | 17 -----------------
>  mm/page-writeback.c       | 12 ++++--------
>  2 files changed, 4 insertions(+), 25 deletions(-)
> 
> diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h
> index 9cc130f5feb2..71613e8a720f 100644
> --- a/include/linux/mm_inline.h
> +++ b/include/linux/mm_inline.h
> @@ -4,22 +4,6 @@
>  #include <linux/huge_mm.h>
>  #include <linux/swap.h>
>  
> -#ifdef CONFIG_HIGHMEM
> -extern atomic_t highmem_file_pages;
> -
> -static inline void acct_highmem_file_pages(int zid, enum lru_list lru,
> -							int nr_pages)
> -{
> -	if (is_highmem_idx(zid) && is_file_lru(lru))
> -		atomic_add(nr_pages, &highmem_file_pages);
> -}
> -#else
> -static inline void acct_highmem_file_pages(int zid, enum lru_list lru,
> -							int nr_pages)
> -{
> -}
> -#endif
> -
>  /**
>   * page_is_file_cache - should the page be on a file LRU or anon LRU?
>   * @page: the page to test
> @@ -47,7 +31,6 @@ static __always_inline void __update_lru_size(struct lruvec *lruvec,
>  	__mod_node_page_state(pgdat, NR_LRU_BASE + lru, nr_pages);
>  	__mod_zone_page_state(&pgdat->node_zones[zid],
>  				NR_ZONE_LRU_BASE + lru, nr_pages);
> -	acct_highmem_file_pages(zid, lru, nr_pages);
>  }
>  
>  static __always_inline void update_lru_size(struct lruvec *lruvec,
> diff --git a/mm/page-writeback.c b/mm/page-writeback.c
> index 573d138fa7a5..cfa78124c3c2 100644
> --- a/mm/page-writeback.c
> +++ b/mm/page-writeback.c
> @@ -299,17 +299,13 @@ static unsigned long node_dirtyable_memory(struct pglist_data *pgdat)
>  
>  	return nr_pages;
>  }
> -#ifdef CONFIG_HIGHMEM
> -atomic_t highmem_file_pages;
> -#endif
>  
>  static unsigned long highmem_dirtyable_memory(unsigned long total)
>  {
>  #ifdef CONFIG_HIGHMEM
>  	int node;
> -	unsigned long x;
> +	unsigned long x = 0;
>  	int i;
> -	unsigned long dirtyable = 0;
>  
>  	for_each_node_state(node, N_HIGH_MEMORY) {
>  		for (i = ZONE_NORMAL + 1; i < MAX_NR_ZONES; i++) {
> @@ -326,12 +322,12 @@ static unsigned long highmem_dirtyable_memory(unsigned long total)
>  			nr_pages = zone_page_state(z, NR_FREE_PAGES);
>  			/* watch for underflows */
>  			nr_pages -= min(nr_pages, high_wmark_pages(z));
> -			dirtyable += nr_pages;
> +			nr_pages += zone_page_state(z, NR_INACTIVE_FILE);

                                                       NR_ZONE_INACTIVE_FILE

> +			nr_pages += zone_page_state(z, NR_ACTIVE_FILE);

                                                       NR_ZONE_ACTIVE_FILE

> +			x += nr_pages;

[toc] | [prev] | [next] | [standalone]


#1449396 — [PATCH] mm, vmscan: remove highmem_file_pages -fix

FromMel Gorman <mgorman@techsingularity.net>
Date2016-07-25 11:30 +0200
Subject[PATCH] mm, vmscan: remove highmem_file_pages -fix
Message-ID<rYKmZ-2Pk-7@gated-at.bofh.it>
In reply to#1449348
The wrong stat is being accumulatedin highmem_dirtyable_memory, fix it.

This is a fix to the mmotm patch mm-vmscan-remove-highmem_file_pages.patch

Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
---
 mm/page-writeback.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 7e9061ec040b..f4cd7d8005c9 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -322,8 +322,8 @@ static unsigned long highmem_dirtyable_memory(unsigned long total)
 			nr_pages = zone_page_state(z, NR_FREE_PAGES);
 			/* watch for underflows */
 			nr_pages -= min(nr_pages, high_wmark_pages(z));
-			nr_pages += zone_page_state(z, NR_INACTIVE_FILE);
-			nr_pages += zone_page_state(z, NR_ACTIVE_FILE);
+			nr_pages += zone_page_state(z, NR_ZONE_INACTIVE_FILE);
+			nr_pages += zone_page_state(z, NR_ZONE_ACTIVE_FILE);
 			x += nr_pages;
 		}
 	}

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web