From: Oren Laadan <orenl@cs.columbia.edu>
To: Dave Hansen <dave@linux.vnet.ibm.com>
Cc: containers@lists.linux-foundation.org, jeremy@goop.org,
linux-kernel@vger.kernel.org, arnd@arndb.de
Subject: Re: [RFC v3][PATCH 4/9] Memory management (dump)
Date: Sat, 06 Sep 2008 21:54:05 -0400 [thread overview]
Message-ID: <48C3343D.9000407@cs.columbia.edu> (raw)
In-Reply-To: <1220552725.23386.46.camel@nimitz>
Dave Hansen wrote:
> On Thu, 2008-09-04 at 04:03 -0400, Oren Laadan wrote:
>> +/* free a chain of page-arrays */
>> +void cr_pgarr_free(struct cr_ctx *ctx)
>> +{
>> + struct cr_pgarr *pgarr, *pgnxt;
>> +
>> + for (pgarr = ctx->pgarr; pgarr; pgarr = pgnxt) {
>> + _cr_pgarr_release(ctx, pgarr);
>> + free_pages((unsigned long) ctx->pgarr->addrs, CR_PGARR_ORDER);
>> + free_pages((unsigned long) ctx->pgarr->pages, CR_PGARR_ORDER);
>> + pgnxt = pgarr->next;
>> + kfree(pgarr);
>> + }
>> +}
>
> What we effectively have here is:
>
> void *addrs[CR_PGARR_TOTAL];
> void *pages[CR_PGARR_TOTAL];
>
> right?
>
> Would any of this get simpler if we just had:
>
> struct cr_page {
> struct page *page;
> unsigned long vaddr;
> };
>
> struct cr_pgarr {
> struct cr_page *cr_pages;
> struct cr_pgarr *next;
> unsigned short nleft;
> unsigned short nused;
> };
The reason I use separate arrays instead of an array of tuples is that
the logic is to write all vaddr at once - simply by dumping the array
of vaddrs.
>
> Also, we do have lots of linked list implementations in the kernel.
> They do lots of fun stuff like poisoning and checking for
> initialization. We should use them instead of rolling our own. It lets
> us do other fun stuff like list_for_each().
>
> Also, just looking at this structure 'nleft' and 'nused' sound a bit
> redundant. I know from looking at the code that this is how many have
> been filled and read back at restore time, but that is not very obvious
> looking at the structure. I think we can do a bit better in the
> structure itself.
>
> The length of the arrays is fixed at compile-time, right? Should we
> just make that explicit as well?
The length of the array may be tunable, or even adaptive (e.g. based
on statistics from recent checkpoints), in the future.
Oren.
next prev parent reply other threads:[~2008-09-07 1:54 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-04 7:57 [RFC v3][PATCH 0/9] Kernel based checkpoint/restart Oren Laadan
2008-09-04 8:02 ` [RFC v3][PATCH 1/9] Create syscalls: sys_checkpoint, sys_restart Oren Laadan
2008-09-04 8:37 ` Cedric Le Goater
2008-09-04 14:42 ` Serge E. Hallyn
2008-09-04 17:32 ` Oren Laadan
2008-09-04 20:37 ` Serge E. Hallyn
2008-09-04 21:05 ` Oren Laadan
2008-09-04 22:03 ` Serge E. Hallyn
2008-09-08 15:02 ` [Devel] " Andrey Mirkin
2008-09-08 16:07 ` Cedric Le Goater
2008-09-04 8:02 ` [RFC v3][PATCH 2/9] General infrastructure for checkpoint restart Oren Laadan
2008-09-04 9:12 ` Louis Rilling
2008-09-04 16:00 ` Serge E. Hallyn
2008-09-04 16:03 ` Serge E. Hallyn
2008-09-04 16:09 ` Dave Hansen
2008-09-04 8:03 ` [RFC v3][PATCH 3/9] x86 support for checkpoint/restart Oren Laadan
2008-09-04 8:03 ` [RFC v3][PATCH 4/9] Memory management (dump) Oren Laadan
2008-09-04 18:25 ` Dave Hansen
2008-09-07 1:54 ` Oren Laadan [this message]
2008-09-08 15:55 ` Dave Hansen
2008-09-04 8:04 ` [RFC v3][PATCH 5/9] Memory managemnet (restore) Oren Laadan
2008-09-04 18:08 ` Dave Hansen
2008-09-07 3:09 ` Oren Laadan
2008-09-08 16:49 ` Dave Hansen
2008-09-09 6:01 ` Oren Laadan
2008-09-10 21:42 ` Dave Hansen
2008-09-10 22:00 ` Cleanups for: [PATCH " Dave Hansen
2008-09-11 7:37 ` [RFC v3][PATCH " Oren Laadan
2008-09-11 15:38 ` Serge E. Hallyn
2008-09-12 16:34 ` Dave Hansen
2008-09-04 8:04 ` [RFC v3][PATCH 6/9] Checkpoint/restart: initial documentation Oren Laadan
2008-09-04 8:05 ` [RFC v3][PATCH 7/9] Infrastructure for shared objects Oren Laadan
2008-09-04 9:38 ` Louis Rilling
2008-09-04 14:23 ` Oren Laadan
2008-09-04 18:14 ` Dave Hansen
2008-09-04 8:05 ` [RFC v3][PATCH 8/9] File descriprtors (dump) Oren Laadan
2008-09-04 9:47 ` Louis Rilling
2008-09-04 14:43 ` Oren Laadan
2008-09-04 15:01 ` Dave Hansen
2008-09-04 18:41 ` Dave Hansen
2008-09-07 4:52 ` Oren Laadan
2008-09-08 16:57 ` Dave Hansen
2008-09-04 8:06 ` [RFC v3][PATCH 9/9] File descriprtors (restore) Oren Laadan
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=48C3343D.9000407@cs.columbia.edu \
--to=orenl@cs.columbia.edu \
--cc=arnd@arndb.de \
--cc=containers@lists.linux-foundation.org \
--cc=dave@linux.vnet.ibm.com \
--cc=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.org \
/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