diff mbox series

[1/5] mm/migrate.c: remove unnecessary VM_BUG_ON_PAGE on putback_movable_page()

Message ID 20210320093701.12829-2-linmiaohe@huawei.com (mailing list archive)
State New, archived
Headers show
Series Cleanup and fixup for mm/migrate.c | expand

Commit Message

Miaohe Lin March 20, 2021, 9:36 a.m. UTC
The !PageLocked() check is implicitly done in PageMovable(). Remove this
explicit one.

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

Comments

Rafael Aquini March 20, 2021, 2:11 p.m. UTC | #1
On Sat, Mar 20, 2021 at 05:36:57AM -0400, Miaohe Lin wrote:
> The !PageLocked() check is implicitly done in PageMovable(). Remove this
> explicit one.
>

I'd just keep the explicit assertion in place, regardless.
But if you're going to stick with this patch, please fix it because it's 
removing the wrong assertion.


> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>  mm/migrate.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/mm/migrate.c b/mm/migrate.c
> index 47df0df8f21a..e4ca5ef508ea 100644
> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -146,7 +146,6 @@ void putback_movable_page(struct page *page)
>  	struct address_space *mapping;
>  
>  	VM_BUG_ON_PAGE(!PageLocked(page), page);
> -	VM_BUG_ON_PAGE(!PageMovable(page), page);
>  	VM_BUG_ON_PAGE(!PageIsolated(page), page);
>  
>  	mapping = page_mapping(page);
> -- 
> 2.19.1
> 
>
Miaohe Lin March 22, 2021, 1:52 a.m. UTC | #2
Hi:
On 2021/3/20 22:11, Rafael Aquini wrote:
> On Sat, Mar 20, 2021 at 05:36:57AM -0400, Miaohe Lin wrote:
>> The !PageLocked() check is implicitly done in PageMovable(). Remove this
>> explicit one.
>>
> 
> I'd just keep the explicit assertion in place, regardless.
> But if you're going to stick with this patch, please fix it because it's 
> removing the wrong assertion.

Many thanks for your reply. I should have a coffee when I make this patch! :(
Will fix it. Many thanks for remind!

> 
> 
>> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
>> ---
>>  mm/migrate.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/mm/migrate.c b/mm/migrate.c
>> index 47df0df8f21a..e4ca5ef508ea 100644
>> --- a/mm/migrate.c
>> +++ b/mm/migrate.c
>> @@ -146,7 +146,6 @@ void putback_movable_page(struct page *page)
>>  	struct address_space *mapping;
>>  
>>  	VM_BUG_ON_PAGE(!PageLocked(page), page);
>> -	VM_BUG_ON_PAGE(!PageMovable(page), page);
>>  	VM_BUG_ON_PAGE(!PageIsolated(page), page);
>>  
>>  	mapping = page_mapping(page);
>> -- 
>> 2.19.1
>>
>>
> 
> .
>
diff mbox series

Patch

diff --git a/mm/migrate.c b/mm/migrate.c
index 47df0df8f21a..e4ca5ef508ea 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -146,7 +146,6 @@  void putback_movable_page(struct page *page)
 	struct address_space *mapping;
 
 	VM_BUG_ON_PAGE(!PageLocked(page), page);
-	VM_BUG_ON_PAGE(!PageMovable(page), page);
 	VM_BUG_ON_PAGE(!PageIsolated(page), page);
 
 	mapping = page_mapping(page);