[1/6] mm: compaction: drop the redundant page validation in update_pageblock_skip()

Message ID 5142e15b9295fe8c447dbb39b7907a20177a1413.1685018752.git.baolin.wang@linux.alibaba.com
State New
Headers
Series Misc cleanups and improvements for compaction |

Commit Message

Baolin Wang May 25, 2023, 12:53 p.m. UTC
  The caller has validated the page before calling pdate_pageblock_skip(),
thus drop the redundant page validation in update_pageblock_skip().

Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
---
 mm/compaction.c | 3 ---
 1 file changed, 3 deletions(-)
  

Comments

Vlastimil Babka May 30, 2023, 7:27 a.m. UTC | #1
On 5/25/23 14:53, Baolin Wang wrote:
> The caller has validated the page before calling pdate_pageblock_skip(),
                                                   ^ u

> thus drop the redundant page validation in update_pageblock_skip().
> 
> Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>  mm/compaction.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/mm/compaction.c b/mm/compaction.c
> index 163e2ec70aff..426bb6ce070b 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -436,9 +436,6 @@ static void update_pageblock_skip(struct compact_control *cc,
>  	if (cc->no_set_skip_hint)
>  		return;
>  
> -	if (!page)
> -		return;
> -
>  	set_pageblock_skip(page);
>  
>  	/* Update where async and sync compaction should restart */
  
Baolin Wang May 31, 2023, 1:44 a.m. UTC | #2
On 5/30/2023 3:27 PM, Vlastimil Babka wrote:
> On 5/25/23 14:53, Baolin Wang wrote:
>> The caller has validated the page before calling pdate_pageblock_skip(),
>                                                     ^ u

Ah, sorry for typos. And I see Andrew has already helped to correct this 
typo. Thanks Andrew :)

>> thus drop the redundant page validation in update_pageblock_skip().
>>
>> Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
> 
> Acked-by: Vlastimil Babka <vbabka@suse.cz>

Thanks for your reviewing.

>> ---
>>   mm/compaction.c | 3 ---
>>   1 file changed, 3 deletions(-)
>>
>> diff --git a/mm/compaction.c b/mm/compaction.c
>> index 163e2ec70aff..426bb6ce070b 100644
>> --- a/mm/compaction.c
>> +++ b/mm/compaction.c
>> @@ -436,9 +436,6 @@ static void update_pageblock_skip(struct compact_control *cc,
>>   	if (cc->no_set_skip_hint)
>>   		return;
>>   
>> -	if (!page)
>> -		return;
>> -
>>   	set_pageblock_skip(page);
>>   
>>   	/* Update where async and sync compaction should restart */
  

Patch

diff --git a/mm/compaction.c b/mm/compaction.c
index 163e2ec70aff..426bb6ce070b 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -436,9 +436,6 @@  static void update_pageblock_skip(struct compact_control *cc,
 	if (cc->no_set_skip_hint)
 		return;
 
-	if (!page)
-		return;
-
 	set_pageblock_skip(page);
 
 	/* Update where async and sync compaction should restart */