linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] md/md-linear: Enable atomic writes
@ 2025-09-03 16:10 John Garry
  2025-09-05  9:02 ` Yu Kuai
  0 siblings, 1 reply; 7+ messages in thread
From: John Garry @ 2025-09-03 16:10 UTC (permalink / raw)
  To: song, yukuai3; +Cc: linux-raid, linux-kernel, martin.petersen, John Garry

All the infrastructure has already been plumbed to support this for
stacked devices, so just enable the request_queue limits features flag.

A note about chunk sectors for linear arrays:
While it is possible to set a chunk sectors param for building a linear
array, this is for specifying the granularity at which data sectors from
the device are used. It is not the same as a stripe size, like for RAID0. 

As such, it is not appropriate to set chunk_sectors request queue limit to
the same value, as chunk_sectors request limit is a boundary for which
requests cannot straddle.

However, request_queue limit max_hw_sectors is set to chunk sectors, which
almost has the same effect as setting chunk_sectors limit.

Signed-off-by: John Garry <john.g.garry@oracle.com>

diff --git a/drivers/md/md-linear.c b/drivers/md/md-linear.c
index 5d9b081153757..30ac29b990c9b 100644
--- a/drivers/md/md-linear.c
+++ b/drivers/md/md-linear.c
@@ -74,6 +74,7 @@ static int linear_set_limits(struct mddev *mddev)
 	lim.max_hw_sectors = mddev->chunk_sectors;
 	lim.max_write_zeroes_sectors = mddev->chunk_sectors;
 	lim.io_min = mddev->chunk_sectors << 9;
+	lim.features |= BLK_FEAT_ATOMIC_WRITES;
 	err = mddev_stack_rdev_limits(mddev, &lim, MDDEV_STACK_INTEGRITY);
 	if (err)
 		return err;
-- 
2.43.5


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

* Re: [PATCH] md/md-linear: Enable atomic writes
  2025-09-03 16:10 [PATCH] md/md-linear: Enable atomic writes John Garry
@ 2025-09-05  9:02 ` Yu Kuai
  2025-09-23  8:21   ` John Garry
  0 siblings, 1 reply; 7+ messages in thread
From: Yu Kuai @ 2025-09-05  9:02 UTC (permalink / raw)
  To: John Garry, song; +Cc: linux-raid, linux-kernel, martin.petersen, yukuai (C)

在 2025/09/04 0:10, John Garry 写道:
> All the infrastructure has already been plumbed to support this for
> stacked devices, so just enable the request_queue limits features flag.
> 
> A note about chunk sectors for linear arrays:
> While it is possible to set a chunk sectors param for building a linear
> array, this is for specifying the granularity at which data sectors from
> the device are used. It is not the same as a stripe size, like for RAID0.
> 
> As such, it is not appropriate to set chunk_sectors request queue limit to
> the same value, as chunk_sectors request limit is a boundary for which
> requests cannot straddle.
> 
> However, request_queue limit max_hw_sectors is set to chunk sectors, which
> almost has the same effect as setting chunk_sectors limit.
> 
> Signed-off-by: John Garry <john.g.garry@oracle.com>
> 
> diff --git a/drivers/md/md-linear.c b/drivers/md/md-linear.c
> index 5d9b081153757..30ac29b990c9b 100644
> --- a/drivers/md/md-linear.c
> +++ b/drivers/md/md-linear.c
> @@ -74,6 +74,7 @@ static int linear_set_limits(struct mddev *mddev)
>   	lim.max_hw_sectors = mddev->chunk_sectors;
>   	lim.max_write_zeroes_sectors = mddev->chunk_sectors;
>   	lim.io_min = mddev->chunk_sectors << 9;
> +	lim.features |= BLK_FEAT_ATOMIC_WRITES;
>   	err = mddev_stack_rdev_limits(mddev, &lim, MDDEV_STACK_INTEGRITY);
>   	if (err)
>   		return err;
> 

LGRM
Reviewed-by: Yu Kuai <yukuai3@huawei.com>


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

* Re: [PATCH] md/md-linear: Enable atomic writes
  2025-09-05  9:02 ` Yu Kuai
@ 2025-09-23  8:21   ` John Garry
  2025-09-23  9:10     ` Yu Kuai
  0 siblings, 1 reply; 7+ messages in thread
From: John Garry @ 2025-09-23  8:21 UTC (permalink / raw)
  To: Yu Kuai, song; +Cc: linux-raid, linux-kernel, martin.petersen, yukuai (C)

On 05/09/2025 10:02, Yu Kuai wrote:
> 在 2025/09/04 0:10, John Garry 写道:
>> All the infrastructure has already been plumbed to support this for
>> stacked devices, so just enable the request_queue limits features flag.
>>
>> A note about chunk sectors for linear arrays:
>> While it is possible to set a chunk sectors param for building a linear
>> array, this is for specifying the granularity at which data sectors from
>> the device are used. It is not the same as a stripe size, like for RAID0.
>>
>> As such, it is not appropriate to set chunk_sectors request queue 
>> limit to
>> the same value, as chunk_sectors request limit is a boundary for which
>> requests cannot straddle.
>>
>> However, request_queue limit max_hw_sectors is set to chunk sectors, 
>> which
>> almost has the same effect as setting chunk_sectors limit.
>>
>> Signed-off-by: John Garry <john.g.garry@oracle.com>
>>
>> diff --git a/drivers/md/md-linear.c b/drivers/md/md-linear.c
>> index 5d9b081153757..30ac29b990c9b 100644
>> --- a/drivers/md/md-linear.c
>> +++ b/drivers/md/md-linear.c
>> @@ -74,6 +74,7 @@ static int linear_set_limits(struct mddev *mddev)
>>       lim.max_hw_sectors = mddev->chunk_sectors;
>>       lim.max_write_zeroes_sectors = mddev->chunk_sectors;
>>       lim.io_min = mddev->chunk_sectors << 9;
>> +    lim.features |= BLK_FEAT_ATOMIC_WRITES;
>>       err = mddev_stack_rdev_limits(mddev, &lim, MDDEV_STACK_INTEGRITY);
>>       if (err)
>>           return err;
>>
> 
> LGRM
> Reviewed-by: Yu Kuai <yukuai3@huawei.com>
> 

thanks

Could I have this picked up now? Maybe it was missed.

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

* Re: [PATCH] md/md-linear: Enable atomic writes
  2025-09-23  8:21   ` John Garry
@ 2025-09-23  9:10     ` Yu Kuai
  2025-10-20 13:48       ` John Garry
  0 siblings, 1 reply; 7+ messages in thread
From: Yu Kuai @ 2025-09-23  9:10 UTC (permalink / raw)
  To: John Garry, Yu Kuai, song
  Cc: linux-raid, linux-kernel, martin.petersen, yukuai (C)

Hi,

在 2025/09/23 16:21, John Garry 写道:
> On 05/09/2025 10:02, Yu Kuai wrote:
>> 在 2025/09/04 0:10, John Garry 写道:
>>> All the infrastructure has already been plumbed to support this for
>>> stacked devices, so just enable the request_queue limits features flag.
>>>
>>> A note about chunk sectors for linear arrays:
>>> While it is possible to set a chunk sectors param for building a linear
>>> array, this is for specifying the granularity at which data sectors from
>>> the device are used. It is not the same as a stripe size, like for 
>>> RAID0.
>>>
>>> As such, it is not appropriate to set chunk_sectors request queue 
>>> limit to
>>> the same value, as chunk_sectors request limit is a boundary for which
>>> requests cannot straddle.
>>>
>>> However, request_queue limit max_hw_sectors is set to chunk sectors, 
>>> which
>>> almost has the same effect as setting chunk_sectors limit.
>>>
>>> Signed-off-by: John Garry <john.g.garry@oracle.com>
>>>
>>> diff --git a/drivers/md/md-linear.c b/drivers/md/md-linear.c
>>> index 5d9b081153757..30ac29b990c9b 100644
>>> --- a/drivers/md/md-linear.c
>>> +++ b/drivers/md/md-linear.c
>>> @@ -74,6 +74,7 @@ static int linear_set_limits(struct mddev *mddev)
>>>       lim.max_hw_sectors = mddev->chunk_sectors;
>>>       lim.max_write_zeroes_sectors = mddev->chunk_sectors;
>>>       lim.io_min = mddev->chunk_sectors << 9;
>>> +    lim.features |= BLK_FEAT_ATOMIC_WRITES;
>>>       err = mddev_stack_rdev_limits(mddev, &lim, MDDEV_STACK_INTEGRITY);
>>>       if (err)
>>>           return err;
>>>
>>
>> LGRM
>> Reviewed-by: Yu Kuai <yukuai3@huawei.com>
>>
> 
> thanks
> 
> Could I have this picked up now? Maybe it was missed.
> 
Already picked last weekend, sorry that I forgot to reply.

https://git.kernel.org/pub/scm/linux/kernel/git/mdraid/linux.git/commit/?h=md-6.18&id=b481e72d24feac15017b579232370aa4b33d4129

Thanks,
Kuai
> .
> 


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

* Re: [PATCH] md/md-linear: Enable atomic writes
  2025-09-23  9:10     ` Yu Kuai
@ 2025-10-20 13:48       ` John Garry
  2025-10-21 12:06         ` Yu Kuai
  0 siblings, 1 reply; 7+ messages in thread
From: John Garry @ 2025-10-20 13:48 UTC (permalink / raw)
  To: Yu Kuai, song; +Cc: linux-raid, linux-kernel, martin.petersen, yukuai (C)

On 23/09/2025 10:10, Yu Kuai wrote:
>> Could I have this picked up now? Maybe it was missed.
>>
> Already picked last weekend, sorry that I forgot to reply.
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/mdraid/linux.git/ 
> commit/?h=md-6.18&id=b481e72d24feac15017b579232370aa4b33d4129

This does not look like to being it into v6.18-rc - was it missed?

Thanks,
John

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

* Re: [PATCH] md/md-linear: Enable atomic writes
  2025-10-20 13:48       ` John Garry
@ 2025-10-21 12:06         ` Yu Kuai
  2025-10-21 12:32           ` John Garry
  0 siblings, 1 reply; 7+ messages in thread
From: Yu Kuai @ 2025-10-21 12:06 UTC (permalink / raw)
  To: John Garry, Yu Kuai, song
  Cc: linux-raid, linux-kernel, martin.petersen, yukuai (C)

Hi,

在 2025/10/20 21:48, John Garry 写道:
> On 23/09/2025 10:10, Yu Kuai wrote:
>>> Could I have this picked up now? Maybe it was missed.
>>>
>> Already picked last weekend, sorry that I forgot to reply.
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/mdraid/linux.git/ 
>> commit/?h=md-6.18&id=b481e72d24feac15017b579232370aa4b33d4129
>
> This does not look like to being it into v6.18-rc - was it missed?
>
Yeah, a few patches is not pushed to v6.18-rc, because I was switching job and the
old email yukuai3@huawei.com is not used anymore. If you don't mind, I'll rebase with
my new mail address and push to for-6.19/block later.

Thanks,
Kuai

> Thanks,
> John
>

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

* Re: [PATCH] md/md-linear: Enable atomic writes
  2025-10-21 12:06         ` Yu Kuai
@ 2025-10-21 12:32           ` John Garry
  0 siblings, 0 replies; 7+ messages in thread
From: John Garry @ 2025-10-21 12:32 UTC (permalink / raw)
  To: yukuai, Yu Kuai, song
  Cc: linux-raid, linux-kernel, martin.petersen, yukuai (C)

On 21/10/2025 13:06, Yu Kuai wrote:
>>> https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/ 
>>> kernel/git/mdraid/linux.git/__;!!ACWV5N9M2RV99hQ! 
>>> PjpAiklrZ2jXVm26MVHBqbH9IDHG-09hkOGCPfhhjaY_LmpE8adnn00dWKuC3TX8flblYA2DICgZeSY_$  
>>> commit/?h=md-6.18&id=b481e72d24feac15017b579232370aa4b33d4129
>> This does not look like to being it into v6.18-rc - was it missed?
>>
> Yeah, a few patches is not pushed to v6.18-rc, because I was switching job and the
> old emailyukuai3@huawei.com is not used anymore. If you don't mind, I'll rebase with
> my new mail address and push to for-6.19/block later.

thanks for letting me know

I'll keep an eye out for pull requests to Jens at the end of the dev cycle

john

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

end of thread, other threads:[~2025-10-21 12:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-03 16:10 [PATCH] md/md-linear: Enable atomic writes John Garry
2025-09-05  9:02 ` Yu Kuai
2025-09-23  8:21   ` John Garry
2025-09-23  9:10     ` Yu Kuai
2025-10-20 13:48       ` John Garry
2025-10-21 12:06         ` Yu Kuai
2025-10-21 12:32           ` John Garry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).