[dm-devel] [PATCH 6/6] dm-snapshot: use bufio prefetch
Mike Snitzer
snitzer at redhat.com
Tue Jan 14 16:58:40 UTC 2014
On Mon, Jan 13 2014 at 7:14pm -0500,
Mikulas Patocka <mpatocka at redhat.com> wrote:
> This patch modifies dm-snapshot so that it prefetches the buffers when
> loading the exceptions.
>
> The number of buffers read ahead is specified in the DM_PREFETCH_CHUNKS
> macro.
>
> Signed-off-by: Mikulas Patocka <mpatocka at redhat.com>
>
> ---
> drivers/md/dm-snap-persistent.c | 22 +++++++++++++++++++++-
> 1 file changed, 21 insertions(+), 1 deletion(-)
>
> Index: linux-3.13-rc7/drivers/md/dm-snap-persistent.c
> ===================================================================
> --- linux-3.13-rc7.orig/drivers/md/dm-snap-persistent.c 2014-01-14 00:54:52.000000000 +0100
> +++ linux-3.13-rc7/drivers/md/dm-snap-persistent.c 2014-01-14 00:56:39.000000000 +0100
> @@ -18,6 +18,8 @@
> #define DM_MSG_PREFIX "persistent snapshot"
> #define DM_CHUNK_SIZE_DEFAULT_SECTORS 32 /* 16KB */
>
> +#define DM_PREFETCH_CHUNKS 12
> +
> /*-----------------------------------------------------------------
> * Persistent snapshots, by persistent we mean that the snapshot
> * will survive a reboot.
...
> @@ -504,6 +507,8 @@ static int read_exceptions(struct pstore
> if (IS_ERR(client))
> return PTR_ERR(client);
>
> + dm_bufio_set_minimum_buffers(client, DM_PREFETCH_CHUNKS + 1);
> +
Why the +1? I'd prefer that be managed in dm-bufio rather than relying
on all callers to know to add +1.
Can you supply a followup patch that cleans this up in bufio and remove
the +1 in the above dm_bufio_set_minimum_buffers call?
More information about the dm-devel
mailing list