-mm swsusp: copy_page is harmfull

From: Pavel Machek (pavel_at_ucw.cz)
Date: 07/29/04

  • Next message: Ben Greear: "Re: PATCH: VLAN support for 3c59x/3c90x"
    Date:	Thu, 29 Jul 2004 00:26:45 +0200
    To: Patrick Mochel <mochel@digitalimplant.org>, Andrew Morton <akpm@zip.com.au>, kernel list <linux-kernel@vger.kernel.org>
    
    

    Hi!

    This is my fault from long time ago: copy_page can't be used for
    copying task struct, therefore we can't use it in swsusp. Please
    apply,

                                                            Pavel

    --- clean-mm/kernel/power/swsusp.c 2004-07-28 23:39:49.000000000 +0200
    +++ linux-mm/kernel/power/swsusp.c 2004-07-28 23:30:33.000000000 +0200
    @@ -614,12 +614,8 @@
                                             struct page * page;
                                             page = pfn_to_page(zone_pfn + zone->zone_start_pfn);
                                             pbe->orig_address = (long) page_address(page);
    - /* Copy page is dangerous: it likes to mess with
    - preempt count on specific cpus. Wrong preempt
    - count is then copied, oops.
    - */
    - copy_page((void *)pbe->address,
    - (void *)pbe->orig_address);
    + /* copy_page is no usable for copying task structs. */
    + memcpy((void *)pbe->address, (void *)pbe->orig_address, PAGE_SIZE);
                                             pbe++;
                                     }
                             }

    -- 
    People were complaining that M$ turns users into beta-testers...
    ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
    -
    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/
    

  • Next message: Ben Greear: "Re: PATCH: VLAN support for 3c59x/3c90x"

    Relevant Pages

    • Re: [RFC] Changing COW detection to be memory hotplug friendly
      ... Keeping the swap slot ... is valuable if read fault, but once the page is dirtied, wouldn't ... I cannot imagine a good enough range of swap performance tests. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: All filesystems hang under long periods of heavy load (read and write) on a filesystem
      ... > the filesystem on the partition being written to. ... It seems that this boils down to using PIO mode, after enabling DMA I am ... the fault might not be fixed, it might just be less obvious... ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [Patchset] 2.4.22-rc1-dis7 released
      ... - Swsusp 1.1-pre3 ... - Packet mode for cd/dvd writing ... - Optionally disable trackpad while typing ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Stop the linux kernel madness - SOLVED!
      ... > So simply removing this symlink and putting back a link to ... IF the fault here is SUSE's, then submit THEM a bug report and stop whining in lkml. ... could have between lkml readers. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: system-freeze: kprobe and do_gettimeofday
      ... "insmod kgettime.ko" from the console ... double fault, ... Then I removed all my modules I was able to load the module ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)