Received: by 10.223.185.116 with SMTP id b49csp4500596wrg; Mon, 26 Feb 2018 20:01:30 -0800 (PST) X-Google-Smtp-Source: AH8x227pX2Jg9NcrvCxwd4W4PseNGgPgzIij3uCCY5/SmtTHRn5tRTYQpwIZlWegvKmU1DYF/gzd X-Received: by 10.99.109.77 with SMTP id i74mr9955906pgc.73.1519704090843; Mon, 26 Feb 2018 20:01:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519704090; cv=none; d=google.com; s=arc-20160816; b=sbxqCJFnBEmMeuq4S/qHWBtUDyomS+wLU8WVFUrFGNBsNHpoHdNA6j2+a40VOOEHKs OY4OEhUWJ3ZbBR4rMT3/gONhDj2b7+c1Q17kGF06zUDG8dWccVqNft8QSv76PUqI6uJF wolwZn9BNNG/ygMHO06rIUMWPVd5DM6YFoaoyZeubA4kmiOQuqVOkIvJa1t2xGTAcktQ KjxLDxVtXrXZFNZtG0oqbTQo81MfsC28KrAgiobSwg3ak9FPXWPofHJp99/VCx5j1ocp cCqsKcZjF0+ieUdchVgy8pUADFpPvUGkinoTk5vwuZI20xmbwfEG9PpBx6nrOhu7laPN 8o+A== 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=feQg6muMzrDCslq1sbIu7VOKxBJ9YDkKeBxX97hFGCA=; b=YDd/xJckwivnsc8itde8oe+7WymJKBf1NXjalxp41x862q+pNCLRgQJB55yz8J8exB 7uDiI7VeE3hkb6XfT7HSU9whsyYv+9ai52PyMNmcPnbx1INTpLOWan7KpsSuIEi5vnkC eQxWBlKAICta234/kxz9bPy9NDAfzmhVG1YwIRrRcW3YPLHuWvhepT/30zNRjMIoNyja aO9SId/KceHPh6a2a9tQyhCjF6l9FCcIVNEyTMhsFC7T8JlTdfKDdE5S7/5+GaJjd3ce cQhnqGwXPVSYD0HkJcIDviWfrP1R8m4JbcB259nAjnozQUVJXfab3//9TE1+M0CoeErf C3Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=ohVFeeWI; 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 z3si6427241pgb.805.2018.02.26.20.01.14; Mon, 26 Feb 2018 20:01: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=ohVFeeWI; 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 S1751893AbeB0EAe (ORCPT + 99 others); Mon, 26 Feb 2018 23:00:34 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:33550 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751706AbeB0EAc (ORCPT ); Mon, 26 Feb 2018 23:00:32 -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 w1R3v3kC037652; Tue, 27 Feb 2018 04:00:27 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=feQg6muMzrDCslq1sbIu7VOKxBJ9YDkKeBxX97hFGCA=; b=ohVFeeWIMkZsiyA3LSPnKQmlH8zXE5Gm6u2rpZSkZKSZOuTinsE5CV0NMdbUuZ0gXLsV QHy8m4g63KNqu+AE5b1nNGhJlxZNOFyq+KXWX6iSOJqZyVmXL672r4T2RDsWnt4e0A2k vkA8CFD5ilBmzwIt2UrR4quWoonWJscmKCcLqzWnLwCpYc+xcSO+EJQezffWvmimj45t vZHJSJue+FyCkVetTHgx0KvVQtKrUs/DSvCE32EkGvgSFbiiaYs2XMsI3GQCsGNRK3Da OLjS6xD0SN9Oiq7DtLHLQPXjgvsZ1fNEXutC82+r7t7IBCKDoFkfRAYtL8O2Mkcr6WNG 3w== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2gcw2g8dww-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Feb 2018 04:00:27 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w1R40QsY004101 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 27 Feb 2018 04:00:26 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w1R40PEo020972; Tue, 27 Feb 2018 04:00:25 GMT Received: from [10.182.70.180] (/10.182.70.180) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 26 Feb 2018 20:00:24 -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> <3b6ca136-ba62-3eca-6eca-d191490b7754@oracle.com> <1519702875.3120.7.camel@wdc.com> From: "jianchao.wang" Message-ID: Date: Tue, 27 Feb 2018 12:00:30 +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: <1519702875.3120.7.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-1802270043 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:41 AM, Bart Van Assche wrote: > On Tue, 2018-02-27 at 11:28 +0800, jianchao.wang wrote: >> 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. > > Hello Jianchao, > > For the legacy block layer preparing and unpreparing a request happens from > inside the block layer core. Please have a look at block/blk-core.c and the > code in that file that handles the request flag RQF_DONTPREP. Yes, thanks for your directive. On the other hand, this patch is to align the actions between blk-mq and block legacy code in __scsi_queue_insert. As we know, __scsi_queue_insert is just to requeue the request back to queue, as the block legacy code segment above: for block legacy, it just blk_requeue_request for the request and kick the queue run. However, for the blk-mq, scsi_mq_requeue_cmd will be invoked, it not only requeue the request, but also unprep request. This is not what __scsi_queue_insert should do, but scsi_io_completion. When the request is not finished completely, and scsi_io_completion finds it need a ACTION_REPREP, at the moment, we need requeue and unprep there. If I missed something, please feel free to point out. :) Thanks Jianchao > > Thanks, > > Bart. > > >