Re: [PATCH 5.15.y] mm: fix race between __split_huge_pmd_locked() and GUP-fast

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 21 Jun 2024, at 12:34, Ryan Roberts wrote:

> On 21/06/2024 16:31, Ryan Roberts wrote:
>> Sorry, please ignore this patch (see below)...
>>
>>
>
> [...]
>
>>> diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
>>> index 4e640baf9794..3bfc31a7cb38 100644
>>> --- a/mm/pgtable-generic.c
>>> +++ b/mm/pgtable-generic.c
>>> @@ -194,6 +194,7 @@ pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp)
>>>  pmd_t pmdp_invalidate(struct vm_area_struct *vma, unsigned long address,
>>>  		     pmd_t *pmdp)
>>>  {
>>> +	VM_WARN_ON_ONCE(!pmd_present(*pmdp));
>>>  	pmd_t old = pmdp_establish(vma, address, pmdp, pmd_mkinvalid(*pmdp));
>>
>> old needs to be defined before the warning; I'm getting a compile warning on
>> 5.15. I fixed that up but failed to add it to this commit. But the real question
>> is why I'm not seeing the same warning on mainline? Let me investigate and
>> resend appropriate patches.
>
> OK, it turns out that commit b5ec6fd286df ("kbuild: Drop
> -Wdeclaration-after-statement") (v6.5 timeframe) stopped emitting compiler
> warnings for statements that appear before declarations, so when I did the
> original fix for mainline, there was no warning for this.
>
> Current status with backports for this patch is; you have applied to kernels
> back to 5.15, and from 5.15 backwards there are conflicts. Clearly when applied
> to any kernel prior to v6.5 this will result in warning when DEBUG_VM is enabled.
>
> What's the best way to proceed? Should we just fix up the backports, or am I
> going to have to deliver a separate (technically uneccessary) patch to mainline
> that can then be backported?

Probably just fix the backports. IMHO you would want to follow the expectation
(no statement before declaration before v6.5) of the kernel to which you are
backporting.

And thank you for taking time to fix all these.

--
Best Regards,
Yan, Zi

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux