@@ -658,7 +658,10 @@ unsigned long shmem_partial_swap_usage(struct address_space *mapping,
swapped++;
if (need_resched()) {
- slot = radix_tree_iter_next(slot, &iter);
+ unsigned int order = 0;
+ if (!radix_tree_exceptional_entry(page))
+ order = compound_order(page);
+ slot = radix_tree_iter_save(&iter, order);
cond_resched_rcu();
}
}
@@ -2450,6 +2453,7 @@ static void shmem_tag_pins(struct address_space *mapping)
slot = radix_tree_iter_retry(&iter);
continue;
}
+ page = NULL;
} else if (page_count(page) - page_mapcount(page) > 1) {
spin_lock_irq(&mapping->tree_lock);
radix_tree_tag_set(&mapping->page_tree, iter.index,
@@ -2458,7 +2462,8 @@ static void shmem_tag_pins(struct address_space *mapping)
}
if (need_resched()) {
- slot = radix_tree_iter_next(slot, &iter);
+ unsigned int order = page ? compound_order(page) : 0;
+ slot = radix_tree_iter_save(&iter, order);
cond_resched_rcu();
}
}
@@ -2528,7 +2533,10 @@ static int shmem_wait_for_pins(struct address_space *mapping)
spin_unlock_irq(&mapping->tree_lock);
continue_resched:
if (need_resched()) {
- slot = radix_tree_iter_next(slot, &iter);
+ unsigned int order = 0;
+ if (page)
+ order = compound_order(page);
+ slot = radix_tree_iter_save(&iter, order);
cond_resched_rcu();
}
}