Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5817344ybv; Tue, 18 Feb 2020 04:36:01 -0800 (PST) X-Google-Smtp-Source: APXvYqxRrojjsE6tUbOidk+esI2NcM7O0o2ctALfifWULdl5suAYpMMru7YMRx+ayzqT546G3gMi X-Received: by 2002:a05:6830:1d4c:: with SMTP id p12mr16501201oth.198.1582029361004; Tue, 18 Feb 2020 04:36:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582029360; cv=none; d=google.com; s=arc-20160816; b=jerVz+3lpBmGa5naRiPSh1z2+jDndqbwGyTR0UeTteJfhCY6r3Fk0ymA1SIONny/et nevNUmUpS0PmEb0qW4QpL+E9DL7Dwa9E+6dzheMq+K5jBVvava1oTwmKi3Xzd1EyWKXf uN8joLrzaOWpYcq2viE7ohklrgaG+vuK5hZvChvFm5j0JIoRTGmWM59Z4aK9HSjR3jyx DIZ8N/4sjmI73RrigVRPlR77Hf+PDEO1Ml9RgUVzMgKnqlPGAKQhMx733FyOLYaiR6RX a7chdBhgNdp+u69H5fJdACR59GbUnlMaNTdYSufO1mP6yOFC/fe2Ang9lzIxEqLXvHA6 3iCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:organization:references:in-reply-to:subject:cc:to:from :date; bh=XK+NddbzoSLfEHmHHNCHBlsBLagXllTvxXpvXkDSL/8=; b=QxJ+jJHO2+ai7SoKp9YabDDhSNx5hQH1KlfmRye5K2O7z+pX9JRhsBEJxsvpTFktcL rUbOs7ZUivDleyaxUwK5lg8ymYoPJ/qbdyv6z6Cnw3Op/M+pIpAALAPTppUDJi6zuDy7 TJiFqxPCWg+zySHtV9DfvB6g59YpyDu8Se2x9S1SJErE/smVYqkPHzTtQO3fMSWYOsXX ZHCR2JDMs6dA4gEAW3gUygONILGl3JoT79hwsOU7iDtUHZ5yot9dZDG6BdH8N0V4bKb4 qVGieC33O9805NHlpk7KB5IAq/3ALgW4xUuLpctCeLAugVjvBknE26ed2AptXVlGTqok FA/w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n20si7332793oig.53.2020.02.18.04.35.47; Tue, 18 Feb 2020 04:36:00 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726528AbgBRMfn (ORCPT + 99 others); Tue, 18 Feb 2020 07:35:43 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:1232 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726363AbgBRMfn (ORCPT ); Tue, 18 Feb 2020 07:35:43 -0500 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01ICPN1v063792 for ; Tue, 18 Feb 2020 07:35:41 -0500 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 2y6b56rbd0-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 18 Feb 2020 07:35:41 -0500 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 18 Feb 2020 12:35:38 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 18 Feb 2020 12:35:34 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 01ICZXnD39846136 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Feb 2020 12:35:33 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E77964C05C; Tue, 18 Feb 2020 12:35:32 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 78E1E4C046; Tue, 18 Feb 2020 12:35:32 +0000 (GMT) Received: from oc2783563651 (unknown [9.152.224.110]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 18 Feb 2020 12:35:32 +0000 (GMT) Date: Tue, 18 Feb 2020 13:35:31 +0100 From: Halil Pasic To: Ming Lei 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 Subject: Re: [PATCH 1/2] virtio-blk: fix hw_queue stopped on arbitrary error In-Reply-To: References: <20200213123728.61216-1-pasic@linux.ibm.com> <20200213123728.61216-2-pasic@linux.ibm.com> Organization: IBM X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 20021812-0012-0000-0000-00000387F466 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20021812-0013-0000-0000-000021C4846F Message-Id: <20200218133531.3eb08120.pasic@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-02-18_02:2020-02-17,2020-02-18 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 clxscore=1015 mlxscore=0 priorityscore=1501 spamscore=0 adultscore=0 lowpriorityscore=0 impostorscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002180101 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 18 Feb 2020 10:21:18 +0800 Ming Lei wrote: > 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. > I think this is a pretty close to that. The queue is stopped only on ENOSPC, which means virtqueue is full. > Checking -ENOMEM may not be enough, given -EIO can be returned from > virtqueue_add() > too in case of dma map failure. I'm not checking on -ENOMEM. So the queue would not be stopped on EIO. Maybe I'm misunderstanding something In any case, please have another look at the diff, and if your concerns persist please help me understand. Thanks for having a look! Regards, Halil > > Thanks,