From: Avi Kivity <avi@redhat.com>
To: Cesar Eduardo Barros <cesarb@cesarb.net>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] mm: Swap checksum
Date: Sun, 23 May 2010 18:19:46 +0300 [thread overview]
Message-ID: <4BF94792.5030405@redhat.com> (raw)
In-Reply-To: <1274551731-4534-3-git-send-email-cesarb@cesarb.net>
On 05/22/2010 09:08 PM, Cesar Eduardo Barros wrote:
> Add support for checksumming the swap pages written to disk, using the
> same checksum as btrfs (crc32c). Since the contents of the swap do not
> matter after a shutdown, the checksum is kept in memory only.
>
> Note that this code does not checksum the software suspend image.
>
>
>
> #define SWAP_FLAG_PREFER 0x8000 /* set if swap priority specified */
> #define SWAP_FLAG_PRIO_MASK 0x7fff
> @@ -180,6 +183,10 @@ struct swap_info_struct {
> struct swap_extent *curr_swap_extent;
> struct swap_extent first_swap_extent;
> struct block_device *bdev; /* swap device or bdev of swap file */
> +#ifdef CONFIG_SWAP_CHECKSUM
> + unsigned short *csum_count; /* usage count of a csum page */
> + u32 **csum; /* vmalloc'ed array of swap csums */
> +#endif
> struct file *swap_file; /* seldom referenced */
> unsigned int old_block_size; /* seldom referenced */
> };
>
On 64-bit, we may be able to store the checksum in the pte, if the swap
device is small enough.
If we take the trouble to touch the page, we may as well compare it
against zero, and if so drop it instead of swapping it out.
--
error compiling committee.c: too many arguments to function
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2010-05-23 15:19 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-22 18:08 [PATCH 0/3] mm: Swap checksum Cesar Eduardo Barros
2010-05-22 18:08 ` [PATCH 1/3] mm/swapfile.c: better messages for swap_info_get Cesar Eduardo Barros
2010-05-22 18:13 ` Borislav Petkov
2010-05-22 18:18 ` Cesar Eduardo Barros
2010-05-22 18:08 ` [PATCH 2/3] kernel/power/swap.c: do not use end_swap_bio_read Cesar Eduardo Barros
2010-05-22 18:08 ` [PATCH 3/3] mm: Swap checksum Cesar Eduardo Barros
2010-05-23 15:19 ` Avi Kivity [this message]
2010-05-23 18:58 ` Cesar Eduardo Barros
2010-05-24 6:41 ` Avi Kivity
2010-05-24 7:32 ` Nick Piggin
2010-05-24 10:51 ` Avi Kivity
2010-05-24 11:24 ` Cesar Eduardo Barros
2010-05-23 14:03 ` [PATCH 0/3] " Minchan Kim
2010-05-23 18:32 ` Cesar Eduardo Barros
2010-05-24 0:09 ` Minchan Kim
2010-05-24 0:57 ` Cesar Eduardo Barros
2010-05-24 2:05 ` Minchan Kim
2010-05-24 10:50 ` Cesar Eduardo Barros
2010-05-25 23:52 ` Minchan Kim
2010-05-26 10:21 ` Cesar Eduardo Barros
2010-05-26 15:31 ` Minchan Kim
2010-05-26 21:28 ` Valdis.Kletnieks
2010-05-26 22:45 ` Minchan Kim
2010-05-26 23:19 ` Cesar Eduardo Barros
2010-05-26 23:27 ` Minchan Kim
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=4BF94792.5030405@redhat.com \
--to=avi@redhat.com \
--cc=cesarb@cesarb.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).