Received: by 10.223.185.116 with SMTP id b49csp4481626wrg; Mon, 26 Feb 2018 19:30:30 -0800 (PST) X-Google-Smtp-Source: AG47ELvlCOY0UXtft35XYSLQ39spqDv0A7IuIqtBZ12CqnQKqc5fBCKBUV8JpLd61awbMlZ5NIBz X-Received: by 10.98.80.15 with SMTP id e15mr10550672pfb.90.1519702230600; Mon, 26 Feb 2018 19:30:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519702230; cv=none; d=google.com; s=arc-20160816; b=jk2FhoA248CNGZXy9hs2PAd5OucOkL2Vbj2LNmhtAr0YGikI1lxGMIC9aiWdKmiFgT i6/USYshZzIyq3wBaZJ/auBVvJerzX0bzVb14XZp0/43D5AdHBl4vPM63JAxNTmBy8rJ eFkmCZ96EuHDd8Uh4PxbZXT9jNVv3WAqHADIkssH6zF3S8esuIY+n9J/sgKTaQgZ6777 nT6BBB0wdt6wmsp5gdOqURrCkb1dq7lu3S1s+/9wohcsS0PsY+16zo/H4MOVULB41ojB CiqyA+5UkvYJwv1k7RANJQ/JwVLmYrARSHfJnQtdeZElVUGC7kUsqRDvtVazl3ER5iw2 Hd/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=ZOB5hZq/1vU6MaXcJ+EN/4NAiepSiCR8g192OarzoxE=; b=D8S0YjkJ/FmoMmNzkS4zwndPBkMgjouzkN1erlZl6N/IrIbJMWTjuyuDPIgGlvKfyc 0Bp5jJMsBsJbM4/V1ixMFtzaAQ4Bi8GbRQ4EKlk/PYPej/P+Kk3gznenJdI1XAnrjBAD fJ8Dgx6lERdtaaMOabRb5+3i2wixYsjOwaCvC3m/XYUz9kEBVDuefk3nDkt+oYt0MZrk cRDDIuV2s+Z/9OPNHcKqeM1qh88Wf7HAsev3F6WWGqNR+faqe8C8UB6dIpJ8zX3foxbp ZxnS+C9pzLe2CvrW98R9Szm4mDEAmAAUTARRI/kwS3A2Fc6I2Jaa8T7xxX8K8GsjZ9LZ 5zWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=AA1N29Kg; 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=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y18si1851909pfl.154.2018.02.26.19.30.15; Mon, 26 Feb 2018 19:30:30 -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=@oracle.com header.s=corp-2017-10-26 header.b=AA1N29Kg; 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=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751848AbeB0D2s (ORCPT + 99 others); Mon, 26 Feb 2018 22:28:48 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:55524 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751463AbeB0D2r (ORCPT ); Mon, 26 Feb 2018 22:28:47 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w1R3RLAc019442; Tue, 27 Feb 2018 03:28:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=ZOB5hZq/1vU6MaXcJ+EN/4NAiepSiCR8g192OarzoxE=; b=AA1N29Kgca63k+e40SWxGUmSo4H0zrqwM25xNCofI0YURWdAeU7ZhdNroj6mRLR4ELTO RM6m8cKI64zn11s5SLB+U5xLClaXZ1zkG6UvUeWi0fBIveP/F6HxO8In1fL+Q/HQ0chk uh8beLr4PwVwniW7/HS8NIwWE2Ob/7wVWr3fD5dtrxVeHmLhqRrbzm6i4WdC32Td4qsy stkGa98+vJxYYZXqh8DMoqrsOcwkGKks7gM6Vus9NgBPJhenZ8dJ96gLrDEyjinjxrnk Ig3+8MR4d6b1izkfO8awC5z7F4VkcJ/fkTPDIFiKhx1tRocLRal085lmyF7f1mmlePq7 EA== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2gcw2g8byv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Feb 2018 03:28:42 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w1R3SgSb003923 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 27 Feb 2018 03:28:42 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w1R3SfJE019072; Tue, 27 Feb 2018 03:28:41 GMT Received: from [10.182.70.180] (/10.182.70.180) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 26 Feb 2018 19:28:41 -0800 Subject: Re: [PATCH] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert To: Bart Van Assche , "jejb@linux.vnet.ibm.com" , "martin.petersen@oracle.com" Cc: "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "hch@lst.de" References: <1519631932-1730-1-git-send-email-jianchao.w.wang@oracle.com> <1519700898.3120.3.camel@wdc.com> From: "jianchao.wang" Message-ID: <3b6ca136-ba62-3eca-6eca-d191490b7754@oracle.com> Date: Tue, 27 Feb 2018 11:28:46 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1519700898.3120.3.camel@wdc.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8816 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802270036 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bart Thanks for your kindly response. On 02/27/2018 11:08 AM, Bart Van Assche wrote: > On Mon, 2018-02-26 at 15:58 +0800, Jianchao Wang wrote: >> In scsi core, __scsi_queue_insert should just put request back on >> the queue and retry using the same command as before. However, for >> blk-mq, scsi_mq_requeue_cmd is employed here which will unprepare >> the request. To align with the semantics of __scsi_queue_insert, >> just use blk_mq_requeue_request with kick_requeue_list == true. >> >> Cc: Christoph Hellwig >> Signed-off-by: Jianchao Wang >> --- >> drivers/scsi/scsi_lib.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c >> index a86df9c..06d8110 100644 >> --- a/drivers/scsi/scsi_lib.c >> +++ b/drivers/scsi/scsi_lib.c >> @@ -191,7 +191,7 @@ static void __scsi_queue_insert(struct scsi_cmnd *cmd, int reason, bool unbusy) >> */ >> cmd->result = 0; >> if (q->mq_ops) { >> - scsi_mq_requeue_cmd(cmd); >> + blk_mq_requeue_request(cmd->request, true); >> return; >> } >> spin_lock_irqsave(q->queue_lock, flags); > > I think this patch will break the code in the aacraid driver that iterates > over sdev->cmd_list because commands are added to and removed from that > list in the prep / unprep code. If that is true, what if aacraid driver uses block legacy instead of blk-mq ? w/ blk-mq disabled, __scsi_queue_insert just requeue the request with blk_requeue_request. __scsi_queue_insert ... if (q->mq_ops) { scsi_mq_requeue_cmd(cmd); return; } spin_lock_irqsave(q->queue_lock, flags); blk_requeue_request(q, cmd->request); kblockd_schedule_work(&device->requeue_work); spin_unlock_irqrestore(q->queue_lock, flags); ... no prep/unprep code there for block legacy code. Thanks Jianchao > > Bart. >