All of lore.kernel.org
 help / color / mirror / Atom feed
* Block layer state diagrams
@ 2016-10-26 20:21 Bart Van Assche
  2016-10-27  5:45 ` Hannes Reinecke
  0 siblings, 1 reply; 6+ messages in thread
From: Bart Van Assche @ 2016-10-26 20:21 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Christoph Hellwig, linux-block@vger.kernel.org

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

Hello Jens,

Some time ago I created the attached state diagrams for myself to avoid 
that I would have to reread the entire block layer core source code if 
it has been a while since I had a look at it. Do you think it would be 
useful to add these diagrams somewhere in the Documentation directory?

Thanks,

Bart.

[-- Attachment #2: block-layer-request-states-mq.dot --]
[-- Type: application/msword-template, Size: 1088 bytes --]

[-- Attachment #3: block-layer-request-states-mq.svg --]
[-- Type: image/svg+xml, Size: 10032 bytes --]

[-- Attachment #4: block-layer-request-states-sq.dot --]
[-- Type: application/msword-template, Size: 1467 bytes --]

[-- Attachment #5: block-layer-request-states-sq.svg --]
[-- Type: image/svg+xml, Size: 13448 bytes --]

[-- Attachment #6: Makefile --]
[-- Type: text/plain, Size: 115 bytes --]

all:	\
	block-layer-request-states-sq.svg \
	block-layer-request-states-mq.svg \

%.svg: %.dot
	dot -Tsvg -o $@ $<

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

* Re: Block layer state diagrams
  2016-10-26 20:21 Block layer state diagrams Bart Van Assche
@ 2016-10-27  5:45 ` Hannes Reinecke
  2016-10-27 22:37   ` Bart Van Assche
  0 siblings, 1 reply; 6+ messages in thread
From: Hannes Reinecke @ 2016-10-27  5:45 UTC (permalink / raw)
  To: Bart Van Assche, Jens Axboe
  Cc: Christoph Hellwig, linux-block@vger.kernel.org

On 10/26/2016 10:21 PM, Bart Van Assche wrote:
> Hello Jens,
> 
> Some time ago I created the attached state diagrams for myself to avoid
> that I would have to reread the entire block layer core source code if
> it has been a while since I had a look at it. Do you think it would be
> useful to add these diagrams somewhere in the Documentation directory?
> 
Can you add a step for the mapping between software and
hardware queues?
Also the actual submission to the LLDD (in step 'executing') could do
with a bit more emphasis.
And maybe the fontsize could be a tad smaller; currently it's hard to
figure out which label goes where, expecially in the bottom half.

Otherwise looking good.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

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

* Re: Block layer state diagrams
  2016-10-27  5:45 ` Hannes Reinecke
@ 2016-10-27 22:37   ` Bart Van Assche
  2016-10-28 15:45     ` Jens Axboe
  0 siblings, 1 reply; 6+ messages in thread
From: Bart Van Assche @ 2016-10-27 22:37 UTC (permalink / raw)
  To: Hannes Reinecke, Jens Axboe
  Cc: Christoph Hellwig, linux-block@vger.kernel.org

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

On 10/26/2016 10:45 PM, Hannes Reinecke wrote:
> On 10/26/2016 10:21 PM, Bart Van Assche wrote:
>> Some time ago I created the attached state diagrams for myself to avoid
>> that I would have to reread the entire block layer core source code if
>> it has been a while since I had a look at it. Do you think it would be
>> useful to add these diagrams somewhere in the Documentation directory?
>>
> Can you add a step for the mapping between software and
> hardware queues?
> Also the actual submission to the LLDD (in step 'executing') could do
> with a bit more emphasis.
> And maybe the fontsize could be a tad smaller; currently it's hard to
> figure out which label goes where, expecially in the bottom half.

Thanks Hannes for the review. How about the attached second version of 
these diagrams?

Bart.

[-- Attachment #2: block-layer-request-states-mq.dot --]
[-- Type: application/msword-template, Size: 1779 bytes --]

[-- Attachment #3: block-layer-request-states-mq.svg --]
[-- Type: image/svg+xml, Size: 15935 bytes --]

[-- Attachment #4: block-layer-request-states-sq.dot --]
[-- Type: application/msword-template, Size: 1927 bytes --]

[-- Attachment #5: block-layer-request-states-sq.svg --]
[-- Type: image/svg+xml, Size: 16216 bytes --]

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

* Re: Block layer state diagrams
  2016-10-27 22:37   ` Bart Van Assche
@ 2016-10-28 15:45     ` Jens Axboe
  2016-10-28 16:06       ` Bart Van Assche
  0 siblings, 1 reply; 6+ messages in thread
From: Jens Axboe @ 2016-10-28 15:45 UTC (permalink / raw)
  To: Bart Van Assche, Hannes Reinecke
  Cc: Christoph Hellwig, linux-block@vger.kernel.org

On 10/27/2016 04:37 PM, Bart Van Assche wrote:
> On 10/26/2016 10:45 PM, Hannes Reinecke wrote:
>> On 10/26/2016 10:21 PM, Bart Van Assche wrote:
>>> Some time ago I created the attached state diagrams for myself to avoid
>>> that I would have to reread the entire block layer core source code if
>>> it has been a while since I had a look at it. Do you think it would be
>>> useful to add these diagrams somewhere in the Documentation directory?
>>>
>> Can you add a step for the mapping between software and
>> hardware queues?
>> Also the actual submission to the LLDD (in step 'executing') could do
>> with a bit more emphasis.
>> And maybe the fontsize could be a tad smaller; currently it's hard to
>> figure out which label goes where, expecially in the bottom half.
>
> Thanks Hannes for the review. How about the attached second version of
> these diagrams?

I think they are a little confusing. Some of it is specific to non-fs
requests, yet you have the plugging path in there as well. Was the
intent to just show the PC path?

-- 
Jens Axboe


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

* Re: Block layer state diagrams
  2016-10-28 15:45     ` Jens Axboe
@ 2016-10-28 16:06       ` Bart Van Assche
  2016-10-28 16:24         ` Jens Axboe
  0 siblings, 1 reply; 6+ messages in thread
From: Bart Van Assche @ 2016-10-28 16:06 UTC (permalink / raw)
  To: hare@suse.de, axboe@fb.com; +Cc: hch@lst.de, linux-block@vger.kernel.org

T24gRnJpLCAyMDE2LTEwLTI4IGF0IDA5OjQ1IC0wNjAwLCBKZW5zIEF4Ym9lIHdyb3RlOg0KPiBP
biAxMC8yNy8yMDE2IDA0OjM3IFBNLCBCYXJ0IFZhbiBBc3NjaGUgd3JvdGU6DQo+ID4gT24gMTAv
MjYvMjAxNiAxMDo0NSBQTSwgSGFubmVzIFJlaW5lY2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
YW1zIG1ha2UgZS5nLiBjbGVhciB3aGVuIGl0IGlzDQphbGxvd2VkIHRvIGNhbGwgYmxrX3N0YXJ0
X3JlcXVlc3QoKSBhbmQgd2hlbiB0aGF0IGl0IGlzIG5vdCBhbGxvd2VkLg0KDQpUaGFua3MsDQoN
CkJhcnQu

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

* Re: Block layer state diagrams
  2016-10-28 16:06       ` Bart Van Assche
@ 2016-10-28 16:24         ` Jens Axboe
  0 siblings, 0 replies; 6+ messages in thread
From: Jens Axboe @ 2016-10-28 16:24 UTC (permalink / raw)
  To: Bart Van Assche, hare@suse.de; +Cc: hch@lst.de, linux-block@vger.kernel.org

On 10/28/2016 10:06 AM, Bart Van Assche wrote:
> On Fri, 2016-10-28 at 09:45 -0600, Jens Axboe wrote:
>> On 10/27/2016 04:37 PM, Bart Van Assche wrote:
>>> On 10/26/2016 10:45 PM, Hannes Reinecke wrote:
>>>> On 10/26/2016 10:21 PM, Bart Van Assche wrote:
>>>>> Some time ago I created the attached state diagrams for myself
>>>>> to avoid
>>>>> that I would have to reread the entire block layer core source
>>>>> code if
>>>>> it has been a while since I had a look at it. Do you think it
>>>>> would be
>>>>> useful to add these diagrams somewhere in the Documentation
>>>>> directory?
>>>>>
>>>>
>>>> Can you add a step for the mapping between software and
>>>> hardware queues?
>>>> Also the actual submission to the LLDD (in step 'executing')
>>>> could do
>>>> with a bit more emphasis.
>>>> And maybe the fontsize could be a tad smaller; currently it's
>>>> hard to
>>>> figure out which label goes where, expecially in the bottom half.
>>>
>>> Thanks Hannes for the review. How about the attached second version
>>> of
>>> these diagrams?
>>
>> I think they are a little confusing. Some of it is specific to non-fs
>> requests, yet you have the plugging path in there as well. Was the
>> intent to just show the PC path?
>
> Hello Jens,
>
> As far as I know there is no documentation yet in the kernel tree
> (other than the block layer source code) of how the different block
> layer functions affect the request state. Several kernel developers
> seem not to be aware of when it is allowed to call which block layer
> function. See e.g. "Re: [PATCH v2 1/2] scsi: Handle Unit Attention when
> issuing SCSI command" (http://www.spinics.net/lists/linux-scsi/msg10073
> 7.html) for an example. These diagrams make e.g. clear when it is
> allowed to call blk_start_request() and when that it is not allowed.

Don't get me wrong, I think it would be great to have some graphic
documentation of the flow. But I think it should be clear about what it
is showing, not just some of it. Otherwise it'll just cause people to
get confused.

-- 
Jens Axboe

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

end of thread, other threads:[~2016-10-28 16:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-26 20:21 Block layer state diagrams Bart Van Assche
2016-10-27  5:45 ` Hannes Reinecke
2016-10-27 22:37   ` Bart Van Assche
2016-10-28 15:45     ` Jens Axboe
2016-10-28 16:06       ` Bart Van Assche
2016-10-28 16:24         ` Jens Axboe

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.