• V
    virtiofs: Retry request submission from worker context · 986957da
    Vivek Goyal 提交于
    task #28910367
    commit a9bfd9dd3417561d06c81de04f6d6c1e0c9b3d44 upstream
    
    If regular request queue gets full, currently we sleep for a bit and
    retrying submission in submitter's context. This assumes submitter is not
    holding any spin lock. But this assumption is not true for background
    requests. For background requests, we are called with fc->bg_lock held.
    
    This can lead to deadlock where one thread is trying submission with
    fc->bg_lock held while request completion thread has called
    fuse_request_end() which tries to acquire fc->bg_lock and gets blocked. As
    request completion thread gets blocked, it does not make further progress
    and that means queue does not get empty and submitter can't submit more
    requests.
    
    To solve this issue, retry submission with the help of a worker, instead of
    retrying in submitter's context. We already do this for hiprio/forget
    requests.
    Reported-by: NChirantan Ekbote <chirantan@chromium.org>
    Signed-off-by: NVivek Goyal <vgoyal@redhat.com>
    Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
    (cherry picked from commit a9bfd9dd3417561d06c81de04f6d6c1e0c9b3d44)
    Signed-off-by: NLiu Bo <bo.liu@linux.alibaba.com>
    Reviewed-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
    986957da
virtio_fs.c 28.0 KB