• V
    virtiofs: Retry request submission from worker context · a9bfd9dd
    Vivek Goyal 提交于
    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>
    a9bfd9dd
virtio_fs.c 29.7 KB