page migration: replace radix_tree_lookup_slot with radix_tree_lockup The radix tree rcu code runs into trouble when we use radix_tree_lookup slot and use the slot to update the page reference. Use radix_tree_lookup instead and update the page reference via radix_tree_delete and radix_tree_insert. Signed-off-by: Christoph Lameter Index: linux-2.6.18-rc3-mm2/mm/migrate.c =================================================================== --- linux-2.6.18-rc3-mm2.orig/mm/migrate.c 2006-08-07 20:21:12.985022791 -0700 +++ linux-2.6.18-rc3-mm2/mm/migrate.c 2006-08-08 09:15:29.352637207 -0700 @@ -294,7 +294,8 @@ out: static int migrate_page_move_mapping(struct address_space *mapping, struct page *newpage, struct page *page) { - struct page **radix_pointer; + struct page *current_page; + long index; if (!mapping) { /* Anonymous page */ @@ -305,12 +306,14 @@ static int migrate_page_move_mapping(str write_lock_irq(&mapping->tree_lock); - radix_pointer = (struct page **)radix_tree_lookup_slot( + index = page_index(page); + + current_page = (struct page *)radix_tree_lookup( &mapping->page_tree, - page_index(page)); + index); if (page_count(page) != 2 + !!PagePrivate(page) || - radix_tree_deref_slot(radix_pointer) != page) { + current_page != page) { write_unlock_irq(&mapping->tree_lock); return -EAGAIN; } @@ -326,7 +329,8 @@ static int migrate_page_move_mapping(str } #endif - radix_tree_replace_slot(radix_pointer, newpage); + radix_tree_delete(&mapping->page_tree, index); + radix_tree_insert(&mapping->page_tree, index, newpage); __put_page(page); write_unlock_irq(&mapping->tree_lock);