Re: suspect list_empty( {NULL, NULL} )

Andrew Morton
2002-09-29T01:32:01Z

Zach Brown wrote:
>
> A cute list_head debugging patch seems to have found strange list_entry
> use in vmscan.c in stock 2.5.39.
>
> page_mapping_inuse:
>
> if (!list_empty(&mapping->i_mmap) || !list_empty(&mapping->i_mmap_shared))
>
> ...
> (gdb) print *mapping
> $22 = {host = 0xc03b6e00

That's swapper_space.

--- 2.5.39/mm/swap_state.c~swapper_space-state Sat Sep 28 18:30:45 2002
+++ 2.5.39-akpm/mm/swap_state.c Sat Sep 28 18:31:26 2002
@@ -43,6 +43,8 @@ struct address_space swapper_space = {
.a_ops = &swap_aops,
.backing_dev_info = &swap_backing_dev_info,
.i_shared_lock = SPIN_LOCK_UNLOCKED,
+ .i_mmap = LIST_HEAD_INIT(swapper_space.i_mmap),
+ .i_mmap_shared = LIST_HEAD_INIT(swapper_space.i_mmap_shared),
.private_lock = SPIN_LOCK_UNLOCKED,
.private_list = LIST_HEAD_INIT(swapper_space.private_list),
};

.