Skip to contentSkip to conversation

mm: vmscan: remove unused scan_control parameter from pageout()

PATCH In review Yang Shi 3 participants 4 messages Oct 3, 2019 – Oct 4, 2019

Subsystems (3)
lore
Share & tools
lore

Yang Shi

author
#0 lore raw

PATCH 1/1 mm: vmscan: remove unused scan_control parameter from pageout()

Since lumpy reclaim was removed in v3.5 scan_control is not used by may_write_to_{queue|inode} and pageout() anymore, remove the unused parameter.

Cc Mel Gorman <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Michal Hocko <[email protected]>
---
 mm/vmscan.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
mm/vmscan.c +4 -5
index e5d52d6..17489b8 100644
@@ -774,7 +774,7 @@ static inline int is_page_cache_freeable(struct page *page)
 	return page_count(page) - page_has_private(page) == 1 + page_cache_pins;
 }
 
-static int may_write_to_inode(struct inode *inode, struct scan_control *sc)
+static int may_write_to_inode(struct inode *inode)
 {
 	if (current->flags & PF_SWAPWRITE)
 		return 1;
@@ -822,8 +822,7 @@ static void handle_write_error(struct address_space *mapping,
  * pageout is called by shrink_page_list() for each dirty page.
  * Calls ->writepage().
  */
-static pageout_t pageout(struct page *page, struct address_space *mapping,
-			 struct scan_control *sc)
+static pageout_t pageout(struct page *page, struct address_space *mapping)
 {
 	/*
 	 * If the page is dirty, only perform writeback if that write
@@ -859,7 +858,7 @@ static pageout_t pageout(struct page *page, struct address_space *mapping,
 	}
 	if (mapping->a_ops->writepage == NULL)
 		return PAGE_ACTIVATE;
-	if (!may_write_to_inode(mapping->host, sc))
+	if (!may_write_to_inode(mapping->host))
 		return PAGE_KEEP;
 
 	if (clear_page_dirty_for_io(page)) {
@@ -1396,7 +1395,7 @@ static unsigned long shrink_page_list(struct list_head *page_list,
 			 * starts and then write it out here.
 			 */
 			try_to_unmap_flush_dirty();
-			switch (pageout(page, mapping, sc)) {
+			switch (pageout(page, mapping)) {
 			case PAGE_KEEP:
 				goto keep_locked;
 			case PAGE_ACTIVATE:
Signature · 1 line
1.8.3.1
reviewer Acked-by on v1 1/1
#2 lore raw
In reply to Yang Shi
Quoted 3 lines · Yang Shi

Since lumpy reclaim was removed in v3.5 scan_control is not used by may_write_to_{queue|inode} and pageout() anymore, remove the unused parameter.

I haven't really checked whether it was the lumpy reclaim removal but it is clearly not used these days.

Quoted 4 lines
Cc Mel Gorman <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Michal Hocko <[email protected]>

Thanks!

Quoted 47 lines
---
 mm/vmscan.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
mm/vmscan.c +4 -5
index e5d52d6..17489b8 100644
@@ -774,7 +774,7 @@ static inline int is_page_cache_freeable(struct page *page)
 	return page_count(page) - page_has_private(page) == 1 + page_cache_pins;
 }
 
-static int may_write_to_inode(struct inode *inode, struct scan_control *sc)
+static int may_write_to_inode(struct inode *inode)
 {
 	if (current->flags & PF_SWAPWRITE)
 		return 1;
@@ -822,8 +822,7 @@ static void handle_write_error(struct address_space *mapping,
  * pageout is called by shrink_page_list() for each dirty page.
  * Calls ->writepage().
  */
-static pageout_t pageout(struct page *page, struct address_space *mapping,
-			 struct scan_control *sc)
+static pageout_t pageout(struct page *page, struct address_space *mapping)
 {
 	/*
 	 * If the page is dirty, only perform writeback if that write
@@ -859,7 +858,7 @@ static pageout_t pageout(struct page *page, struct address_space *mapping,
 	}
 	if (mapping->a_ops->writepage == NULL)
 		return PAGE_ACTIVATE;
-	if (!may_write_to_inode(mapping->host, sc))
+	if (!may_write_to_inode(mapping->host))
 		return PAGE_KEEP;
 
 	if (clear_page_dirty_for_io(page)) {
@@ -1396,7 +1395,7 @@ static unsigned long shrink_page_list(struct list_head *page_list,
 			 * starts and then write it out here.
 			 */
 			try_to_unmap_flush_dirty();
-			switch (pageout(page, mapping, sc)) {
+			switch (pageout(page, mapping)) {
 			case PAGE_KEEP:
 				goto keep_locked;
 			case PAGE_ACTIVATE:
Signature · 1 line
1.8.3.1
Signature · 2 lines
Michal Hocko
SUSE Labs
author
#3 lore raw
Quoted 6 lines · Michal Hocko
Quoted 3 lines · Yang Shi

Since lumpy reclaim was removed in v3.5 scan_control is not used by may_write_to_{queue|inode} and pageout() anymore, remove the unused parameter.

I haven't really checked whether it was the lumpy reclaim removal but it is clearly not used these days.

It was removed by commit c53919adc045bf803252e912f23028a68525753d ("mm: vmscan: remove lumpy reclaim").

Quoted 56 lines
Quoted 5 lines
Cc Mel Gorman <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Michal Hocko <[email protected]>

Thanks!

Quoted 47 lines
---
  mm/vmscan.c | 9 ++++-----
  1 file changed, 4 insertions(+), 5 deletions(-)
mm/vmscan.c +4 -5
index e5d52d6..17489b8 100644
@@ -774,7 +774,7 @@ static inline int is_page_cache_freeable(struct page *page)
  	return page_count(page) - page_has_private(page) == 1 + page_cache_pins;
  }
 
-static int may_write_to_inode(struct inode *inode, struct scan_control *sc)
+static int may_write_to_inode(struct inode *inode)
  {
  	if (current->flags & PF_SWAPWRITE)
  		return 1;
@@ -822,8 +822,7 @@ static void handle_write_error(struct address_space *mapping,
   * pageout is called by shrink_page_list() for each dirty page.
   * Calls ->writepage().
   */
-static pageout_t pageout(struct page *page, struct address_space *mapping,
-			 struct scan_control *sc)
+static pageout_t pageout(struct page *page, struct address_space *mapping)
  {
  	/*
  	 * If the page is dirty, only perform writeback if that write
@@ -859,7 +858,7 @@ static pageout_t pageout(struct page *page, struct address_space *mapping,
  	}
  	if (mapping->a_ops->writepage == NULL)
  		return PAGE_ACTIVATE;
-	if (!may_write_to_inode(mapping->host, sc))
+	if (!may_write_to_inode(mapping->host))
  		return PAGE_KEEP;
 
  	if (clear_page_dirty_for_io(page)) {
@@ -1396,7 +1395,7 @@ static unsigned long shrink_page_list(struct list_head *page_list,
  			 * starts and then write it out here.
  			 */
  			try_to_unmap_flush_dirty();
-			switch (pageout(page, mapping, sc)) {
+			switch (pageout(page, mapping)) {
  			case PAGE_KEEP:
  				goto keep_locked;
  			case PAGE_ACTIVATE:
Signature · 1 line
1.8.3.1