public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Nigel Cunningham <nigel@tuxonice.net>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
	Linux PM <linux-pm@lists.linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	TuxOnIce-devel <tuxonice-devel@tuxonice.net>
Subject: Re: [PATCH 13/23] Hibernation: Partial page I/O support.
Date: Wed, 13 Oct 2010 09:10:08 +0200	[thread overview]
Message-ID: <20101013071008.GA1610@ucw.cz> (raw)
In-Reply-To: <1285566238-10966-14-git-send-email-nigel@tuxonice.net>

Hi!

> Add functions that can be used for coalescing and splitting buffers
> that are smaller than PAGE_SIZE. These functions provide no method
> of determining where the boundaries of the smaller buffers are to
> be found - that is the caller's problem.

I don't get it; why do we need that support?


> +int hib_write_buffer(char *buffer, int buffer_size)
> +{
> +	int bytes_left = buffer_size, result = 0;
> +
> +	while (bytes_left) {
> +		char *from = buffer + buffer_size - bytes_left;
> +		char *to = hib_ppio_buffer + hib_ppio_buffer_posn;
> +		int capacity = PAGE_SIZE - hib_ppio_buffer_posn;
> +
> +		if (bytes_left <= capacity) {
> +			memcpy(to, from, bytes_left);
> +			hib_ppio_buffer_posn += bytes_left;
> +			return 0;
> +		}
> +
> +		/* Complete this page and start a new one */
> +		memcpy(to, from, capacity);
> +		bytes_left -= capacity;

If this copy happens too often, it will slow stuff down...
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2010-10-13 13:05 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-27  5:43 Swsusp patches applied to suspend-2.6#linux-next Nigel Cunningham
2010-09-27  5:43 ` [PATCH 01/23] Hibernation: Split compression support out Nigel Cunningham
2010-09-27 20:27   ` Rafael J. Wysocki
2010-09-27 20:32     ` Nigel Cunningham
2010-10-01 21:28       ` Rafael J. Wysocki
2010-10-01 21:45         ` Nigel Cunningham
2010-10-01 22:15           ` Rafael J. Wysocki
2010-09-27  5:43 ` [PATCH 02/23] Record & display i/o speed post resume Nigel Cunningham
2010-09-27 20:06   ` Rafael J. Wysocki
2010-09-27 20:26     ` Nigel Cunningham
2010-09-27 20:49       ` Rafael J. Wysocki
2010-09-27 21:05         ` Nigel Cunningham
2010-09-27 21:16           ` Rafael J. Wysocki
2010-09-27  5:43 ` [PATCH 03/23] Hibernation: Swap iteration functions Nigel Cunningham
2010-10-04 17:54   ` [linux-pm] " Pavel Machek
2010-10-06  1:22     ` Nigel Cunningham
2010-09-27  5:43 ` [PATCH 04/23] Hibernation: Move root_swap declaration Nigel Cunningham
2010-09-27  5:43 ` [PATCH 05/23] Hibernation: Add mass swap allocation routine Nigel Cunningham
2010-09-27  5:43 ` [PATCH 06/23] Hibernation: Switch to preallocating swap Nigel Cunningham
2010-09-27  5:43 ` [PATCH 07/23] Hiberation: Fix speed display Nigel Cunningham
2010-10-04 17:51   ` [linux-pm] " Pavel Machek
2010-09-27  5:43 ` [PATCH 08/23] Hibernation: Generic extents support Nigel Cunningham
2010-10-04 17:51   ` [linux-pm] " Pavel Machek
2010-10-06  1:21     ` Nigel Cunningham
2010-09-27  5:43 ` [PATCH 09/23] Hibernation: Iterate over sectors not swap entries Nigel Cunningham
2010-09-27  5:43 ` [PATCH 10/23] Hibernation: Stop passing swap_map_handle struct Nigel Cunningham
2010-09-27  5:43 ` [PATCH 11/23] Hibernation: Stop passing bio_chain around Nigel Cunningham
2010-09-27  5:43 ` [PATCH 12/23] Hibernation: Move block i/o fns to block_io.c Nigel Cunningham
2010-09-27  5:43 ` [PATCH 13/23] Hibernation: Partial page I/O support Nigel Cunningham
2010-10-13  7:10   ` Pavel Machek [this message]
2010-10-13 20:28     ` Rafael J. Wysocki
2010-10-13 21:17       ` Nigel Cunningham
2010-09-27  5:43 ` [PATCH 14/23] Hibernation: Store block extents at start of image Nigel Cunningham
2010-09-27  5:43 ` [PATCH 15/23] Hibernation: Use block extents for reading image Nigel Cunningham
2010-09-27  5:43 ` [PATCH 16/23] Remove first_sector from swap_map_handle Nigel Cunningham
2010-09-27  5:43 ` [PATCH 17/23] Hibernation: Replace bio chain Nigel Cunningham
2010-09-27  5:43 ` [PATCH 18/23] Hibernation: Remove swap_map_pages Nigel Cunningham
2010-09-27  5:43 ` [PATCH 19/23] Hibernation: Remove wait_on_bio_chain result Nigel Cunningham
2010-09-27  5:43 ` [PATCH 20/23] Hibernation: Prepare for handle.cur removal Nigel Cunningham
2010-09-27  5:43 ` [PATCH 21/23] Hibernation: Remove swap_map structure Nigel Cunningham
2010-09-27  5:43 ` [PATCH 22/23] Hibernation: Remove now-empty routines Nigel Cunningham
2010-09-27  5:43 ` [PATCH 23/23] Hibernate: Implement readahead when resuming Nigel Cunningham
2010-09-27  6:59 ` [TuxOnIce-devel] Swsusp patches applied to suspend-2.6#linux-next Andrey Rahmatullin
2010-09-27  8:28   ` Nigel Cunningham
2010-09-27  8:00 ` Andrey Rahmatullin
2010-09-27  8:29   ` Nigel Cunningham
2010-09-27  9:38     ` Andrey Rahmatullin
2010-09-27  9:57       ` Nigel Cunningham
2010-09-27 11:16     ` Andrey Rahmatullin
2010-09-27 11:39       ` Nigel Cunningham
2010-10-02 16:49 ` [linux-pm] " Martin Steigerwald
2010-10-04  8:00   ` Martin Steigerwald
2010-10-04  8:31     ` Nigel Cunningham
2010-10-04  8:55       ` Martin Steigerwald
2010-10-04  8:47     ` Martin Steigerwald

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=20101013071008.GA1610@ucw.cz \
    --to=pavel@ucw.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=nigel@tuxonice.net \
    --cc=rjw@sisk.pl \
    --cc=tuxonice-devel@tuxonice.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