From patchwork Mon Mar 13 08:45:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 662952 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76D37C6FD19 for ; Mon, 13 Mar 2023 08:46:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230300AbjCMIqy (ORCPT ); Mon, 13 Mar 2023 04:46:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230225AbjCMIq1 (ORCPT ); Mon, 13 Mar 2023 04:46:27 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 394084D621; Mon, 13 Mar 2023 01:45:44 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32CN0lJq005179; Mon, 13 Mar 2023 08:45:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=l5emtnqnAuF5rngG5kvp0R7AJJUPTkH1GIQnJU5Z4ZM=; b=JgTlblEnUA64VVgC8ItR16lB7yl4gQ40uyjs7QY5m2CGU7q71GDjBK2IRJLJPynoowEA dXnudo7IZGOYrSy2DokU30vqOEeVJvDKA16vC3VxpKnJa8ME7gxaoEyG1vuT76kb+Lqz HdRp3f2Xu+uSNGq/jbKHGNXqNCLHZluX1f164moDWInfMiRf8xhxYR1S70/IyPTgCOQJ DLxhrWmn0eoJPaG3BvUzB6K5gkKEc6r9l02AANV1hlTR96Z2hCO/XufUYhbEh58t7yPD 2TEfV1DUIq/UqIsguMAEUTKDx8SJKBLLHbKIPytEduuRG/7FWwE2NKxgf1zR/IOxgIQY hg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3p8hhab7s0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 08:45:40 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 32D6tIlP033575; Mon, 13 Mar 2023 08:45:39 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2171.outbound.protection.outlook.com [104.47.57.171]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3p8g343a9u-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 08:45:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CJdbHvAenDNGseKvsW/INdbzy3UkuOrRv/TWxcfNcsLrJoTR+kkT/As76AitkrgRGmg0JhtnQncBOER4ClFISkJZqd/XBakFvlXHfw9eUXv934mdtkfJrBSXU71rutqCb3TGPwjHPOiFB78o9+prpN97Ic/R3fZ3tBJ4kWoJ/v18it+K6neTp5pc0HrCodbmdGKCQxV6mGEjynu7MN1yYL1xvHy2ZSZIw3tEn3eGi99c1gikSMLqSDjO4PKKgtfZcid4JN5vkOVIMwwJKepJfK0UqcvK+sP22nyDzNaJX9PYRL+NvE/pMw8d2fDIH4NsiEC48uCSyi0nxooUrLMaww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=l5emtnqnAuF5rngG5kvp0R7AJJUPTkH1GIQnJU5Z4ZM=; b=C9+SrCk2MK3z7ftwvlGpMt9GAlrXpWq6j374cmjizyE96H6LXfgVMg7GJ75TV+bxUwtuPUSvGJ9WyKKXhiswCYUMH02BsBMJtr3EDRThMtlkYWeEbEUVbrUY2KJBzAB0N02P1qYmUDMArkGsWK9J0xNEAWssh9+ow5YgIFY0Tm2NACltfCdOMZiqxmW9OXtL+kH6LfSHKX5KNz4hLTvnuTW5jQ2vNVjJZQ39HdsAzm0jg6SmoEY+XJKDcY6FDMsOUIm/V6wL88mlzO0Ezn+16Ajf5GMvw4KQrFlvWzEI9GJZ0I6869vnLkHSelKS96svLjpFYRdB/P6e6GtWgDWbag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=l5emtnqnAuF5rngG5kvp0R7AJJUPTkH1GIQnJU5Z4ZM=; b=dReOhmijTS4IvDFP0g0VfHQKpF44I/T/zDq+ZauqJP2NFG2Jc0/Do2ehEJCjZamVVIEnL5ViK+U5ZP66Kr20kK+vvE7hKh2pbaexR8DTIjgmmkiMGm4gcBe94qmceFDszpmdJMxkzVkObBpEsdtXHcQf+nua1wQUYnmLjQI7NGo= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by SJ0PR10MB4703.namprd10.prod.outlook.com (2603:10b6:a03:2d3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Mon, 13 Mar 2023 08:45:38 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::7276:bc4c:17a0:7267]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::7276:bc4c:17a0:7267%6]) with mapi id 15.20.6178.024; Mon, 13 Mar 2023 08:45:38 +0000 From: John Garry To: jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, bvanassche@acm.org, linux-kernel@vger.kernel.org, dgilbert@interlog.com, John Garry Subject: [PATCH v2 08/11] scsi: scsi_debug: Drop check for num_in_q exceeding queue depth Date: Mon, 13 Mar 2023 08:45:03 +0000 Message-Id: <20230313084505.1487337-9-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230313084505.1487337-1-john.g.garry@oracle.com> References: <20230313084505.1487337-1-john.g.garry@oracle.com> X-ClientProxiedBy: MN2PR03CA0019.namprd03.prod.outlook.com (2603:10b6:208:23a::24) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|SJ0PR10MB4703:EE_ X-MS-Office365-Filtering-Correlation-Id: dfb11cb2-30f1-48f3-d9b1-08db239f51b8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: roo+oVVXyaQOFLS1F8JmmIJaW7/b3p5vI9g6CGg+F0a5jGUVfaikD3yfaWm6rDTOEIwBfjqkgi/261u0H73f38iDRUwqsf70KHfJJgIVn8Rh+dcKjjfQ3hdNC/7Ws6ttw2Y8l2fUktjplx4fSeT402nBFODK4WYkZisMR1/VNz9aXuY0pzZzHrv8/iJ7AGf16ixc9+ZBRSrhnrmCp273BGxBJKm85kCiw8Jl2JjXnWFunhDGPGkmug4+SMS1asvKkwRhd9Qcuv11hqOy0cKo1Sj2WnIzWDjBttOqDLrPq68ymhiDWvdv96y4AkHvGghWwE0mZI/7S1f94Ry0XS1VxrBmOgMCN6+o4EvWetccFNgSb+oEYtoseHUOnSiC3pmDsDrg5d7TdK8AGzO1YUDyBJtp3m0tM3rc24smHMkaEAwBJis6Ntblv2nST2W5oQ9t4PhC+7FGufsa2w+GkqwzpR5owguEpvN17MmL+crQwXrBU7T6pD20uM4SGfzOo/lM2HQnskkUIAz8+JZLPeljde23IbN9UzUMLF7B1rp+n8BqXleschEf31W3RU1xYUiJkQYFI3/iTWST9wwYuSteJcxATDfjBy0P2br95BTOM8pZLHgWic6yPRY3qEq2F5LTWV8NuPUf+grgvyVA2ZUlRA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR10MB4313.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(396003)(136003)(346002)(376002)(39860400002)(366004)(451199018)(2906002)(83380400001)(36756003)(5660300002)(66946007)(66556008)(41300700001)(8936002)(4326008)(103116003)(8676002)(66476007)(38100700002)(6636002)(86362001)(316002)(478600001)(186003)(2616005)(6486002)(26005)(107886003)(6666004)(6506007)(1076003)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /ABESVRRZaBi429z+cEjXe6ipBr1OwdKQs0po2jUxWPmKXWwaqyJA8waA/qcocelp9Ffoh4XslvwtHWqz4p0DekKJDrQzYIwf1vGyR3Gw2ID2OOtOlXQK6DLACU+WKcNbJPk+LNNuoFHZnMuq1DDGaodkLrj/peeQV6Qr4klZYbtD90YlaMLrUfYd1pwymKAaWoz4eaat3cE+Oe0pqu8x8eAOPAWpZoVbM4kyZtiNu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srG+J8M/4lCHnqiB1lVxZPclecUQnKmXiTVCcGKgfg2LI0KzZYXgq2URCoTu9fjVCf7k2Pfs9KnxfkDVlZprTFT6vKC0tNHSpZnmwCj97pS0fPbyZJCQomJ7DeeebIntiFUqXM/OPFYsbEZVIUtIPSPoAkfaNZgZ6v4+d0557trwDI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: dfb11cb2-30f1-48f3-d9b1-08db239f51b8 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2023 08:45:38.2304 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cteYM1yuskwtI+ZSd25KaQv+MBQFj5q0d8E/v9+K6UBBTv9aCul6INcKsfWsvzXGM2QfP6NBpUts/hbQxqF05w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4703 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-13_01,2023-03-10_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 mlxscore=0 phishscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303130070 X-Proofpoint-GUID: R7Nq09oVXTi_-u0l8i0ICIjv9Bp-U_qP X-Proofpoint-ORIG-GUID: R7Nq09oVXTi_-u0l8i0ICIjv9Bp-U_qP Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The per-device num_in_q value cannot exceed the device queue depth, so drop the check. Signed-off-by: John Garry --- drivers/scsi/scsi_debug.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 47820b9f6326..0d515bac93bf 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -5593,15 +5593,8 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip, } num_in_q = atomic_read(&devip->num_in_q); qdepth = cmnd->device->queue_depth; - if (unlikely((qdepth > 0) && (num_in_q >= qdepth))) { - if (scsi_result) { - spin_unlock_irqrestore(&sqp->qc_lock, iflags); - goto respond_in_thread; - } else - scsi_result = device_qfull_result; - } else if (unlikely(sdebug_every_nth && - (SDEBUG_OPT_RARE_TSF & sdebug_opts) && - (scsi_result == 0))) { + if (unlikely(sdebug_every_nth && (SDEBUG_OPT_RARE_TSF & sdebug_opts) && + (scsi_result == 0))) { if ((num_in_q == (qdepth - 1)) && (atomic_inc_return(&sdebug_a_tsf) >= abs(sdebug_every_nth))) {