lkml.org 
[lkml]   [2005]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3/4] swsusp: two simplifications
    Date
    The following patch simplifies the progress meter in disk.c:free_some_memory()
    and makes disk.c:pm_suspend_disk() call device_resume() explicitly in the
    suspend path.

    Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

    Index: linux-2.6.14-rc4-mm1/kernel/power/disk.c
    ===================================================================
    --- linux-2.6.14-rc4-mm1.orig/kernel/power/disk.c 2005-10-17 23:28:33.000000000 +0200
    +++ linux-2.6.14-rc4-mm1/kernel/power/disk.c 2005-10-17 23:28:52.000000000 +0200
    @@ -92,10 +92,7 @@
    printk("Freeing memory... ");
    while ((tmp = shrink_all_memory(10000))) {
    pages += tmp;
    - printk("\b%c", p[i]);
    - i++;
    - if (i > 3)
    - i = 0;
    + printk("\b%c", p[i++ % 4]);
    }
    printk("\bdone (%li pages freed)\n", pages);
    }
    @@ -177,13 +174,12 @@
    goto Done;

    if (in_suspend) {
    + device_resume();
    pr_debug("PM: writing image.\n");
    error = swsusp_write();
    if (!error)
    power_down(pm_disk_mode);
    else {
    - /* swsusp_write can not fail in device_resume,
    - no need to do second device_resume */
    swsusp_free();
    unprepare_processes();
    return error;
    Index: linux-2.6.14-rc4-mm1/kernel/power/swsusp.c
    ===================================================================
    --- linux-2.6.14-rc4-mm1.orig/kernel/power/swsusp.c 2005-10-17 23:28:47.000000000 +0200
    +++ linux-2.6.14-rc4-mm1/kernel/power/swsusp.c 2005-10-17 23:28:52.000000000 +0200
    @@ -562,7 +562,7 @@
    int swsusp_write(void)
    {
    int error;
    - device_resume();
    +
    lock_swapdevices();
    error = write_suspend_image();
    /* This will unlock ignored swap devices since writing is finished */
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-10-18 00:45    [W:0.022 / U:1.972 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site