All of lore.kernel.org
 help / color / mirror / Atom feed
* [SPDK] Confusion about in_submit_request for a bdev_io object
@ 2019-08-07 14:55 haris iqbal
  0 siblings, 0 replies; 2+ messages in thread
From: haris iqbal @ 2019-08-07 14:55 UTC (permalink / raw)
  To: spdk

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

Hi,

I was looking into the bdev IO code path, and found this
in_submit_request flag, which seems to have been set every time we do
an IO submission, which makes sense considering the name of the flag.

But, in the function _spdk_bdev_io_submit(), the flag
in_submit_request is being set before the conditional "if" statement,
and depending on the conditions of the statement, it can also call
*_io_complete(). So, should the flag in_submit_request be set to true,
while called the *_io_complete() function here?

Also, can someone shed some more light on the significance of this
in_submit_request flag.

-- 

With regards,

Md Haris Iqbal,
Contact: +91 8861996962

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

* Re: [SPDK] Confusion about in_submit_request for a bdev_io object
@ 2019-08-07 21:59 Harris, James R
  0 siblings, 0 replies; 2+ messages in thread
From: Harris, James R @ 2019-08-07 21:59 UTC (permalink / raw)
  To: spdk

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



On 8/7/19, 8:01 AM, "haris iqbal" <haris.phnx(a)gmail.com> wrote:

    Hi,
    
    I was looking into the bdev IO code path, and found this
    in_submit_request flag, which seems to have been set every time we do
    an IO submission, which makes sense considering the name of the flag.
    
    But, in the function _spdk_bdev_io_submit(), the flag
    in_submit_request is being set before the conditional "if" statement,
    and depending on the conditions of the statement, it can also call
    *_io_complete(). So, should the flag in_submit_request be set to true,
    while called the *_io_complete() function here?
    
    Also, can someone shed some more light on the significance of this
    in_submit_request flag.
    
Hi,

The in_submit_request flag is a way for the completion code to know whether it is running in the context of the original submission.  When it finds this flag set, it will allow the context to unwind before calling the completion routine callback specified by the user.  It does this by sending the current thread a message (see _spdk_bdev_io_complete()).  This ensures that the upper layer does not need to worry about handling the completion callback before the submission function returns.

So based on this, _spdk_bdev_io_submit() must set the flag to true before calling spdk_bdev_io_complete() with FAILED status to ensure that the callback routine isn't called until after the _spdk_bdev_io_submit context completely unwinds.

Regards,

-Jim

    -- 
    
    With regards,
    
    Md Haris Iqbal,
    Contact: +91 8861996962
    _______________________________________________
    SPDK mailing list
    SPDK(a)lists.01.org
    https://lists.01.org/mailman/listinfo/spdk
    


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

end of thread, other threads:[~2019-08-07 21:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-07 14:55 [SPDK] Confusion about in_submit_request for a bdev_io object haris iqbal
2019-08-07 21:59 Harris, James R

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.