diff mbox series

[v2] dm: add support for DM_TARGET_NOWAIT for various targets

Message ID 20201113020551.55716-1-jefflexu@linux.alibaba.com (mailing list archive)
State Accepted, archived
Delegated to: Mike Snitzer
Headers show
Series [v2] dm: add support for DM_TARGET_NOWAIT for various targets | expand

Commit Message

Jingbo Xu Nov. 13, 2020, 2:05 a.m. UTC
commit 021a24460dc2 ("block: add QUEUE_FLAG_NOWAIT") adds a new queue
flag QUEUE_FLAG_NOWAIT to advertise if the bdev supports handling of
REQ_NOWAIT or not. DM core supports this in commit 6abc49468eea ("dm:
add support for REQ_NOWAIT and enable it for linear target"), in which
only dm-linear is enabled.

This patch also enables several dm-linear likely dm targets, the mapping
algorithm of which is just simple remapping.

Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
---
 drivers/md/dm-stripe.c   | 2 +-
 drivers/md/dm-switch.c   | 1 +
 drivers/md/dm-unstripe.c | 1 +
 drivers/md/dm-zero.c     | 1 +
 4 files changed, 4 insertions(+), 1 deletion(-)

Comments

Jingbo Xu Nov. 18, 2020, 2:01 a.m. UTC | #1
Hi Mike,

How about this patch? I just tweaks the commit message in this v2 patch 
to make

the purpose clearer, while keep the code unstained.


Thanks,

Jeffle


On 11/13/20 10:05 AM, Jeffle Xu wrote:
> commit 021a24460dc2 ("block: add QUEUE_FLAG_NOWAIT") adds a new queue
> flag QUEUE_FLAG_NOWAIT to advertise if the bdev supports handling of
> REQ_NOWAIT or not. DM core supports this in commit 6abc49468eea ("dm:
> add support for REQ_NOWAIT and enable it for linear target"), in which
> only dm-linear is enabled.
>
> This patch also enables several dm-linear likely dm targets, the mapping
> algorithm of which is just simple remapping.
>
> Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
> ---
>   drivers/md/dm-stripe.c   | 2 +-
>   drivers/md/dm-switch.c   | 1 +
>   drivers/md/dm-unstripe.c | 1 +
>   drivers/md/dm-zero.c     | 1 +
>   4 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c
> index 151d022b032d..df359d33cda8 100644
> --- a/drivers/md/dm-stripe.c
> +++ b/drivers/md/dm-stripe.c
> @@ -496,7 +496,7 @@ static void stripe_io_hints(struct dm_target *ti,
>   static struct target_type stripe_target = {
>   	.name   = "striped",
>   	.version = {1, 6, 0},
> -	.features = DM_TARGET_PASSES_INTEGRITY,
> +	.features = DM_TARGET_PASSES_INTEGRITY | DM_TARGET_NOWAIT,
>   	.module = THIS_MODULE,
>   	.ctr    = stripe_ctr,
>   	.dtr    = stripe_dtr,
> diff --git a/drivers/md/dm-switch.c b/drivers/md/dm-switch.c
> index bff4c7fa1cd2..262e2b0fd975 100644
> --- a/drivers/md/dm-switch.c
> +++ b/drivers/md/dm-switch.c
> @@ -550,6 +550,7 @@ static int switch_iterate_devices(struct dm_target *ti,
>   static struct target_type switch_target = {
>   	.name = "switch",
>   	.version = {1, 1, 0},
> +	.features = DM_TARGET_NOWAIT,
>   	.module = THIS_MODULE,
>   	.ctr = switch_ctr,
>   	.dtr = switch_dtr,
> diff --git a/drivers/md/dm-unstripe.c b/drivers/md/dm-unstripe.c
> index e673dacf6418..7357c1bd5863 100644
> --- a/drivers/md/dm-unstripe.c
> +++ b/drivers/md/dm-unstripe.c
> @@ -178,6 +178,7 @@ static void unstripe_io_hints(struct dm_target *ti,
>   static struct target_type unstripe_target = {
>   	.name = "unstriped",
>   	.version = {1, 1, 0},
> +	.features = DM_TARGET_NOWAIT,
>   	.module = THIS_MODULE,
>   	.ctr = unstripe_ctr,
>   	.dtr = unstripe_dtr,
> diff --git a/drivers/md/dm-zero.c b/drivers/md/dm-zero.c
> index b65ca8dcfbdc..faa1dbffc8b4 100644
> --- a/drivers/md/dm-zero.c
> +++ b/drivers/md/dm-zero.c
> @@ -59,6 +59,7 @@ static int zero_map(struct dm_target *ti, struct bio *bio)
>   static struct target_type zero_target = {
>   	.name   = "zero",
>   	.version = {1, 1, 0},
> +	.features = DM_TARGET_NOWAIT,
>   	.module = THIS_MODULE,
>   	.ctr    = zero_ctr,
>   	.map    = zero_map,
Mike Snitzer Nov. 18, 2020, 3:38 p.m. UTC | #2
I just staged this for 5.11, see:
https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=dm-5.11&id=373ce365b756bf6fec237461a0bbe65f33f201f6

I tweaked your patch header just a bit.

Thanks,
Mike


On Tue, Nov 17 2020 at  9:01pm -0500,
JeffleXu <jefflexu@linux.alibaba.com> wrote:

> Hi Mike,
> 
> How about this patch? I just tweaks the commit message in this v2
> patch to make
> 
> the purpose clearer, while keep the code unstained.
> 
> 
> Thanks,
> 
> Jeffle
> 
> 
> On 11/13/20 10:05 AM, Jeffle Xu wrote:
> >commit 021a24460dc2 ("block: add QUEUE_FLAG_NOWAIT") adds a new queue
> >flag QUEUE_FLAG_NOWAIT to advertise if the bdev supports handling of
> >REQ_NOWAIT or not. DM core supports this in commit 6abc49468eea ("dm:
> >add support for REQ_NOWAIT and enable it for linear target"), in which
> >only dm-linear is enabled.
> >
> >This patch also enables several dm-linear likely dm targets, the mapping
> >algorithm of which is just simple remapping.
> >
> >Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
> >---
> >  drivers/md/dm-stripe.c   | 2 +-
> >  drivers/md/dm-switch.c   | 1 +
> >  drivers/md/dm-unstripe.c | 1 +
> >  drivers/md/dm-zero.c     | 1 +
> >  4 files changed, 4 insertions(+), 1 deletion(-)
> >
> >diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c
> >index 151d022b032d..df359d33cda8 100644
> >--- a/drivers/md/dm-stripe.c
> >+++ b/drivers/md/dm-stripe.c
> >@@ -496,7 +496,7 @@ static void stripe_io_hints(struct dm_target *ti,
> >  static struct target_type stripe_target = {
> >  	.name   = "striped",
> >  	.version = {1, 6, 0},
> >-	.features = DM_TARGET_PASSES_INTEGRITY,
> >+	.features = DM_TARGET_PASSES_INTEGRITY | DM_TARGET_NOWAIT,
> >  	.module = THIS_MODULE,
> >  	.ctr    = stripe_ctr,
> >  	.dtr    = stripe_dtr,
> >diff --git a/drivers/md/dm-switch.c b/drivers/md/dm-switch.c
> >index bff4c7fa1cd2..262e2b0fd975 100644
> >--- a/drivers/md/dm-switch.c
> >+++ b/drivers/md/dm-switch.c
> >@@ -550,6 +550,7 @@ static int switch_iterate_devices(struct dm_target *ti,
> >  static struct target_type switch_target = {
> >  	.name = "switch",
> >  	.version = {1, 1, 0},
> >+	.features = DM_TARGET_NOWAIT,
> >  	.module = THIS_MODULE,
> >  	.ctr = switch_ctr,
> >  	.dtr = switch_dtr,
> >diff --git a/drivers/md/dm-unstripe.c b/drivers/md/dm-unstripe.c
> >index e673dacf6418..7357c1bd5863 100644
> >--- a/drivers/md/dm-unstripe.c
> >+++ b/drivers/md/dm-unstripe.c
> >@@ -178,6 +178,7 @@ static void unstripe_io_hints(struct dm_target *ti,
> >  static struct target_type unstripe_target = {
> >  	.name = "unstriped",
> >  	.version = {1, 1, 0},
> >+	.features = DM_TARGET_NOWAIT,
> >  	.module = THIS_MODULE,
> >  	.ctr = unstripe_ctr,
> >  	.dtr = unstripe_dtr,
> >diff --git a/drivers/md/dm-zero.c b/drivers/md/dm-zero.c
> >index b65ca8dcfbdc..faa1dbffc8b4 100644
> >--- a/drivers/md/dm-zero.c
> >+++ b/drivers/md/dm-zero.c
> >@@ -59,6 +59,7 @@ static int zero_map(struct dm_target *ti, struct bio *bio)
> >  static struct target_type zero_target = {
> >  	.name   = "zero",
> >  	.version = {1, 1, 0},
> >+	.features = DM_TARGET_NOWAIT,
> >  	.module = THIS_MODULE,
> >  	.ctr    = zero_ctr,
> >  	.map    = zero_map,
> 
> -- 
> Thanks,
> Jeffle
> 

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

Patch

diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c
index 151d022b032d..df359d33cda8 100644
--- a/drivers/md/dm-stripe.c
+++ b/drivers/md/dm-stripe.c
@@ -496,7 +496,7 @@  static void stripe_io_hints(struct dm_target *ti,
 static struct target_type stripe_target = {
 	.name   = "striped",
 	.version = {1, 6, 0},
-	.features = DM_TARGET_PASSES_INTEGRITY,
+	.features = DM_TARGET_PASSES_INTEGRITY | DM_TARGET_NOWAIT,
 	.module = THIS_MODULE,
 	.ctr    = stripe_ctr,
 	.dtr    = stripe_dtr,
diff --git a/drivers/md/dm-switch.c b/drivers/md/dm-switch.c
index bff4c7fa1cd2..262e2b0fd975 100644
--- a/drivers/md/dm-switch.c
+++ b/drivers/md/dm-switch.c
@@ -550,6 +550,7 @@  static int switch_iterate_devices(struct dm_target *ti,
 static struct target_type switch_target = {
 	.name = "switch",
 	.version = {1, 1, 0},
+	.features = DM_TARGET_NOWAIT,
 	.module = THIS_MODULE,
 	.ctr = switch_ctr,
 	.dtr = switch_dtr,
diff --git a/drivers/md/dm-unstripe.c b/drivers/md/dm-unstripe.c
index e673dacf6418..7357c1bd5863 100644
--- a/drivers/md/dm-unstripe.c
+++ b/drivers/md/dm-unstripe.c
@@ -178,6 +178,7 @@  static void unstripe_io_hints(struct dm_target *ti,
 static struct target_type unstripe_target = {
 	.name = "unstriped",
 	.version = {1, 1, 0},
+	.features = DM_TARGET_NOWAIT,
 	.module = THIS_MODULE,
 	.ctr = unstripe_ctr,
 	.dtr = unstripe_dtr,
diff --git a/drivers/md/dm-zero.c b/drivers/md/dm-zero.c
index b65ca8dcfbdc..faa1dbffc8b4 100644
--- a/drivers/md/dm-zero.c
+++ b/drivers/md/dm-zero.c
@@ -59,6 +59,7 @@  static int zero_map(struct dm_target *ti, struct bio *bio)
 static struct target_type zero_target = {
 	.name   = "zero",
 	.version = {1, 1, 0},
+	.features = DM_TARGET_NOWAIT,
 	.module = THIS_MODULE,
 	.ctr    = zero_ctr,
 	.map    = zero_map,