Hi David,
On Tue, Apr 22, 2025 at 3:04 PM David Hildenbrand david@redhat.com wrote:
Let me post it again:
Please consider applying d2155fe54ddb ("mm: compaction: remove duplicate !list_empty(&sublist) check") to 5.10 and 5.4, as it resolves a -Wdangling-pointer warning in recent GCC versions:
In function '__list_cut_position', inlined from 'list_cut_position' at ./include/linux/list.h:400:3, inlined from 'move_freelist_tail' at mm/compaction.c:1241:3: ./include/linux/list.h:370:21: warning: storing the address of local variable 'sublist' in '*&freepage_6(D)->D.15621.D.15566.lru.next' [-Wdangling-pointer=]
The commit looks harmless. But I don't see how it could fix any warning?
I mean, we replace two !list_empty() checks by a single one ... and the warning is about list_cut_position() ?
I have no idea, actually. Maybe the double !list_empty() confuses the compiler, making it think `sublist` can be referenced out of the scope?
-- Cheers,
David / dhildenb