All of lore.kernel.org
 help / color / mirror / Atom feed
* device mapper target vs personality, how do you decide to pick one or the other?
@ 2014-07-11 21:28 John Utz
  2014-07-11 21:51 ` Mike Snitzer
  2014-07-14 11:25 ` Bryn M. Reeves
  0 siblings, 2 replies; 8+ messages in thread
From: John Utz @ 2014-07-11 21:28 UTC (permalink / raw)
  To: dm-devel@redhat.com

Hi;

having stared at the code associated with these 2 constructs for a while, i cant come up with a clear reason why one would choose one over the other.

having said that, it seems that the personality code is ancestral and is used for the personalities that can be compiled into device mapper and the target code is for newer stuff that is not expected to be compiled into device mapper.

so, based on this speculation, i *think* i should be using the target construct for the new device mapper module that i am currently coding.

am i correct?

tnx!

johnu

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: device mapper target vs personality, how do you decide to pick one or the other?
  2014-07-11 21:28 device mapper target vs personality, how do you decide to pick one or the other? John Utz
@ 2014-07-11 21:51 ` Mike Snitzer
  2014-07-11 21:56   ` John Utz
  2014-07-14 11:25 ` Bryn M. Reeves
  1 sibling, 1 reply; 8+ messages in thread
From: Mike Snitzer @ 2014-07-11 21:51 UTC (permalink / raw)
  To: John Utz; +Cc: dm-devel@redhat.com

On Fri, Jul 11 2014 at  5:28pm -0400,
John Utz <John.Utz@wdc.com> wrote:

> Hi;
> 
> having stared at the code associated with these 2 constructs for a while, i cant come up with a clear reason why one would choose one over the other.
> 
> having said that, it seems that the personality code is ancestral and
> is used for the personalities that can be compiled into device mapper
> and the target code is for newer stuff that is not expected to be
> compiled into device mapper.

Not sure I know what you mean by "personality code" in DM.

> so, based on this speculation, i *think* i should be using the target
> construct for the new device mapper module that i am currently
> coding.
> 
> am i correct?

Probably.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: device mapper target vs personality, how do you decide to pick one or the other?
  2014-07-11 21:51 ` Mike Snitzer
@ 2014-07-11 21:56   ` John Utz
  2014-07-12  0:36     ` Mike Snitzer
  0 siblings, 1 reply; 8+ messages in thread
From: John Utz @ 2014-07-11 21:56 UTC (permalink / raw)
  To: Mike Snitzer; +Cc: dm-devel@redhat.com

Hi Mike

tnx so much for the prompt response! 

sorry i wasnt clear enuf, example of the 'personality code' that i was writing about below.

(and apologies in advance for my outlook web access MUA's lack of appropriate citing technology)
________________________________________
From: Mike Snitzer [snitzer@redhat.com]
Sent: Friday, July 11, 2014 2:51 PM
To: John Utz
Cc: dm-devel@redhat.com
Subject: Re: device mapper target vs personality, how do you decide to pick one or the other?

On Fri, Jul 11 2014 at  5:28pm -0400,
John Utz <John.Utz@wdc.com> wrote:

> Hi;
>
> having stared at the code associated with these 2 constructs for a while, i cant come up with a clear reason why one would choose one over the other.
>
> having said that, it seems that the personality code is ancestral and
> is used for the personalities that can be compiled into device mapper
> and the target code is for newer stuff that is not expected to be
> compiled into device mapper.

Not sure I know what you mean by "personality code" in DM.

FOR EXAMPLE, here is a little bit of linear.c that contains it:

static struct md_personality linear_personality =
{
	.name		= "linear",
	.level		= LEVEL_LINEAR,
	.owner		= THIS_MODULE,
	.make_request	= linear_make_request,
	.run		= linear_run,
	.stop		= linear_stop,
	.status		= linear_status,
	.hot_add_disk	= linear_add,
	.size		= linear_size,
};

static int __init linear_init (void)
{
	return register_md_personality (&linear_personality);
}

static void linear_exit (void)
{
	unregister_md_personality (&linear_personality);
}



> so, based on this speculation, i *think* i should be using the target
> construct for the new device mapper module that i am currently
> coding.
>
> am i correct?

Probably.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: device mapper target vs personality, how do you decide to pick one or the other?
  2014-07-11 21:56   ` John Utz
@ 2014-07-12  0:36     ` Mike Snitzer
  2014-07-14 17:15       ` John Utz
  0 siblings, 1 reply; 8+ messages in thread
From: Mike Snitzer @ 2014-07-12  0:36 UTC (permalink / raw)
  To: John Utz; +Cc: dm-devel@redhat.com

On Fri, Jul 11 2014 at  5:56pm -0400,
John Utz <John.Utz@wdc.com> wrote:

> Hi Mike
> 
> tnx so much for the prompt response! 
> 
> sorry i wasnt clear enuf, example of the 'personality code' that i was
> writing about below.
...
> FOR EXAMPLE, here is a little bit of linear.c that contains it:
> 
> static struct md_personality linear_personality =
> {
> 	.name		= "linear",
> 	.level		= LEVEL_LINEAR,
> 	.owner		= THIS_MODULE,
> 	.make_request	= linear_make_request,
> 	.run		= linear_run,
> 	.stop		= linear_stop,
> 	.status		= linear_status,
> 	.hot_add_disk	= linear_add,
> 	.size		= linear_size,
> };
> 
> static int __init linear_init (void)
> {
> 	return register_md_personality (&linear_personality);
> }
> 
> static void linear_exit (void)
> {
> 	unregister_md_personality (&linear_personality);
> }

The above is MD raid code.  So what you're talking about are the
different MD raid personalities.

> > so, based on this speculation, i *think* i should be using the target
> > construct for the new device mapper module that i am currently
> > coding.
> >
> > am i correct?
> 
> Probably.

The target construct is provided by DM.  You haven;t said what you're
looking to do but if it is remapping IO and has nothing to do with raid
then you'd probably want to develop a new DM target.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: device mapper target vs personality, how do you decide to pick one or the other?
  2014-07-11 21:28 device mapper target vs personality, how do you decide to pick one or the other? John Utz
  2014-07-11 21:51 ` Mike Snitzer
@ 2014-07-14 11:25 ` Bryn M. Reeves
  2014-07-14 17:00   ` John Utz
  1 sibling, 1 reply; 8+ messages in thread
From: Bryn M. Reeves @ 2014-07-14 11:25 UTC (permalink / raw)
  To: device-mapper development

On Fri, Jul 11, 2014 at 09:28:51PM +0000, John Utz wrote:
> having said that, it seems that the personality code is ancestral and is used for the personalities that can be compiled into device mapper and the target code is for newer stuff that is not expected to be compiled into device mapper.

Not really; it's just a bit confusing as two different but closely
related subsystems live in drivers/md. One is 'md', the Linux
multi-devices subsystem. This is the traditional Linux software RAID
subsystem and offers 'personalities' for different RAID levels and other
mapping types (RAID1-6, JBOD/linear, multipath w/on-disk metadata).

The other is 'dm'; the device-mapper. Using dm offers more flexibility
in specifying virtual devices via the table abstraction (which lets you
glue several targets together a bit like the MD linear personality).
Today dm has targets for linear, zero, error, mirror, snapshot (old),
thin provisioning, caching etc. and also exposes the MD RAID
personalities as dm targets (dm-raid.c; not to be confused with the
userspace dmraid utility).

> so, based on this speculation, i *think* i should be using the target construct for the new device mapper module that i am currently coding.

For dm it's always a target: you'd only create a new personality if you
wanted to extend MD's available RAID levels or types.

Regards,
Bryn.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: device mapper target vs personality, how do you decide to pick one or the other?
  2014-07-14 11:25 ` Bryn M. Reeves
@ 2014-07-14 17:00   ` John Utz
  0 siblings, 0 replies; 8+ messages in thread
From: John Utz @ 2014-07-14 17:00 UTC (permalink / raw)
  To: device-mapper development

Bryn;

Thankyou so very much for this answer!

I absolutely failed to understand that these where 2 different subsystems in the same directory, it makes vastly more sense now.

________________________________________
From: dm-devel-bounces@redhat.com [dm-devel-bounces@redhat.com] on behalf of Bryn M. Reeves [bmr@redhat.com]
Sent: Monday, July 14, 2014 4:25 AM
To: device-mapper development
Subject: Re: [dm-devel] device mapper target vs personality, how do you decide to pick one or the other?

On Fri, Jul 11, 2014 at 09:28:51PM +0000, John Utz wrote:
> having said that, it seems that the personality code is ancestral and is used for the personalities that can be compiled into device mapper and the target code is for newer stuff that is not expected to be compiled into device mapper.

Not really; it's just a bit confusing as two different but closely
related subsystems live in drivers/md. One is 'md', the Linux
multi-devices subsystem. This is the traditional Linux software RAID
subsystem and offers 'personalities' for different RAID levels and other
mapping types (RAID1-6, JBOD/linear, multipath w/on-disk metadata).

The other is 'dm'; the device-mapper. Using dm offers more flexibility
in specifying virtual devices via the table abstraction (which lets you
glue several targets together a bit like the MD linear personality).
Today dm has targets for linear, zero, error, mirror, snapshot (old),
thin provisioning, caching etc. and also exposes the MD RAID
personalities as dm targets (dm-raid.c; not to be confused with the
userspace dmraid utility).

> so, based on this speculation, i *think* i should be using the target construct for the new device mapper module that i am currently coding.

For dm it's always a target: you'd only create a new personality if you
wanted to extend MD's available RAID levels or types.

Regards,
Bryn.

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: device mapper target vs personality, how do you decide to pick one or the other?
  2014-07-12  0:36     ` Mike Snitzer
@ 2014-07-14 17:15       ` John Utz
  2014-07-14 22:08         ` John Utz
  0 siblings, 1 reply; 8+ messages in thread
From: John Utz @ 2014-07-14 17:15 UTC (permalink / raw)
  To: Mike Snitzer; +Cc: dm-devel@redhat.com

Thankyou for the further clarification. 

My apologies for not being clear about my end goal. Indeed, I do wish to do remapping because I am coding a ZAC simulator.
________________________________________
From: Mike Snitzer [snitzer@redhat.com]
Sent: Friday, July 11, 2014 5:36 PM
To: John Utz
Cc: dm-devel@redhat.com
Subject: Re: device mapper target vs personality, how do you decide to pick one or the other?

On Fri, Jul 11 2014 at  5:56pm -0400,
John Utz <John.Utz@wdc.com> wrote:

> Hi Mike
>
> tnx so much for the prompt response!
>
> sorry i wasnt clear enuf, example of the 'personality code' that i was
> writing about below.
...
> FOR EXAMPLE, here is a little bit of linear.c that contains it:
>
> static struct md_personality linear_personality =
> {
>       .name           = "linear",
>       .level          = LEVEL_LINEAR,
>       .owner          = THIS_MODULE,
>       .make_request   = linear_make_request,
>       .run            = linear_run,
>       .stop           = linear_stop,
>       .status         = linear_status,
>       .hot_add_disk   = linear_add,
>       .size           = linear_size,
> };
>
> static int __init linear_init (void)
> {
>       return register_md_personality (&linear_personality);
> }
>
> static void linear_exit (void)
> {
>       unregister_md_personality (&linear_personality);
> }

The above is MD raid code.  So what you're talking about are the
different MD raid personalities.

> > so, based on this speculation, i *think* i should be using the target
> > construct for the new device mapper module that i am currently
> > coding.
> >
> > am i correct?
>
> Probably.

The target construct is provided by DM.  You haven;t said what you're
looking to do but if it is remapping IO and has nothing to do with raid
then you'd probably want to develop a new DM target.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: device mapper target vs personality, how do you decide to pick one or the other?
  2014-07-14 17:15       ` John Utz
@ 2014-07-14 22:08         ` John Utz
  0 siblings, 0 replies; 8+ messages in thread
From: John Utz @ 2014-07-14 22:08 UTC (permalink / raw)
  To: device-mapper development, Mike Snitzer

Bryn and Mike Thankyou very much for your help. I have a dm target that now loads when the appropriate arguments are passed to dmcreate.

tnx!

johnu
________________________________________
From: dm-devel-bounces@redhat.com [dm-devel-bounces@redhat.com] on behalf of John Utz [John.Utz@wdc.com]
Sent: Monday, July 14, 2014 10:15 AM
To: Mike Snitzer
Cc: dm-devel@redhat.com
Subject: Re: [dm-devel] device mapper target vs personality, how do you decide to pick one or the other?

Thankyou for the further clarification.

My apologies for not being clear about my end goal. Indeed, I do wish to do remapping because I am coding a ZAC simulator.
________________________________________
From: Mike Snitzer [snitzer@redhat.com]
Sent: Friday, July 11, 2014 5:36 PM
To: John Utz
Cc: dm-devel@redhat.com
Subject: Re: device mapper target vs personality, how do you decide to pick one or the other?

On Fri, Jul 11 2014 at  5:56pm -0400,
John Utz <John.Utz@wdc.com> wrote:

> Hi Mike
>
> tnx so much for the prompt response!
>
> sorry i wasnt clear enuf, example of the 'personality code' that i was
> writing about below.
...
> FOR EXAMPLE, here is a little bit of linear.c that contains it:
>
> static struct md_personality linear_personality =
> {
>       .name           = "linear",
>       .level          = LEVEL_LINEAR,
>       .owner          = THIS_MODULE,
>       .make_request   = linear_make_request,
>       .run            = linear_run,
>       .stop           = linear_stop,
>       .status         = linear_status,
>       .hot_add_disk   = linear_add,
>       .size           = linear_size,
> };
>
> static int __init linear_init (void)
> {
>       return register_md_personality (&linear_personality);
> }
>
> static void linear_exit (void)
> {
>       unregister_md_personality (&linear_personality);
> }

The above is MD raid code.  So what you're talking about are the
different MD raid personalities.

> > so, based on this speculation, i *think* i should be using the target
> > construct for the new device mapper module that i am currently
> > coding.
> >
> > am i correct?
>
> Probably.

The target construct is provided by DM.  You haven;t said what you're
looking to do but if it is remapping IO and has nothing to do with raid
then you'd probably want to develop a new DM target.

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-07-14 22:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-11 21:28 device mapper target vs personality, how do you decide to pick one or the other? John Utz
2014-07-11 21:51 ` Mike Snitzer
2014-07-11 21:56   ` John Utz
2014-07-12  0:36     ` Mike Snitzer
2014-07-14 17:15       ` John Utz
2014-07-14 22:08         ` John Utz
2014-07-14 11:25 ` Bryn M. Reeves
2014-07-14 17:00   ` John Utz

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.