]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit60b51a2c0e973aa9e45e9166f2d383beec42b7f1
treefeb445fec8aa97bd2fd4cc06cf627f41cd04bbb3
parent515e04d23048f999bf69c65f4068c343325c0b37
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