From: Mike Snitzer <snitzer@redhat.com>
To: "Martin K. Petersen" <mkp@mkp.net>
Cc: Jens Axboe <jaxboe@fusionio.com>,
device-mapper development <dm-devel@redhat.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Zdenek Kabelac <zkabelac@redhat.com>
Subject: Re: mirrored device with thousand of mappingtableentries
Date: Tue, 8 Mar 2011 12:13:42 -0500 [thread overview]
Message-ID: <20110308171322.GB5692@redhat.com> (raw)
In-Reply-To: <yq1ipvudrzo.fsf@sermon.lab.mkp.net>
On Tue, Mar 08 2011 at 1:51am -0500,
Martin K. Petersen <mkp@mkp.net> wrote:
> >>>>> "Mike" == Mike Snitzer <snitzer@redhat.com> writes:
>
> Mike> Thanks for sorting this out. Can you post a patch that has a
> Mike> proper header with your Signed-off-by? Also including Zdenek's
> Mike> Tested-by, and my:
>
> I contemplated a bit and decided I liked the following approach
> better. What do you think?
>
>
> block: Require subsystems to explicitly allocate bio_set integrity mempool
>
> MD and DM create a new bio_set for every metadevice. Each bio_set has an
> integrity mempool attached regardless of whether the metadevice is
> capable of passing integrity metadata. This is a waste of memory.
>
> Instead we defer the allocation decision to MD and DM since we know at
> metadevice creation time whether integrity passthrough is needed or not.
>
> Automatic integrity mempool allocation can then be removed from
> bioset_create() and we make an explicit integrity allocation for the
> fs_bio_set.
>
> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
> Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
In general this approach looks fine too. Doesn't address the concern I
had yesterday about the blk_integrity block_size relative to DM (load vs
resume) but I'd imagine you'd like to sort that out in a separate patch.
But I found a few DM issues below. Provided those are sorted out:
Acked-by: Mike Snitzer <snitzer@redhat.com>
(I'll defer to Jens and Neil for the block and MD bits)
> diff --git a/drivers/md/dm.c b/drivers/md/dm.c
> index eaa3af0..b55ef95 100644
> --- a/drivers/md/dm.c
> +++ b/drivers/md/dm.c
> @@ -2643,9 +2643,10 @@ int dm_noflush_suspending(struct dm_target *ti)
> }
> EXPORT_SYMBOL_GPL(dm_noflush_suspending);
>
> -struct dm_md_mempools *dm_alloc_md_mempools(unsigned type)
> +struct dm_md_mempools *dm_alloc_md_mempools(unsigned type, unsigned int integrity)
> {
Any reason you didn't just use 'unsigned integrity' like you did below
in the dm.h prototype?
> struct dm_md_mempools *pools = kmalloc(sizeof(*pools), GFP_KERNEL);
> + unsigned int pool_size = (type == DM_TYPE_BIO_BASED) ? 16 : MIN_IOS;
>
> if (!pools)
> return NULL;
> @@ -2662,11 +2663,13 @@ struct dm_md_mempools *dm_alloc_md_mempools(unsigned type)
> if (!pools->tio_pool)
> goto free_io_pool_and_out;
>
> - pools->bs = (type == DM_TYPE_BIO_BASED) ?
> - bioset_create(16, 0) : bioset_create(MIN_IOS, 0);
> + pools->bs = bioset_create(pool_size, 0);
> if (!pools->bs)
> goto free_tio_pool_and_out;
>
> + if (integrity && bioset_integrity_create(pools->bs, pool_size))
> + goto free_tio_pool_and_out;
> +
> return pools;
>
> free_tio_pool_and_out:
Don't you need to bioset_free(pools->bs) if bioset_integrity_create()
fails? So you'd need a new 'free_bioset_and_out' label. Also seems
like maybe you had some extra whitespace on the goto?
> diff --git a/drivers/md/dm.h b/drivers/md/dm.h
> index 0c2dd5f..1aaf167 100644
> --- a/drivers/md/dm.h
> +++ b/drivers/md/dm.h
> @@ -149,7 +149,7 @@ void dm_kcopyd_exit(void);
> /*
> * Mempool operations
> */
> -struct dm_md_mempools *dm_alloc_md_mempools(unsigned type);
> +struct dm_md_mempools *dm_alloc_md_mempools(unsigned type, unsigned integrity);
> void dm_free_md_mempools(struct dm_md_mempools *pools);
>
> #endif
next prev parent reply other threads:[~2011-03-08 17:13 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-28 11:21 mirrored device with thousand of mapping table entries Eli Malul
2011-02-28 11:48 ` Alasdair G Kergon
2011-02-28 11:59 ` mirrored device with thousand of mapping tableentries Eli Malul
2011-02-28 12:11 ` Alasdair G Kergon
2011-02-28 12:17 ` mirrored device with thousand of mappingtableentries Eli Malul
2011-02-28 13:10 ` Alasdair G Kergon
2011-02-28 13:13 ` Eli Malul
2011-02-28 13:29 ` Alasdair G Kergon
2011-02-28 13:42 ` Eli Malul
2011-02-28 16:25 ` Eli Malul
2011-02-28 13:38 ` Zdenek Kabelac
2011-02-28 15:01 ` Martin K. Petersen
2011-03-06 20:39 ` Zdenek Kabelac
2011-03-07 2:59 ` Martin K. Petersen
2011-03-07 14:24 ` Zdenek Kabelac
2011-03-07 16:09 ` Mike Snitzer
2011-03-08 6:51 ` Martin K. Petersen
2011-03-08 17:13 ` Mike Snitzer [this message]
2011-03-10 16:11 ` Martin K. Petersen
2011-03-11 16:53 ` [PATCH] block: Require subsystems to explicitly allocate bio_set integrity mempool (was: Re: mirrored device with thousand of mappingtableentries) Mike Snitzer
2011-03-11 17:11 ` [PATCH] block: Require subsystems to explicitly allocate bio_set integrity mempool Martin K. Petersen
2011-03-07 20:10 ` mirrored device with thousand of mappingtableentries Mike Snitzer
2011-03-07 20:22 ` Martin K. Petersen
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=20110308171322.GB5692@redhat.com \
--to=snitzer@redhat.com \
--cc=dm-devel@redhat.com \
--cc=jaxboe@fusionio.com \
--cc=martin.petersen@oracle.com \
--cc=mkp@mkp.net \
--cc=zkabelac@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.