Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5361225ybv; Mon, 17 Feb 2020 18:21:50 -0800 (PST) X-Google-Smtp-Source: APXvYqxa3DsFsf3wd17r89ShanxI0nUcgJS4uzWlWqY97LG3bODPq7g/+whyFhBc8v4UDms0z/6g X-Received: by 2002:a05:6808:b15:: with SMTP id s21mr1150893oij.123.1581992510092; Mon, 17 Feb 2020 18:21:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581992510; cv=none; d=google.com; s=arc-20160816; b=ytroBDBJFvNFd9faMmnqdG/GypSlpzeCznTvPAbyKSTW+TyS+GvdfSG49tSES93qR/ gyAWLvGOm5zTqWruFYi7Pxoh37lt97fNI9oEr74cm6RngWxChIqjtbfSfSxIFewd216D xAFsQRXrIofmGyNjKTZ3wE6VW37cT8MMHYE1WX6leYxu7B/dHHKnMup9CLFlwm+Ex7ry cFV4M5IleU6nxi3PKMMYSKeAojWM23AfgC1/wMQ3P2Z6UswCV+rtm8495J7QWeZxA+uB Gez3O2wy+kG5isRk27VbLEig4Qij35jaE3G5XW4cs8D1jgFHZjqGDOHealNwvRl9A7Uq zWug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=eY7gqSVNopqtgZAFLrrVT+eoXLnh2uTk4VjIyhxxVUI=; b=gSkTT+iYhu35lsPfw4mrRcRSetxuWsfFcfU5J+k9bH2Uo6wpb4Br3dynDxT60SweK1 tqCWKjK16uI6gF2CE0+GfIN+jAb2zwQjLl0GptIKNeSye4vZwYaR+g60OOOqB8dvokjk Vz+STR8CqulLRobIzmqWrEPjKSVLI2fXVwZrOETtky3BueumwujCeNGwuK94Zzk1odNL a9fH6A8cDZem39NELhpr8S7vlZM23VfFxTaAhTnwUciTic+H9jf0g73fWyF+V6zDczjB pnYf+JQZwfumLJ3q61yLxKqogakY/kJ+xWW0+KH656+uikkO11SUXMkNu/Ge5ie8L1/k xflQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lWfEjZdw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w20si7120256oic.103.2020.02.17.18.21.37; Mon, 17 Feb 2020 18:21:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lWfEjZdw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726266AbgBRCVc (ORCPT + 99 others); Mon, 17 Feb 2020 21:21:32 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:37835 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726182AbgBRCVc (ORCPT ); Mon, 17 Feb 2020 21:21:32 -0500 Received: by mail-wm1-f66.google.com with SMTP id a6so1206974wme.2; Mon, 17 Feb 2020 18:21:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eY7gqSVNopqtgZAFLrrVT+eoXLnh2uTk4VjIyhxxVUI=; b=lWfEjZdwTlpzTJU/5rhFxfMC9DhmiD6MQKthqW76Hbv0XfOiGyqGDu5RldcdpYXDW8 8VC2MGu7JmRBUL9fqnyzhiIDG3lvptGawu3597QnUhz3j5vLjUvlxqf/5+0NIUht2qA6 uWtDKT3in5vo4L05ycc8PSKWD8SX6KfjeE/VrkPHoXR6vYccQNX6hznzbhKuUHFPgrjn dU8UTGnKjuMJikK87oHmZHLKnJRriEiSnKE3m9Jf9zKK0NQynG9nod5ORwABMAmNSD73 iWWpflgLYPICza/RpijPeYAYt6nJdVlb+5kUCHV5nhUDfMDi/MN5OigyycC/QcKsiuKL UE2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eY7gqSVNopqtgZAFLrrVT+eoXLnh2uTk4VjIyhxxVUI=; b=diIb5u/cC7YjyKDgObt8vLIZ/KwvoyLQVOPr981x3CLPhjr/kcIXAijrGQnaJUJTGJ IbvyWBTQjaqWFbftUYMfFZ44ecnIMhPkocFUy2eDCDkUcs9XuwOPHkzslvPlZGh9I+M4 xk6zAe/sstRO0nfSo6jD5Lu4w0e7A9cQ3CKAPJ6R/8azy0vnsA0b1kgtoNi9dlpxevrN 0qKPRDbzzwyS+f8RDyFhZhP3HD8L2JLhlav1QvdHACCEela60J00Yi4kvn2plvbHsvuV a9WvVfYGINUnkhmm+FWgjwMLY3CzN4tQ/TUbNuvSFgR9UJeL99LqcgaGpcXLfL3Eerux refg== X-Gm-Message-State: APjAAAVo5HyfD+0qQdK5NuxkPmrWq7txi90AK/0kILPqLCQFuCawBRbe /xxRUc/58ny+g6QucpM/65m7kNSbl58cRlkPf1Md7cJGHa4= X-Received: by 2002:a1c:5441:: with SMTP id p1mr2198840wmi.161.1581992489535; Mon, 17 Feb 2020 18:21:29 -0800 (PST) MIME-Version: 1.0 References: <20200213123728.61216-1-pasic@linux.ibm.com> <20200213123728.61216-2-pasic@linux.ibm.com> In-Reply-To: <20200213123728.61216-2-pasic@linux.ibm.com> From: Ming Lei Date: Tue, 18 Feb 2020 10:21:18 +0800 Message-ID: Subject: Re: [PATCH 1/2] virtio-blk: fix hw_queue stopped on arbitrary error To: Halil Pasic Cc: "Michael S. Tsirkin" , Jason Wang , Jens Axboe , linux-block , linux-s390 , Cornelia Huck , Ram Pai , Linux Kernel Mailing List , Linux Virtualization , Christian Borntraeger , Stefan Hajnoczi , Paolo Bonzini , "Lendacky, Thomas" , Viktor Mihajlovski Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 13, 2020 at 8:38 PM Halil Pasic wrote: > > Since nobody else is going to restart our hw_queue for us, the > blk_mq_start_stopped_hw_queues() is in virtblk_done() is not sufficient > necessarily sufficient to ensure that the queue will get started again. > In case of global resource outage (-ENOMEM because mapping failure, > because of swiotlb full) our virtqueue may be empty and we can get > stuck with a stopped hw_queue. > > Let us not stop the queue on arbitrary errors, but only on -EONSPC which > indicates a full virtqueue, where the hw_queue is guaranteed to get > started by virtblk_done() before when it makes sense to carry on > submitting requests. Let us also remove a stale comment. The generic solution may be to stop queue only when there is any in-flight request not completed. Checking -ENOMEM may not be enough, given -EIO can be returned from virtqueue_add() too in case of dma map failure. Thanks,