PM / Hibernate: Iterate over set bits instead of PFNs in swsusp_free()
authorJoerg Roedel <jroedel@suse.de>
Mon, 21 Jul 2014 10:27:00 +0000 (12:27 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 28 Jul 2014 23:47:44 +0000 (01:47 +0200)
commit6efde38f07690652bf0d93f5e4f1a5f496574806
treefeb445fec8aa97bd2fd4cc06cf627f41cd04bbb3
parent3a20cb1779616ebcaade393cc9beac0e03cbffef
PM / Hibernate: Iterate over set bits instead of PFNs in swsusp_free()

The existing implementation of swsusp_free iterates over all
pfns in the system and checks every bit in the two memory
bitmaps.

This doesn't scale very well with large numbers of pfns,
especially when the bitmaps are not populated very densly.
Change the algorithm to iterate over the set bits in the
bitmaps instead to make it scale better in large memory
configurations.

Also add a memory_bm_clear_current() helper function that
clears the bit for the last position returned from the
memory bitmap.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
kernel/power/snapshot.c