From: Joerg Roedel <joro@8bytes.org>
To: Pavel Machek <pavel@ucw.cz>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Len Brown <len.brown@intel.com>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
Joerg Roedel <jroedel@suse.de>
Subject: Re: [PATCH 1/6] PM / Hibernate: Create a Radix-Tree to store memory bitmap
Date: Tue, 22 Jul 2014 00:36:37 +0200 [thread overview]
Message-ID: <20140721223637.GU30979@8bytes.org> (raw)
In-Reply-To: <1405938422-21900-2-git-send-email-joro@8bytes.org>
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
next prev parent reply other threads:[~2014-07-21 22:36 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-21 10:26 [PATCH 0/6 v2] PM / Hibernate: Memory bitmap scalability improvements Joerg Roedel
2014-07-21 10:26 ` [PATCH 1/6] PM / Hibernate: Create a Radix-Tree to store memory bitmap Joerg Roedel
2014-07-21 22:36 ` Joerg Roedel [this message]
2014-07-21 23:05 ` Pavel Machek
2014-07-21 10:26 ` [PATCH 2/6] PM / Hibernate: Add memory_rtree_find_bit function Joerg Roedel
2014-07-21 10:26 ` [PATCH 3/6] PM / Hibernate: Implement position keeping in radix tree Joerg Roedel
2014-07-21 10:27 ` [PATCH 4/6] PM / Hibernate: Iterate over set bits instead of PFNs in swsusp_free() Joerg Roedel
2014-07-21 10:27 ` [PATCH 5/6] PM / Hibernate: Remove the old memory-bitmap implementation Joerg Roedel
2014-07-21 10:27 ` [PATCH 6/6] PM / Hibernate: Touch Soft Lockup Watchdog in rtree_next_node Joerg Roedel
2014-07-21 12:00 ` [PATCH 0/6 v2] PM / Hibernate: Memory bitmap scalability improvements Pavel Machek
2014-07-21 12:36 ` Joerg Roedel
2014-07-21 13:06 ` Pavel Machek
2014-07-21 13:38 ` Joerg Roedel
2014-07-21 14:10 ` Pavel Machek
2014-07-21 16:03 ` Joerg Roedel
2014-07-21 23:05 ` Pavel Machek
2014-07-22 0:41 ` Rafael J. Wysocki
2014-07-22 10:34 ` Joerg Roedel
2014-07-22 10:55 ` Pavel Machek
2014-07-22 12:24 ` Joerg Roedel
2014-07-22 10:58 ` Pavel Machek
2014-07-22 12:10 ` Joerg Roedel
2014-07-23 10:57 ` Pavel Machek
2014-07-28 13:59 ` Borislav Petkov
2014-07-29 21:22 ` Rafael J. Wysocki
-- strict thread matches above, loose matches on Subject: below --
2014-07-18 11:57 [PATCH 0/6] " Joerg Roedel
2014-07-18 11:57 ` [PATCH 1/6] PM / Hibernate: Create a Radix-Tree to store memory bitmap Joerg Roedel
2014-07-19 0:00 ` Rafael J. Wysocki
2014-07-19 7:57 ` Joerg Roedel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140721223637.GU30979@8bytes.org \
--to=joro@8bytes.org \
--cc=jroedel@suse.de \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rjw@rjwysocki.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox