lkml.org 
[lkml]   [2014]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/6] PM / Hibernate: Create a Radix-Tree to store memory bitmap
Pavel,

On Mon, Jul 21, 2014 at 12:26:57PM +0200, Joerg Roedel wrote:
> unsigned int snapshot_additional_pages(struct zone *zone)
> {
> + unsigned int rtree, nodes;
> unsigned int res;
>
> res = DIV_ROUND_UP(zone->spanned_pages, BM_BITS_PER_BLOCK);
> res += DIV_ROUND_UP(res * sizeof(struct bm_block),
> LINKED_PAGE_DATA_SIZE);
> - return 2 * res;
> + rtree = nodes = DIV_ROUND_UP(zone->spanned_pages, BM_BITS_PER_BLOCK);
> + rtree += DIV_ROUND_UP(rtree * sizeof(struct rtree_node),
> + LINKED_PAGE_DATA_SIZE);
> + while (nodes > 1) {
> + nodes = DIV_ROUND_UP(nodes, BM_ENTRIES_PER_LEVEL);
> + rtree += nodes;
> + }
> +
> + return 2 * (res + rtree);
> }

Since you asked in another mail if I took the new data structure size
requirements into account, here is the code I added for this
computation.

Note that the above diff leaves the old code around because the old
memory bitmap implementation is not removed before patch 5/6 (which also
removes the old computation). So the final code will only have the new
size calculation in it.

Do you have any more concerns?


Joerg



\
 
 \ /
  Last update: 2014-07-22 01:21    [W:0.116 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site