linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PM / Hibernate: Correct additional page calculation
@ 2012-01-17  2:43 Namhyung Kim
  2012-01-17 22:54 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Namhyung Kim @ 2012-01-17  2:43 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Namhyung Kim, Pavel Machek, Len Brown, linux-pm, linux-kernel

The struct bm_block is allocated by chain_alloc(),
so it'd better counting it in LINKED_PAGE_DATA_SIZE.

Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
---
 kernel/power/snapshot.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index cbe2c1441392..7196d3c023e1 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -812,7 +812,8 @@ unsigned int snapshot_additional_pages(struct zone *zone)
 	unsigned int res;
 
 	res = DIV_ROUND_UP(zone->spanned_pages, BM_BITS_PER_BLOCK);
-	res += DIV_ROUND_UP(res * sizeof(struct bm_block), PAGE_SIZE);
+	res += DIV_ROUND_UP(res * sizeof(struct bm_block),
+			    LINKED_PAGE_DATA_SIZE);
 	return 2 * res;
 }
 
-- 
1.7.9.rc1.dirty


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] PM / Hibernate: Correct additional page calculation
  2012-01-17  2:43 [PATCH] PM / Hibernate: Correct additional page calculation Namhyung Kim
@ 2012-01-17 22:54 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2012-01-17 22:54 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Namhyung Kim, Pavel Machek, Len Brown, linux-pm, linux-kernel

On Tuesday, January 17, 2012, Namhyung Kim wrote:
> The struct bm_block is allocated by chain_alloc(),
> so it'd better counting it in LINKED_PAGE_DATA_SIZE.

Yes, good catch, thanks!

I'm going to push this to Linus in the next round of fixes.

Thanks,
Rafael


> Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
> ---
>  kernel/power/snapshot.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
> index cbe2c1441392..7196d3c023e1 100644
> --- a/kernel/power/snapshot.c
> +++ b/kernel/power/snapshot.c
> @@ -812,7 +812,8 @@ unsigned int snapshot_additional_pages(struct zone *zone)
>  	unsigned int res;
>  
>  	res = DIV_ROUND_UP(zone->spanned_pages, BM_BITS_PER_BLOCK);
> -	res += DIV_ROUND_UP(res * sizeof(struct bm_block), PAGE_SIZE);
> +	res += DIV_ROUND_UP(res * sizeof(struct bm_block),
> +			    LINKED_PAGE_DATA_SIZE);
>  	return 2 * res;
>  }
>  
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-17 22:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-17  2:43 [PATCH] PM / Hibernate: Correct additional page calculation Namhyung Kim
2012-01-17 22:54 ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).