diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index 3d37c279c09008b74c41a71abb850bfcdaa99e99..f2635fc751d932b48bf3f2adfc6fe848992ca11d 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c @@ -736,8 +736,15 @@ static int memory_bm_find_bit(struct memory_bitmap *bm, unsigned long pfn, * We have found the zone. Now walk the radix tree to find the leaf node * for our PFN. */ + + /* + * If the zone we wish to scan is the the current zone and the + * pfn falls into the current node then we do not need to walk + * the tree. + */ node = bm->cur.node; - if (((pfn - zone->start_pfn) & ~BM_BLOCK_MASK) == bm->cur.node_pfn) + if (zone == bm->cur.zone && + ((pfn - zone->start_pfn) & ~BM_BLOCK_MASK) == bm->cur.node_pfn) goto node_found; node = zone->rtree;