public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: linux-pm@osdl.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC][PATCH 3/6] swsusp: introduce the swap map structure and interface functions
Date: Sun, 30 Oct 2005 00:57:08 +0200	[thread overview]
Message-ID: <20051029225708.GD14209@elf.ucw.cz> (raw)
In-Reply-To: <200510292232.35403.rjw@sisk.pl>

[-- Attachment #1: Type: text/plain, Size: 1758 bytes --]

Hi!

> This is the main part.  It introduces a new data structure for the
> swap-handling part of swsusp (the swap map structure, described in a comment)
> and new functions for writing the image data to and reading them from swap.
> It also introduces the interface functions allowing the snapshot-handling part
> to communicate with the swap-handling part and modifies the struct pbe
> structure (the swap_address member of it is no longer needed as the
> swap-handling part uses its own independent data structures).

One small comment. I miss "a" in "swap". Pretty please...

> + * Rafael J. Wysocki <rjw@sisk.pl>
> + * Added the swap map data structure and reworked the handling of swap
> + *

Feel free to add yourself to CREDITS, too. CREDITS are going to stay,
but this does not really belong here, and may have to be moved
somewhere else in future.

> + *	During resume we only need to use one swp_map_page structure
> + *	at a time, which means that we only need to use two memory pages for
> + *	reading the image - one for reading the swp_map_page structures
> + *	and the second for reading the data pages from swap.
>   */

Nice...

> +struct swp_map_page {
> +	swp_entry_t		entries[MAP_PAGE_SIZE];
> +	swp_entry_t		next_swp;
> +	struct swp_map_page	*next;
> +};
> +
> +typedef struct swp_map_page swp_map_t;

Please don't. Just use "struct swap_map_page" instead.

> +extern unsigned snapshot_pages_to_save(void);
> +extern unsigned snapshot_image_pages(void);

Make it "extern unsigned int". (That is in more than one place).

> +int snapshot_recv_init(unsigned nr_pages, unsigned img_pages)

Please, usefull words, that's receive_init and image_pages....

Otherwise it looks good. I'll check it once more...

							Pavel
-- 
Thanks, Sharp!

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2005-10-29 22:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-29 19:58 [RFC][PATCH 0/6] swsusp: rework swap handling Rafael J. Wysocki
2005-10-29 20:01 ` [RFC][PATCH 1/6] swsusp: rework swsusp_suspend Rafael J. Wysocki
2005-10-29 22:25   ` Pavel Machek
2005-10-29 20:06 ` [RFC][PATCH 2/6] swsusp: move snapshot-handling functions to snapshot.c Rafael J. Wysocki
2005-10-29 22:27   ` Pavel Machek
2005-10-29 20:32 ` [RFC][PATCH 3/6] swsusp: introduce the swap map structure and interface functions Rafael J. Wysocki
2005-10-29 22:57   ` Pavel Machek [this message]
2005-10-29 23:20   ` Pavel Machek
2005-10-29 20:36 ` [RFC][PATCH 4/6] swsusp: move swap check out of swsusp_suspend Rafael J. Wysocki
2005-10-29 23:21   ` Pavel Machek
2005-10-30 12:40     ` Rafael J. Wysocki
2005-10-30 11:46       ` Pavel Machek
2005-10-29 20:41 ` [RFC][PATCH 5/6] swsusp: move swap-handling functions to separate file Rafael J. Wysocki
2005-10-30 13:33   ` Pavel Machek
2005-10-29 20:46 ` [RFC][PATCH 6/6] swsusp: improve freeing of memory Rafael J. Wysocki
2005-10-29 23:05 ` [RFC][PATCH 0/6] swsusp: rework swap handling Pavel Machek
2005-10-30 12:17   ` Pavel Machek

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=20051029225708.GD14209@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@osdl.org \
    --cc=rjw@sisk.pl \
    /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