Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp710757ybv; Wed, 19 Feb 2020 07:43:40 -0800 (PST) X-Google-Smtp-Source: APXvYqxw5Q/r7O3ZiG/rnsBctyPVApHQ7Sl2xR5HL532ESS09YuZOjMBvZw06G6dvz6yEk8QwWRp X-Received: by 2002:a9d:5a09:: with SMTP id v9mr19126930oth.214.1582127020023; Wed, 19 Feb 2020 07:43:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582127020; cv=none; d=google.com; s=arc-20160816; b=BQ5eEWArd1XEOXn94oLPR3gJpzUOwq2kG/9bLlyI629iQTHkf2IfKeP1F0XYcHe8/P 2pZtSv7HnRUqOn2SIgkfFsVniE7a6rTSYAphNKIilMFQCWSKK/ifcClAUszsE8d3C/Wu OvhJ4N4FilA2IZUh8/XY6UcOKnewuFN7dKqXTOpRBfUOiCiEsNbVbzOwbvcupmYE81vw wHeJjo54wFEztsIWk4e+HDecyBhEboZb/nhRd3pjzMlcfzLXzGZnkyZ35ZP9pya393BJ 2ntBUiOhdt35BPfEgGUxV3mr+ClUNdgo4YxQmrql3oSkRnzkYBg+YlP0n09Aq71Q2gTm W7jw== 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=U1kWhLwBUrpn+VSCFBIH6jrOTbfKO/yPxubPb/29OeQ=; b=IWUjGpW9JWO0tzkeK/9gHw9zL+YasHHbIrHZCgeG4exrAoyYmz15ta8sEjhS0S9h+n M4/cMjSqQHd7tUIwrTzTR2AOgA33kQta3OCqkvec8/7Km2O9zj8mOIOgdlwzDtIZ9Prd 5vxW9muRpp6deki9Jfts9ufSBo2ypDGWuO+fVyCT89YSLcsfC0JvS/iZuINotsNBSPhD cP1qLUdj5AQk8JbvGPOD8MckFx7Yhrjp4V3O6r9sy/Xn+MN+GJ3W+bIT+n2Snj5oMqDX dWA161FVzgwe1FSTiZ2bhfnxkGn5O6WhrFdd51uweMOTW1iV5t41gBexHtu3RVmhEabu tiLw== 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 s17si31021otr.320.2020.02.19.07.43.27; Wed, 19 Feb 2020 07:43:40 -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 S1726865AbgBSPma (ORCPT + 99 others); Wed, 19 Feb 2020 10:42:30 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:48946 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726569AbgBSPm3 (ORCPT ); Wed, 19 Feb 2020 10:42:29 -0500 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01JFZ8H0144898 for ; Wed, 19 Feb 2020 10:42:28 -0500 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2y8ubf20ju-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 19 Feb 2020 10:42:28 -0500 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 19 Feb 2020 15:42:25 -0000 Received: from b06avi18878370.portsmouth.uk.ibm.com (9.149.26.194) 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) Wed, 19 Feb 2020 15:42:21 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 01JFgKeq20906272 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Feb 2020 15:42:20 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 494E74C046; Wed, 19 Feb 2020 15:42:20 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D27A94C040; Wed, 19 Feb 2020 15:42:19 +0000 (GMT) Received: from oc2783563651 (unknown [9.152.98.43]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 19 Feb 2020 15:42:19 +0000 (GMT) Date: Wed, 19 Feb 2020 16:42:18 +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> <20200218133531.3eb08120.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: 20021915-0012-0000-0000-0000038853E3 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20021915-0013-0000-0000-000021C4E7E3 Message-Id: <20200219164218.6164cb17.pasic@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-02-19_03:2020-02-19,2020-02-19 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 suspectscore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 spamscore=0 impostorscore=0 phishscore=0 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002190118 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 19 Feb 2020 09:46:56 +0800 Ming Lei wrote: > On Tue, Feb 18, 2020 at 8:35 PM Halil Pasic wrote: > > > > 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. > > Looks I misread the patch, and this patch is fine: > > Reviewed-by: Ming Lei Thank you very much! Regards, Halil > > > Thanks, > Ming Lei