Re: [PATCH] Hibernate: Implement readahead when resuming

From: Pavel Machek
Date: Mon Oct 04 2010 - 13:58:34 EST


Hi!

> Add support for submitting reads before they're needed. This greatly
> improves the speed of resuming:
>
> From
>
> PM: Image read at 66 MB/s.
>
> to
>
> PM: Image read at 229 MB/s.
>
> ...and removes the need for the sync_read flag.

Hmm, not bad.

> @@ -67,13 +70,14 @@ static void hib_end_bio(struct bio *bio, int err)
> * @off physical offset of page.
> * @page: page we're reading or writing.
> * @sync: whether the i/o should be done synchronously
> + * @ra: whether the page is readahead
> *

This sync flag?

Merge sync and ra into 'flags' to make code easier to read?

> * Straight from the textbook - allocate and initialize the bio.
> * If we're reading, make sure the page is marked as dirty.
> * Then submit it and, if @sync, wait.
> */
> static int submit(int rw, struct block_device *bdev, sector_t sector,
> - struct page *page, int sync)
> + struct page *page, int sync, int ra)
> {
> const int bio_rw = rw | REQ_SYNC | REQ_UNPLUG;
> struct bio *bio;

> + printk("(1) Submitting readahead of sector %llu to page %p.\n",
> + offset, ra_page);

KERN_INFO?

> + return submit(READ, hib_resume_bdev, offset * (PAGE_SIZE >> 9),
> + ra_page, 0, 1);
> +}
> +
> +int start_more_readahead(void)

Too generic name for global function?

--
(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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/