lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 13 Oct 2010 09:10:08 +0200
From:	Pavel Machek <pavel@....cz>
To:	Nigel Cunningham <nigel@...onice.net>
Cc:	"Rafael J. Wysocki" <rjw@...k.pl>,
	Linux PM <linux-pm@...ts.linux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>,
	TuxOnIce-devel <tuxonice-devel@...onice.net>
Subject: Re: [PATCH 13/23] Hibernation: Partial page I/O support.

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ