Skip to contentSkip to conversation

mm/vmscan: remove pglist_data->inactive_ratio

PATCH In review Ganesh Mahendran 2 participants 3 messages Jul 19, 2016 – Jul 21, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/vmscan: remove pglist_data->inactive_ratio

In patch [1], the inactive_ratio is now automatically calculated in inactive_list_is_low(). So there is no need to keep inactive_ratio in pglist_data, and shown in zoneinfo.

[1] mm: vmscan: reduce size of inactive file list

---
 include/linux/mmzone.h | 6 ------
 mm/vmscan.c            | 2 +-
 mm/vmstat.c            | 6 ++----
 3 files changed, 3 insertions(+), 11 deletions(-)
include/linux/mmzone.h +0 -6
index a3b7f45..b3ade54 100644
@@ -700,12 +700,6 @@ typedef struct pglist_data {
 	/* Fields commonly accessed by the page reclaim scanner */
 	struct lruvec		lruvec;
 
-	/*
-	 * The target ratio of ACTIVE_ANON to INACTIVE_ANON pages on
-	 * this node's LRU.  Maintained by the pageout code.
-	 */
-	unsigned int inactive_ratio;
-
 	unsigned long		flags;
 
 	ZONE_PADDING(_pad2_)
mm/vmscan.c +1 -1
index 429bf3a..3c1de58 100644
@@ -1915,7 +1915,7 @@ static void shrink_active_list(unsigned long nr_to_scan,
  * page has a chance to be referenced again before it is reclaimed.
  *
  * The inactive_ratio is the target ratio of ACTIVE to INACTIVE pages
- * on this LRU, maintained by the pageout code. A zone->inactive_ratio
+ * on this LRU, maintained by the pageout code. A inactive_ratio
  * of 3 means 3:1 or 25% of the pages are kept on the inactive list.
  *
  * total     target    max
mm/vmstat.c +2 -4
index 91ecca9..74a0eca 100644
@@ -1491,11 +1491,9 @@ static void zoneinfo_show_print(struct seq_file *m, pg_data_t *pgdat,
 	}
 	seq_printf(m,
 		   "\n  node_unreclaimable:  %u"
-		   "\n  start_pfn:           %lu"
-		   "\n  node_inactive_ratio: %u",
+		   "\n  start_pfn:           %lu",
 		   !pgdat_reclaimable(zone->zone_pgdat),
-		   zone->zone_start_pfn,
-		   zone->zone_pgdat->inactive_ratio);
+		   zone->zone_start_pfn);
 	seq_putc(m, '\n');
 }
 
Signature · 7 lines
1.9.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
reviewer
#1 lore raw
Quoted 1 line · Ganesh Mahendran

In patch [1], the inactive_ratio is now automatically calculated

It is better to give the direct reference to the patch 59dc76b0d4df ("mm: vmscan: reduce size of inactive file list")

Quoted 2 lines

in inactive_list_is_low(). So there is no need to keep inactive_ratio in pglist_data,

OK

Quoted 1 line

and shown in zoneinfo.

I am not so sure about this. To be honest I have never really used this value but maybe there is somebody outher who relies on it. It would be safer if the ratio calculation in inactive_list_is_low would be extracted and used to display the information rather than dropping that on the floor.

The patch should also state that the above patch has broken the zoneinfo information.

Quoted 60 lines

[1] mm: vmscan: reduce size of inactive file list

---
 include/linux/mmzone.h | 6 ------
 mm/vmscan.c            | 2 +-
 mm/vmstat.c            | 6 ++----
 3 files changed, 3 insertions(+), 11 deletions(-)
include/linux/mmzone.h +0 -6
index a3b7f45..b3ade54 100644
@@ -700,12 +700,6 @@ typedef struct pglist_data {
 	/* Fields commonly accessed by the page reclaim scanner */
 	struct lruvec		lruvec;
 
-	/*
-	 * The target ratio of ACTIVE_ANON to INACTIVE_ANON pages on
-	 * this node's LRU.  Maintained by the pageout code.
-	 */
-	unsigned int inactive_ratio;
-
 	unsigned long		flags;
 
 	ZONE_PADDING(_pad2_)
mm/vmscan.c +1 -1
index 429bf3a..3c1de58 100644
@@ -1915,7 +1915,7 @@ static void shrink_active_list(unsigned long nr_to_scan,
  * page has a chance to be referenced again before it is reclaimed.
  *
  * The inactive_ratio is the target ratio of ACTIVE to INACTIVE pages
- * on this LRU, maintained by the pageout code. A zone->inactive_ratio
+ * on this LRU, maintained by the pageout code. A inactive_ratio
  * of 3 means 3:1 or 25% of the pages are kept on the inactive list.
  *
  * total     target    max
mm/vmstat.c +2 -4
index 91ecca9..74a0eca 100644
@@ -1491,11 +1491,9 @@ static void zoneinfo_show_print(struct seq_file *m, pg_data_t *pgdat,
 	}
 	seq_printf(m,
 		   "\n  node_unreclaimable:  %u"
-		   "\n  start_pfn:           %lu"
-		   "\n  node_inactive_ratio: %u",
+		   "\n  start_pfn:           %lu",
 		   !pgdat_reclaimable(zone->zone_pgdat),
-		   zone->zone_start_pfn,
-		   zone->zone_pgdat->inactive_ratio);
+		   zone->zone_start_pfn);
 	seq_putc(m, '\n');
 }
 
Signature · 1 line
1.9.1
Signature · 8 lines
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#2 lore raw

Hi, Michal

2016-07-19 15:34 GMT+08:00 Michal Hocko <[email protected]>:

Quoted 5 lines · Ganesh Mahendran
Quoted 1 line

In patch [1], the inactive_ratio is now automatically calculated

It is better to give the direct reference to the patch 59dc76b0d4df ("mm: vmscan: reduce size of inactive file list")

Yes, I will change in next version.

Quoted 6 lines
Quoted 3 lines

in inactive_list_is_low(). So there is no need to keep inactive_ratio in pglist_data,

OK

Quoted 7 lines
Quoted 1 line

and shown in zoneinfo.

I am not so sure about this. To be honest I have never really used this value but maybe there is somebody outher who relies on it. It would be safer if the ratio calculation in inactive_list_is_low would be extracted and used to display the information rather than dropping that on the floor.

Yes, It is not good to remove the inactive_ratio from /proc/zoneinfo.

I will send a V2 patch soon.

Thanks.

Quoted 61 lines

The patch should also state that the above patch has broken the zoneinfo information.

Quoted 57 lines

[1] mm: vmscan: reduce size of inactive file list

---
 include/linux/mmzone.h | 6 ------
 mm/vmscan.c            | 2 +-
 mm/vmstat.c            | 6 ++----
 3 files changed, 3 insertions(+), 11 deletions(-)
include/linux/mmzone.h +0 -6
index a3b7f45..b3ade54 100644
@@ -700,12 +700,6 @@ typedef struct pglist_data {
      /* Fields commonly accessed by the page reclaim scanner */
      struct lruvec           lruvec;
 
-     /*
-      * The target ratio of ACTIVE_ANON to INACTIVE_ANON pages on
-      * this node's LRU.  Maintained by the pageout code.
-      */
-     unsigned int inactive_ratio;
-
      unsigned long           flags;
 
      ZONE_PADDING(_pad2_)
mm/vmscan.c +1 -1
index 429bf3a..3c1de58 100644
@@ -1915,7 +1915,7 @@ static void shrink_active_list(unsigned long nr_to_scan,
  * page has a chance to be referenced again before it is reclaimed.
  *
  * The inactive_ratio is the target ratio of ACTIVE to INACTIVE pages
- * on this LRU, maintained by the pageout code. A zone->inactive_ratio
+ * on this LRU, maintained by the pageout code. A inactive_ratio
  * of 3 means 3:1 or 25% of the pages are kept on the inactive list.
  *
  * total     target    max
mm/vmstat.c +2 -4
index 91ecca9..74a0eca 100644
@@ -1491,11 +1491,9 @@ static void zoneinfo_show_print(struct seq_file *m, pg_data_t *pgdat,
      }
      seq_printf(m,
                 "\n  node_unreclaimable:  %u"
-                "\n  start_pfn:           %lu"
-                "\n  node_inactive_ratio: %u",
+                "\n  start_pfn:           %lu",
                 !pgdat_reclaimable(zone->zone_pgdat),
-                zone->zone_start_pfn,
-                zone->zone_pgdat->inactive_ratio);
+                zone->zone_start_pfn);
      seq_putc(m, '\n');
 }
 
Quoted 7 lines
Quoted 3 lines

--
1.9.1

--
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>