diff mbox series

[v2] mm/memory-failure.c: replace with page_shift() in add_to_kill()

Message ID 543d8bc9-f2e7-3023-7c35-2e7ed67c0e82@huawei.com (mailing list archive)
State New, archived
Headers show
Series [v2] mm/memory-failure.c: replace with page_shift() in add_to_kill() | expand

Commit Message

Yunfeng Ye Nov. 5, 2019, 9:38 a.m. UTC
The function page_shift() is supported after the commit 94ad9338109f
("mm: introduce page_shift()").

So replace with page_shift() in add_to_kill() for readability.

Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Acked-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
---
v1 -> v2:
 - add Reviewed-by and Acked-by

 mm/memory-failure.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Hildenbrand Nov. 5, 2019, 9:50 a.m. UTC | #1
On 05.11.19 10:38, Yunfeng Ye wrote:
> The function page_shift() is supported after the commit 94ad9338109f
> ("mm: introduce page_shift()").
> 
> So replace with page_shift() in add_to_kill() for readability.
> 
> Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
> Reviewed-by: David Hildenbrand <david@redhat.com>
> Acked-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> ---
> v1 -> v2:
>   - add Reviewed-by and Acked-by

Note for the future: No need to resend if there were no 
code/documentation changes. Andrew will apply the tags when picking up 
the patch.

> 
>   mm/memory-failure.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index 3151c87dff73..e48c50cac889 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -326,7 +326,7 @@ static void add_to_kill(struct task_struct *tsk, struct page *p,
>   	if (is_zone_device_page(p))
>   		tk->size_shift = dev_pagemap_mapping_shift(p, vma);
>   	else
> -		tk->size_shift = compound_order(compound_head(p)) + PAGE_SHIFT;
> +		tk->size_shift = page_shift(compound_head(p));
> 
>   	/*
>   	 * Send SIGKILL if "tk->addr == -EFAULT". Also, as
>
Yunfeng Ye Nov. 5, 2019, 10:18 a.m. UTC | #2
On 2019/11/5 17:50, David Hildenbrand wrote:
> On 05.11.19 10:38, Yunfeng Ye wrote:
>> The function page_shift() is supported after the commit 94ad9338109f
>> ("mm: introduce page_shift()").
>>
>> So replace with page_shift() in add_to_kill() for readability.
>>
>> Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
>> Reviewed-by: David Hildenbrand <david@redhat.com>
>> Acked-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
>> ---
>> v1 -> v2:
>>   - add Reviewed-by and Acked-by
> 
> Note for the future: No need to resend if there were no code/documentation changes. Andrew will apply the tags when picking up the patch.
> 
ok, thanks.

>>
>>   mm/memory-failure.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
>> index 3151c87dff73..e48c50cac889 100644
>> --- a/mm/memory-failure.c
>> +++ b/mm/memory-failure.c
>> @@ -326,7 +326,7 @@ static void add_to_kill(struct task_struct *tsk, struct page *p,
>>       if (is_zone_device_page(p))
>>           tk->size_shift = dev_pagemap_mapping_shift(p, vma);
>>       else
>> -        tk->size_shift = compound_order(compound_head(p)) + PAGE_SHIFT;
>> +        tk->size_shift = page_shift(compound_head(p));
>>
>>       /*
>>        * Send SIGKILL if "tk->addr == -EFAULT". Also, as
>>
> 
>
diff mbox series

Patch

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 3151c87dff73..e48c50cac889 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -326,7 +326,7 @@  static void add_to_kill(struct task_struct *tsk, struct page *p,
 	if (is_zone_device_page(p))
 		tk->size_shift = dev_pagemap_mapping_shift(p, vma);
 	else
-		tk->size_shift = compound_order(compound_head(p)) + PAGE_SHIFT;
+		tk->size_shift = page_shift(compound_head(p));

 	/*
 	 * Send SIGKILL if "tk->addr == -EFAULT". Also, as