All of lore.kernel.org
 help / color / mirror / Atom feed
* Why does raid0 set max_hw_sectors as chunk size but the other raid types doesn't?
@ 2016-05-30 11:55 Joey Liao
  2016-06-02  4:38 ` NeilBrown
  0 siblings, 1 reply; 3+ messages in thread
From: Joey Liao @ 2016-05-30 11:55 UTC (permalink / raw)
  To: linux-raid

Hi,

I have no idea why does raid0_run() in raid0.c use
blk_queue_max_hw_sectors() to set max_hw_sectors as the chunk size,
but the other raid types doesn't?

What's the purpose to limit the max_hw_sectors in raid0?

Is it related to the source code logic issue or the performance issue?

Besides, I have an interesting observation. If I remove all the
following queue limitation codes in raid0_run() of raid0.c, the block
size in iostat is still the same as chunk size even the input block
size is much larger than the chunk size. Why???

-  blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors);
-  blk_queue_max_write_same_sectors(mddev->queue, mddev->chunk_sectors);
+  //blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors);
+  //blk_queue_max_write_same_sectors(mddev->queue, mddev->chunk_sectors);

-  blk_queue_io_min(mddev->queue, mddev->chunk_sectors << 9);
-  blk_queue_io_opt(mddev->queue,
-                 (mddev->chunk_sectors << 9) * mddev->raid_disks);
+  //blk_queue_io_min(mddev->queue, mddev->chunk_sectors << 9);
+  /*blk_queue_io_opt(mddev->queue,
+              (mddev->chunk_sectors << 9) * mddev->raid_disks);*/

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

* Re: Why does raid0 set max_hw_sectors as chunk size but the other raid types doesn't?
  2016-05-30 11:55 Why does raid0 set max_hw_sectors as chunk size but the other raid types doesn't? Joey Liao
@ 2016-06-02  4:38 ` NeilBrown
  2016-06-02  9:30   ` Joey Liao
  0 siblings, 1 reply; 3+ messages in thread
From: NeilBrown @ 2016-06-02  4:38 UTC (permalink / raw)
  To: Joey Liao, linux-raid

[-- Attachment #1: Type: text/plain, Size: 2027 bytes --]

On Mon, May 30 2016, Joey Liao wrote:

> Hi,
>
> I have no idea why does raid0_run() in raid0.c use
> blk_queue_max_hw_sectors() to set max_hw_sectors as the chunk size,
> but the other raid types doesn't?

git is your friend.... admittedly you need the 'history' git tree to go
back before 2.6.12, but it is available.

http://git.kernel.org/cgit/linux/kernel/git/history/history.git/commit/?id=f556ef000efc90a45a285f4f0b4fd70bb70f



>
> What's the purpose to limit the max_hw_sectors in raid0?

unfortunately the commit doesn't answer that question.  I think it was
to ensure requests larger than one chunk were not created.  If they were
they would just have to be split, so there is no much to gain.

>
> Is it related to the source code logic issue or the performance issue?
>
> Besides, I have an interesting observation. If I remove all the
> following queue limitation codes in raid0_run() of raid0.c, the block
> size in iostat is still the same as chunk size even the input block
> size is much larger than the chunk size. Why???

Because when you write to a RAID0 you *must* divide each request up into
chunk-sizes sub-requests, and send them to different devices.

NeilBrown


>
> -  blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors);
> -  blk_queue_max_write_same_sectors(mddev->queue, mddev->chunk_sectors);
> +  //blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors);
> +  //blk_queue_max_write_same_sectors(mddev->queue, mddev->chunk_sectors);
>
> -  blk_queue_io_min(mddev->queue, mddev->chunk_sectors << 9);
> -  blk_queue_io_opt(mddev->queue,
> -                 (mddev->chunk_sectors << 9) * mddev->raid_disks);
> +  //blk_queue_io_min(mddev->queue, mddev->chunk_sectors << 9);
> +  /*blk_queue_io_opt(mddev->queue,
> +              (mddev->chunk_sectors << 9) * mddev->raid_disks);*/
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

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

* Re: Why does raid0 set max_hw_sectors as chunk size but the other raid types doesn't?
  2016-06-02  4:38 ` NeilBrown
@ 2016-06-02  9:30   ` Joey Liao
  0 siblings, 0 replies; 3+ messages in thread
From: Joey Liao @ 2016-06-02  9:30 UTC (permalink / raw)
  To: NeilBrown; +Cc: linux-raid

Hi NeilBrown,

Thanks for your kindly reply.

Originally, I doubt that would it affect the performance or not, but I
agree with your point.

Thanks.

2016-06-02 12:38 GMT+08:00 NeilBrown <nfbrown@novell.com>:
> On Mon, May 30 2016, Joey Liao wrote:
>
>> Hi,
>>
>> I have no idea why does raid0_run() in raid0.c use
>> blk_queue_max_hw_sectors() to set max_hw_sectors as the chunk size,
>> but the other raid types doesn't?
>
> git is your friend.... admittedly you need the 'history' git tree to go
> back before 2.6.12, but it is available.
>
> http://git.kernel.org/cgit/linux/kernel/git/history/history.git/commit/?id=f556ef000efc90a45a285f4f0b4fd70bb70f
>
>
>
>>
>> What's the purpose to limit the max_hw_sectors in raid0?
>
> unfortunately the commit doesn't answer that question.  I think it was
> to ensure requests larger than one chunk were not created.  If they were
> they would just have to be split, so there is no much to gain.
>
>>
>> Is it related to the source code logic issue or the performance issue?
>>
>> Besides, I have an interesting observation. If I remove all the
>> following queue limitation codes in raid0_run() of raid0.c, the block
>> size in iostat is still the same as chunk size even the input block
>> size is much larger than the chunk size. Why???
>
> Because when you write to a RAID0 you *must* divide each request up into
> chunk-sizes sub-requests, and send them to different devices.
>
> NeilBrown
>
>
>>
>> -  blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors);
>> -  blk_queue_max_write_same_sectors(mddev->queue, mddev->chunk_sectors);
>> +  //blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors);
>> +  //blk_queue_max_write_same_sectors(mddev->queue, mddev->chunk_sectors);
>>
>> -  blk_queue_io_min(mddev->queue, mddev->chunk_sectors << 9);
>> -  blk_queue_io_opt(mddev->queue,
>> -                 (mddev->chunk_sectors << 9) * mddev->raid_disks);
>> +  //blk_queue_io_min(mddev->queue, mddev->chunk_sectors << 9);
>> +  /*blk_queue_io_opt(mddev->queue,
>> +              (mddev->chunk_sectors << 9) * mddev->raid_disks);*/
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2016-06-02  9:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-30 11:55 Why does raid0 set max_hw_sectors as chunk size but the other raid types doesn't? Joey Liao
2016-06-02  4:38 ` NeilBrown
2016-06-02  9:30   ` Joey Liao

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.