• J
    PM / hibernate: Iterate over set bits instead of PFNs in swsusp_free() · fdd64ed5
    Joerg Roedel 提交于
    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.
    
    This new version adds a !NULL check for the memory bitmaps
    before they are walked. Not doing so causes a kernel crash
    when the bitmaps are NULL.
    Signed-off-by: NJoerg Roedel <jroedel@suse.de>
    Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
    fdd64ed5
snapshot.c 67.6 KB