linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: vmscan: remove unused scan_control parameter from pageout()
@ 2019-10-03 17:41 Yang Shi
  2019-10-03 19:41 ` David Rientjes
  2019-10-04  8:16 ` Michal Hocko
  0 siblings, 2 replies; 4+ messages in thread
From: Yang Shi @ 2019-10-03 17:41 UTC (permalink / raw)
  To: mgorman, hannes, mhocko, akpm; +Cc: yang.shi, linux-mm, linux-kernel

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 <mgorman@techsingularity.net>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.com>
Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com>
---
 mm/vmscan.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index e5d52d6..17489b8 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -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:
-- 
1.8.3.1



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

* Re: [PATCH] mm: vmscan: remove unused scan_control parameter from pageout()
  2019-10-03 17:41 [PATCH] mm: vmscan: remove unused scan_control parameter from pageout() Yang Shi
@ 2019-10-03 19:41 ` David Rientjes
  2019-10-04  8:16 ` Michal Hocko
  1 sibling, 0 replies; 4+ messages in thread
From: David Rientjes @ 2019-10-03 19:41 UTC (permalink / raw)
  To: Yang Shi; +Cc: mgorman, hannes, mhocko, akpm, linux-mm, linux-kernel

On Fri, 4 Oct 2019, Yang Shi wrote:

> 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 <mgorman@techsingularity.net>
> Cc: Johannes Weiner <hannes@cmpxchg.org>
> Cc: Michal Hocko <mhocko@suse.com>
> Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com>

Acked-by: David Rientjes <rientjes@google.com>


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

* Re: [PATCH] mm: vmscan: remove unused scan_control parameter from pageout()
  2019-10-03 17:41 [PATCH] mm: vmscan: remove unused scan_control parameter from pageout() Yang Shi
  2019-10-03 19:41 ` David Rientjes
@ 2019-10-04  8:16 ` Michal Hocko
  2019-10-04 16:43   ` Yang Shi
  1 sibling, 1 reply; 4+ messages in thread
From: Michal Hocko @ 2019-10-04  8:16 UTC (permalink / raw)
  To: Yang Shi; +Cc: mgorman, hannes, akpm, linux-mm, linux-kernel

On Fri 04-10-19 01:41:38, Yang Shi wrote:
> 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.

> Cc: Mel Gorman <mgorman@techsingularity.net>
> Cc: Johannes Weiner <hannes@cmpxchg.org>
> Cc: Michal Hocko <mhocko@suse.com>
> Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com>

Acked-by: Michal Hocko <mhocko@suse.com>

Thanks!

> ---
>  mm/vmscan.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index e5d52d6..17489b8 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -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:
> -- 
> 1.8.3.1

-- 
Michal Hocko
SUSE Labs


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

* Re: [PATCH] mm: vmscan: remove unused scan_control parameter from pageout()
  2019-10-04  8:16 ` Michal Hocko
@ 2019-10-04 16:43   ` Yang Shi
  0 siblings, 0 replies; 4+ messages in thread
From: Yang Shi @ 2019-10-04 16:43 UTC (permalink / raw)
  To: Michal Hocko; +Cc: mgorman, hannes, akpm, linux-mm, linux-kernel



On 10/4/19 1:16 AM, Michal Hocko wrote:
> On Fri 04-10-19 01:41:38, Yang Shi wrote:
>> 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").

>
>> Cc: Mel Gorman <mgorman@techsingularity.net>
>> Cc: Johannes Weiner <hannes@cmpxchg.org>
>> Cc: Michal Hocko <mhocko@suse.com>
>> Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com>
> Acked-by: Michal Hocko <mhocko@suse.com>
>
> Thanks!
>
>> ---
>>   mm/vmscan.c | 9 ++++-----
>>   1 file changed, 4 insertions(+), 5 deletions(-)
>>
>> diff --git a/mm/vmscan.c b/mm/vmscan.c
>> index e5d52d6..17489b8 100644
>> --- a/mm/vmscan.c
>> +++ b/mm/vmscan.c
>> @@ -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:
>> -- 
>> 1.8.3.1



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

end of thread, other threads:[~2019-10-04 16:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-03 17:41 [PATCH] mm: vmscan: remove unused scan_control parameter from pageout() Yang Shi
2019-10-03 19:41 ` David Rientjes
2019-10-04  8:16 ` Michal Hocko
2019-10-04 16:43   ` Yang Shi

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