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? Thanks, Ryan > >> flush_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE); >> return old; >