* [patch] SUSPEND_PD_PAGES-fix
@ 2005-03-16 20:28 Coywolf Qi Hunt
2005-03-18 11:39 ` Pavel Machek
0 siblings, 1 reply; 6+ messages in thread
From: Coywolf Qi Hunt @ 2005-03-16 20:28 UTC (permalink / raw)
To: pavel; +Cc: akpm, linux-kernel
Hello,
This fixes SUSPEND_PD_PAGES, which wastes one page under most cases.
Coywolf
Signed-off-by: Coywolf Qi Hunt <coywolf@gmail.com>
diff -pruN 2.6.11-mm4/include/linux/suspend.h 2.6.11-mm4-cy/include/linux/suspend.h
--- 2.6.11-mm4/include/linux/suspend.h 2005-03-17 01:22:16.000000000 +0800
+++ 2.6.11-mm4-cy/include/linux/suspend.h 2005-03-17 04:14:16.000000000 +0800
@@ -34,7 +34,7 @@ typedef struct pbe {
#define SWAP_FILENAME_MAXLENGTH 32
-#define SUSPEND_PD_PAGES(x) (((x)*sizeof(struct pbe))/PAGE_SIZE+1)
+#define SUSPEND_PD_PAGES(x) (((x)*sizeof(struct pbe)+PAGE_SIZE-1)/PAGE_SIZE)
extern dev_t swsusp_resume_device;
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] SUSPEND_PD_PAGES-fix
2005-03-16 20:28 [patch] SUSPEND_PD_PAGES-fix Coywolf Qi Hunt
@ 2005-03-18 11:39 ` Pavel Machek
2005-03-18 13:34 ` Rafael J. Wysocki
2005-03-18 15:56 ` Coywolf Qi Hunt
0 siblings, 2 replies; 6+ messages in thread
From: Pavel Machek @ 2005-03-18 11:39 UTC (permalink / raw)
To: coywolf, Rafael J. Wysocki; +Cc: akpm, linux-kernel
Hi!
> This fixes SUSPEND_PD_PAGES, which wastes one page under most cases.
Ok, applied to my tree, will eventually propagate it. (I hope it looks
okay to you, rafael).
> Signed-off-by: Coywolf Qi Hunt <coywolf@gmail.com>
> diff -pruN 2.6.11-mm4/include/linux/suspend.h 2.6.11-mm4-cy/include/linux/suspend.h
> --- 2.6.11-mm4/include/linux/suspend.h 2005-03-17 01:22:16.000000000 +0800
> +++ 2.6.11-mm4-cy/include/linux/suspend.h 2005-03-17 04:14:16.000000000 +0800
> @@ -34,7 +34,7 @@ typedef struct pbe {
> #define SWAP_FILENAME_MAXLENGTH 32
>
>
> -#define SUSPEND_PD_PAGES(x) (((x)*sizeof(struct pbe))/PAGE_SIZE+1)
> +#define SUSPEND_PD_PAGES(x) (((x)*sizeof(struct pbe)+PAGE_SIZE-1)/PAGE_SIZE)
>
> extern dev_t swsusp_resume_device;
>
--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] SUSPEND_PD_PAGES-fix
2005-03-18 11:39 ` Pavel Machek
@ 2005-03-18 13:34 ` Rafael J. Wysocki
2005-03-18 18:56 ` Rafael J. Wysocki
2005-03-18 15:56 ` Coywolf Qi Hunt
1 sibling, 1 reply; 6+ messages in thread
From: Rafael J. Wysocki @ 2005-03-18 13:34 UTC (permalink / raw)
To: Pavel Machek; +Cc: coywolf, akpm, linux-kernel
Hi,
On Friday, 18 of March 2005 12:39, Pavel Machek wrote:
> Hi!
>
>
> > This fixes SUSPEND_PD_PAGES, which wastes one page under most cases.
>
> Ok, applied to my tree, will eventually propagate it. (I hope it looks
> okay to you, rafael).
SUSPEND_PD_PAGES is not necessary in swsusp any more. :-) We can just
drop it, together with the pagedir_order variable, which is not used. I'll
send a patch later today.
BTW, I'm going to post some clean ups for swsusp.c, but I'd like the last
changes to settle down in mainline before, if you don't mind.
Greets,
Rafael
--
- Would you tell me, please, which way I ought to go from here?
- That depends a good deal on where you want to get to.
-- Lewis Carroll "Alice's Adventures in Wonderland"
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] SUSPEND_PD_PAGES-fix
2005-03-18 11:39 ` Pavel Machek
2005-03-18 13:34 ` Rafael J. Wysocki
@ 2005-03-18 15:56 ` Coywolf Qi Hunt
1 sibling, 0 replies; 6+ messages in thread
From: Coywolf Qi Hunt @ 2005-03-18 15:56 UTC (permalink / raw)
To: Pavel Machek; +Cc: coywolf, Rafael J. Wysocki, akpm, linux-kernel
Pavel Machek wrote:
> Hi!
>
>
>
>>This fixes SUSPEND_PD_PAGES, which wastes one page under most cases.
-This fixes SUSPEND_PD_PAGES, which wastes one page under most cases.
+This fixes SUSPEND_PD_PAGES, which, in rare instances, would waste a signle page.
I see rafael is going to drop it. Anyway, my description was wrong.
Coywolf
>
>
> Ok, applied to my tree, will eventually propagate it. (I hope it looks
> okay to you, rafael).
>
>
>>Signed-off-by: Coywolf Qi Hunt <coywolf@gmail.com>
>>diff -pruN 2.6.11-mm4/include/linux/suspend.h 2.6.11-mm4-cy/include/linux/suspend.h
>>--- 2.6.11-mm4/include/linux/suspend.h 2005-03-17 01:22:16.000000000 +0800
>>+++ 2.6.11-mm4-cy/include/linux/suspend.h 2005-03-17 04:14:16.000000000 +0800
>>@@ -34,7 +34,7 @@ typedef struct pbe {
>> #define SWAP_FILENAME_MAXLENGTH 32
>>
>>
>>-#define SUSPEND_PD_PAGES(x) (((x)*sizeof(struct pbe))/PAGE_SIZE+1)
>>+#define SUSPEND_PD_PAGES(x) (((x)*sizeof(struct pbe)+PAGE_SIZE-1)/PAGE_SIZE)
>>
>> extern dev_t swsusp_resume_device;
>>
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] SUSPEND_PD_PAGES-fix
2005-03-18 13:34 ` Rafael J. Wysocki
@ 2005-03-18 18:56 ` Rafael J. Wysocki
2005-03-19 0:02 ` Pavel Machek
0 siblings, 1 reply; 6+ messages in thread
From: Rafael J. Wysocki @ 2005-03-18 18:56 UTC (permalink / raw)
To: Pavel Machek; +Cc: coywolf, akpm, linux-kernel
On Friday, 18 of March 2005 14:34, Rafael J. Wysocki wrote:
> Hi,
>
> On Friday, 18 of March 2005 12:39, Pavel Machek wrote:
> > Hi!
> >
> >
> > > This fixes SUSPEND_PD_PAGES, which wastes one page under most cases.
> >
> > Ok, applied to my tree, will eventually propagate it. (I hope it looks
> > okay to you, rafael).
>
> SUSPEND_PD_PAGES is not necessary in swsusp any more. :-) We can just
> drop it, together with the pagedir_order variable, which is not used. I'll
> send a patch later today.
The patch follows.
Greets,
Rafael
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
diff -Nrup linux-2.6.12-rc1/include/linux/suspend.h linux-2.6.12-rc1-a/include/linux/suspend.h
--- linux-2.6.12-rc1/include/linux/suspend.h 2005-03-18 18:50:15.000000000 +0100
+++ linux-2.6.12-rc1-a/include/linux/suspend.h 2005-03-18 18:58:27.000000000 +0100
@@ -34,8 +34,6 @@ typedef struct pbe {
#define SWAP_FILENAME_MAXLENGTH 32
-#define SUSPEND_PD_PAGES(x) (((x)*sizeof(struct pbe))/PAGE_SIZE+1)
-
extern dev_t swsusp_resume_device;
/* mm/vmscan.c */
diff -Nrup linux-2.6.12-rc1/kernel/power/swsusp.c linux-2.6.12-rc1-a/kernel/power/swsusp.c
--- linux-2.6.12-rc1/kernel/power/swsusp.c 2005-03-18 18:50:18.000000000 +0100
+++ linux-2.6.12-rc1-a/kernel/power/swsusp.c 2005-03-18 18:59:46.000000000 +0100
@@ -98,7 +98,6 @@ unsigned int nr_copy_pages __nosavedata
*/
suspend_pagedir_t *pagedir_nosave __nosavedata = NULL;
static suspend_pagedir_t *pagedir_save;
-static int pagedir_order __nosavedata = 0;
#define SWSUSP_SIG "S1SUSPEND"
@@ -1219,7 +1218,6 @@ static int check_header(void)
return -EPERM;
}
nr_copy_pages = swsusp_info.image_pages;
- pagedir_order = get_bitmask_order(SUSPEND_PD_PAGES(nr_copy_pages));
return error;
}
--
- Would you tell me, please, which way I ought to go from here?
- That depends a good deal on where you want to get to.
-- Lewis Carroll "Alice's Adventures in Wonderland"
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] SUSPEND_PD_PAGES-fix
2005-03-18 18:56 ` Rafael J. Wysocki
@ 2005-03-19 0:02 ` Pavel Machek
0 siblings, 0 replies; 6+ messages in thread
From: Pavel Machek @ 2005-03-19 0:02 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: kernel list
Hi!
> > > > This fixes SUSPEND_PD_PAGES, which wastes one page under most cases.
> > >
> > > Ok, applied to my tree, will eventually propagate it. (I hope it looks
> > > okay to you, rafael).
> >
> > SUSPEND_PD_PAGES is not necessary in swsusp any more. :-) We can just
> > drop it, together with the pagedir_order variable, which is not used. I'll
> > send a patch later today.
>
> The patch follows.
Applied to my tree, will propagate.
Pavel
--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-03-19 0:15 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-16 20:28 [patch] SUSPEND_PD_PAGES-fix Coywolf Qi Hunt
2005-03-18 11:39 ` Pavel Machek
2005-03-18 13:34 ` Rafael J. Wysocki
2005-03-18 18:56 ` Rafael J. Wysocki
2005-03-19 0:02 ` Pavel Machek
2005-03-18 15:56 ` Coywolf Qi Hunt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox