From patchwork Tue Apr 10 08:48:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "jianchao.wang" X-Patchwork-Id: 10332595 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B8AE16053C for ; Tue, 10 Apr 2018 08:48:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC85128D6B for ; Tue, 10 Apr 2018 08:48:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A135828D6D; Tue, 10 Apr 2018 08:48:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6239D28D6B for ; Tue, 10 Apr 2018 08:48:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752283AbeDJIsp (ORCPT ); Tue, 10 Apr 2018 04:48:45 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:57474 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752081AbeDJIso (ORCPT ); Tue, 10 Apr 2018 04:48:44 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w3A8kM0r163994; Tue, 10 Apr 2018 08:48:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2017-10-26; bh=ubpzT/GKotZ/sEbU7iOnftDbZJNPaoYaQOeT/jEEInw=; b=TCHzJmlUTutztEo0V6OqzBGMKu/bDcvM7h9+AyJldJEtoBkGdcxrMaDAru1lxYmhUudg jaZPjbpUWuCTD5FKArWqEW7oB11zmp48Fh+XfR59C6FQZN9PPZC065S8kb1tOseOQE/d CdHho6uBcdWKVUzdxgWBGfUvH6QRKZKlxR+i96F5QP+9XKm+dNUHyVuXkSuwEr9D2LNb f8ugTN8eFgg5YUSjeBwHdvw1OSDxxxxyi4QqHU6L9cJDi6fMiMMRv+Hje3he4sF0yMan vQKc243ZaTiFLxuXwJmwvBv/G0ZgLZmmDxY1cEHy/LL/3w6bvIJO4uFZYSzEN3i+we2n HQ== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2130.oracle.com with ESMTP id 2h6kgt9b0y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Apr 2018 08:48:40 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w3A8mdGB006996 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Apr 2018 08:48:39 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w3A8mcdH027547; Tue, 10 Apr 2018 08:48:39 GMT Received: from will-ThinkPad-L470.cn.oracle.com (/10.182.70.180) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 10 Apr 2018 01:48:38 -0700 From: Jianchao Wang To: qla2xxx-upstream@qlogic.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] scsi: qla2xxx: reduce the time granularity of qla2x00_eh_wait_on_command Date: Tue, 10 Apr 2018 16:48:35 +0800 Message-Id: <1523350115-4026-1-git-send-email-jianchao.w.wang@oracle.com> X-Mailer: git-send-email 2.7.4 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8858 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=828 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804100089 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If the cmd has not be returned after aborted by qla2x00_eh_abort, we have to wait for it. However, the time is 1000ms at least currently. If there are a lot cmds need to be aborted, the delay could be long enough to lead to panic due to such as hung task, ocfs2 heartbeat, etc, just before scsi recovery works. Change the granularity to 1ms, even though more context switches would be introduced, but it should be ok as it is not hot path. Signed-off-by: Jianchao Wang --- drivers/scsi/qla2xxx/qla_os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 5c5dcca4..9f52ad9 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -1072,7 +1072,7 @@ qla2xxx_mqueuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd, static int qla2x00_eh_wait_on_command(struct scsi_cmnd *cmd) { -#define ABORT_POLLING_PERIOD 1000 +#define ABORT_POLLING_PERIOD 1 #define ABORT_WAIT_ITER ((2 * 1000) / (ABORT_POLLING_PERIOD)) unsigned long wait_iter = ABORT_WAIT_ITER; scsi_qla_host_t *vha = shost_priv(cmd->device->host);