diff mbox series

[2/5] mm/vmscan: remove misleading setting to sc->priority

Message ID 20210710100329.49174-3-linmiaohe@huawei.com (mailing list archive)
State New
Headers show
Series Cleanup and fixup for vmscan | expand

Commit Message

Miaohe Lin July 10, 2021, 10:03 a.m. UTC
The priority field of sc is used to control how many pages we should scan
at once while we always traverse the list to shrink the pages in these
functions. So these settings are unneeded and misleading.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/vmscan.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Michal Hocko July 12, 2021, 7:24 a.m. UTC | #1
On Sat 10-07-21 18:03:26, Miaohe Lin wrote:
> The priority field of sc is used to control how many pages we should scan
> at once while we always traverse the list to shrink the pages in these
> functions. So these settings are unneeded and misleading.

I dunno. I agree that priority is not really used as these operate on
page lists but I am not sure this is worth touching.

> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>  mm/vmscan.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 6483fe0e2065..fbe53e60b248 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -1702,7 +1702,6 @@ unsigned int reclaim_clean_pages_from_list(struct zone *zone,
>  {
>  	struct scan_control sc = {
>  		.gfp_mask = GFP_KERNEL,
> -		.priority = DEF_PRIORITY,
>  		.may_unmap = 1,
>  	};
>  	struct reclaim_stat stat;
> @@ -2327,7 +2326,6 @@ unsigned long reclaim_pages(struct list_head *page_list)
>  	unsigned int noreclaim_flag;
>  	struct scan_control sc = {
>  		.gfp_mask = GFP_KERNEL,
> -		.priority = DEF_PRIORITY,
>  		.may_writepage = 1,
>  		.may_unmap = 1,
>  		.may_swap = 1,
> -- 
> 2.23.0
Miaohe Lin July 12, 2021, 11:10 a.m. UTC | #2
On 2021/7/12 15:24, Michal Hocko wrote:
> On Sat 10-07-21 18:03:26, Miaohe Lin wrote:
>> The priority field of sc is used to control how many pages we should scan
>> at once while we always traverse the list to shrink the pages in these
>> functions. So these settings are unneeded and misleading.
> 
> I dunno. I agree that priority is not really used as these operate on
> page lists but I am not sure this is worth touching.

When I investigated the vmscan code, I thought the order here would control the
proportion of the pages in the list to shrink. So I prefer to remove these.

Thanks a lot for review and reply!

> 
>> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
>> ---
>>  mm/vmscan.c | 2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/mm/vmscan.c b/mm/vmscan.c
>> index 6483fe0e2065..fbe53e60b248 100644
>> --- a/mm/vmscan.c
>> +++ b/mm/vmscan.c
>> @@ -1702,7 +1702,6 @@ unsigned int reclaim_clean_pages_from_list(struct zone *zone,
>>  {
>>  	struct scan_control sc = {
>>  		.gfp_mask = GFP_KERNEL,
>> -		.priority = DEF_PRIORITY,
>>  		.may_unmap = 1,
>>  	};
>>  	struct reclaim_stat stat;
>> @@ -2327,7 +2326,6 @@ unsigned long reclaim_pages(struct list_head *page_list)
>>  	unsigned int noreclaim_flag;
>>  	struct scan_control sc = {
>>  		.gfp_mask = GFP_KERNEL,
>> -		.priority = DEF_PRIORITY,
>>  		.may_writepage = 1,
>>  		.may_unmap = 1,
>>  		.may_swap = 1,
>> -- 
>> 2.23.0
>
diff mbox series

Patch

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 6483fe0e2065..fbe53e60b248 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1702,7 +1702,6 @@  unsigned int reclaim_clean_pages_from_list(struct zone *zone,
 {
 	struct scan_control sc = {
 		.gfp_mask = GFP_KERNEL,
-		.priority = DEF_PRIORITY,
 		.may_unmap = 1,
 	};
 	struct reclaim_stat stat;
@@ -2327,7 +2326,6 @@  unsigned long reclaim_pages(struct list_head *page_list)
 	unsigned int noreclaim_flag;
 	struct scan_control sc = {
 		.gfp_mask = GFP_KERNEL,
-		.priority = DEF_PRIORITY,
 		.may_writepage = 1,
 		.may_unmap = 1,
 		.may_swap = 1,