Re: [PATCH] mm/hugetlb: Don't put_page in lock of hugetlb_lock

From: Zhiqiang Liu
Date: Mon May 06 2019 - 10:06:41 EST


> On Sat 04-05-19 20:28:24, Zhiqiang Liu wrote:
>> From: Kai Shen <shenkai8@xxxxxxxxxx>
>>
>> spinlock recursion happened when do LTP test:
>> #!/bin/bash
>> ./runltp -p -f hugetlb &
>> ./runltp -p -f hugetlb &
>> ./runltp -p -f hugetlb &
>> ./runltp -p -f hugetlb &
>> ./runltp -p -f hugetlb &
>>

>> Fixes: 9980d744a0 ("mm, hugetlb: get rid of surplus page accounting tricks")
>> Signed-off-by: Kai Shen <shenkai8@xxxxxxxxxx>
>> Signed-off-by: Feilong Lin <linfeilong@xxxxxxxxxx>
>> Reported-by: Wang Wang <wangwang2@xxxxxxxxxx>
>
> You are right. I must have completely missed that put_page path
> unconditionally takes the hugetlb_lock for hugetlb pages.
>
> Thanks for fixing this. I think this should be marked for stable
> because it is not hard to imagine a regular user might trigger this.
>
> Acked-by: Michal Hocko <mhocko@xxxxxxxx>

Thank you for your reply.
I will add Acked-by: Michal Hocko <mhocko@xxxxxxxx> in the v2 patch.