Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3954631pxv; Mon, 28 Jun 2021 17:38:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2a8oDJ9objnC6j4uGD4XaZAIj6BHLTcq/CFd3T2HTTFBWwFplNyijigXmZ41fKB5VVJPS X-Received: by 2002:a05:6e02:20c3:: with SMTP id 3mr19539620ilq.131.1624927082277; Mon, 28 Jun 2021 17:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624927082; cv=none; d=google.com; s=arc-20160816; b=T17EJ6wSPQNtsTBWQBX2qRbfU2ATK4p3Bkn7Y0U43pppr7cnXJ4xTpQ9i4Uwv3bfMI IUS4hLhzvFd+Yg/9nBugWTlM6RmTcUjnr3gSy/LBrkJIc6lemmvt3a9pMILr+4KoSdOk o5Hrbv4KtlR9DmEJldprQcG4/uKJWVNslH9tIVF+4gIzyK3LUPOPyqJeKQvlGFRV1lqy 43R9DsU9L+pMKcfyPtEdQksADFmqngj7PHN37tJ0mCGLFAH+k4RtpYqk7sm03KHI+rvA BfpmjFXwmujMhFvDuqkz5eaAbAxRMC3lorMZ4OWOqf1XQVWrrjQmcKZ3pZYwIj0rnjWE 4TzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=rQuHayracZCE5AuUCtlx0qvA9ABrKm6B8angLYVYEb8=; b=osiOCXIia6TsojtPkbbMRniqNUTI77oGzcWtn1TsM6CAy/g5SfAZpgKOR52ODP8ES4 Ns1kOOuoNiW45YEU2pNOSiWxG3B/8dH25ECrjyDNcQT9ohjuj4isJyV6bIubO0cQDdk9 DrTOsx4zALabUT8ojAAcF8B/9Vs72AF3DPDRedE+D/oUYwJe1WHtD9U0tpVuWSW//+di jeHewQor7h+CFkqTtpTqEurZUE9N0zuBrq6ZSGHUj04S1NhKUqYm1DZwBDR02vH+V7yI NpFvKB2X2SYWDNXCZyBdCPvY9KfeHJ0WAoaH50NcFAZYpthQQ7NAs+joA4AxJF6w6NlG Lhtw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v13si18896395jah.81.2021.06.28.17.37.50; Mon, 28 Jun 2021 17:38:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235733AbhF1XBO (ORCPT + 99 others); Mon, 28 Jun 2021 19:01:14 -0400 Received: from mail-pl1-f177.google.com ([209.85.214.177]:42660 "EHLO mail-pl1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234779AbhF1XBN (ORCPT ); Mon, 28 Jun 2021 19:01:13 -0400 Received: by mail-pl1-f177.google.com with SMTP id v13so9807212ple.9; Mon, 28 Jun 2021 15:58:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rQuHayracZCE5AuUCtlx0qvA9ABrKm6B8angLYVYEb8=; b=KWU+v1IaGOGkY4Kr/HqG8Y2F+Xc+XQOSL7iU5CddfOUO7b/IIpXTxGbnL1NZ4HY7Ae rI02XbCJQ1ht2bp8i+SOGcNSzirU6SzTOMGKrdcxAtdFINouhjEAUPcJjQtZNnu44q4r wKa0YN52Day9L8TVRXK9UDBCOtXKBYQmLYaSLjl0BASL7p0fGm9vtJfbROYpZB6wHmfK oVeRLmTZLsXmVZPB64/W25l8QTQHYB3T66ckKBjqU8qAW4WXz+kP1oYQFXAKByeUKzpC YlNyoyN3LJLcpSqSOWR27Kgghxds6ccjbOmsl5MOMODHKgSbdXZm7XJe0BwDORl6rqqr zStQ== X-Gm-Message-State: AOAM530CMYEbwwB9nsCiQLRglW3WeN+yKdAUbpKwnDcHhxfcZl9AS/pk Ap5+m13fu3XII2VFnMKl2AY= X-Received: by 2002:a17:90b:11d1:: with SMTP id gv17mr9094474pjb.230.1624921098509; Mon, 28 Jun 2021 15:58:18 -0700 (PDT) Received: from [192.168.3.217] (c-73-241-217-19.hsd1.ca.comcast.net. [73.241.217.19]) by smtp.gmail.com with ESMTPSA id s79sm8460998pfc.87.2021.06.28.15.58.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Jun 2021 15:58:17 -0700 (PDT) Subject: Re: [PATCH v1 2/3] scsi: ufs: Optimize host lock on transfer requests send/compl paths To: Can Guo , asutoshd@codeaurora.org, nguyenb@codeaurora.org, hongwus@codeaurora.org, linux-scsi@vger.kernel.org, kernel-team@android.com Cc: Stanley Chu , Alim Akhtar , Avri Altman , "James E.J. Bottomley" , "Martin K. Petersen" , Matthias Brugger , Bean Huo , Jaegeuk Kim , Adrian Hunter , Kiwoong Kim , Satya Tangirala , open list , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" References: <1621845419-14194-1-git-send-email-cang@codeaurora.org> <1621845419-14194-3-git-send-email-cang@codeaurora.org> From: Bart Van Assche Message-ID: Date: Mon, 28 Jun 2021 15:58:15 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <1621845419-14194-3-git-send-email-cang@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/24/21 1:36 AM, Can Guo wrote: > Current UFS IRQ handler is completely wrapped by host lock, and because > ufshcd_send_command() is also protected by host lock, when IRQ handler > fires, not only the CPU running the IRQ handler cannot send new requests, > the rest CPUs can neither. Move the host lock wrapping the IRQ handler into > specific branches, i.e., ufshcd_uic_cmd_compl(), ufshcd_check_errors(), > ufshcd_tmc_handler() and ufshcd_transfer_req_compl(). Meanwhile, to further > reduce occpuation of host lock in ufshcd_transfer_req_compl(), host lock is > no longer required to call __ufshcd_transfer_req_compl(). As per test, the > optimization can bring considerable gain to random read/write performance. Hi Can, Since this patch has been applied on the AOSP kernel we see 100% reproducible lockups appearing on multiple test setups. Examples of call traces: blk_execute_rq() __scsi_execute() sd_sync_cache() sd_suspend_common() sd_suspend_system() scsi_bus_suspend() __device_suspend() blk_execute_rq() __scsi_execute() ufshcd_clear_ua_wlun() ufshcd_err_handling_unprepare() ufshcd_err_handler() process_one_work() Reverting this patch and the next patch from this series solved the lockups. Do you prefer to revert this patch or do you perhaps want us to test a potential fix? Thanks, Bart.