Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp983486pxp; Wed, 16 Mar 2022 23:27:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4xWijSDeJvWZjkZzPQiuIWV8ZtJdf2djk8YOOGVceH1BLlg7NHGBOiu7YYqyvZUZI/Lev X-Received: by 2002:a63:4526:0:b0:380:7c34:fc84 with SMTP id s38-20020a634526000000b003807c34fc84mr2567201pga.2.1647498444670; Wed, 16 Mar 2022 23:27:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647498444; cv=none; d=google.com; s=arc-20160816; b=gRjYTHKUIBmjhxReshtQ+ziziWvY3V9+2bST+7V1Rvr+BrAr5za/wvu1toBqCpd0qJ OKjkqoBce2pMay2lPLztSDIzb7OaIen86I/+4vmYXtv8BopoEiL0LG5UNJDMRohAflg9 sUr8XwADAfPWmI/4JfDzPRU9dOpnEJmTvROq8+o2Lr1wwddrHrCRn8fOHhHouUyiTnL3 oTRvnoxj7bextEwQJpJK7kZdrbCFUJTL4qW+DMB+BhjXhnEn7eHMao3PrOWOad7+WJyn ZqPP5jAQMEvgifS44/2sVFNHoi+CvTIu3P39MuerfCW6qSzMBCVmxZRmA1Fzm7PB8Erx 7voA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=7UYSTPyLdguoXDuiLDIZSS9uyfAfBa2QiuSeaWx1PWU=; b=ALj0yRDWzErbrWuaHM+nmZ96H7anb4AKk4/ZFVQsEUk2ymAN62CfGA7ibqbdv9NvJR MnR8GwuJd7Yjgq1lKuhb3KkYlsTb9IHoIzcmaZVNvXfjeBSnn86kKjqN/u2WRzkPYite eKYvchFDDtOPAv2KHBcdEjbQ8UfyMR6qmqmKf+5tHrcAhiGwc0ZkqpsdSpxFpQLamadK ccDlC+16avWS7Q7BTg3p2LLyY0TFlNKiaYP4bD9JE98kKVKs7OCXbDc3kT6S4l3Zjuv4 FA9pnQsJVcsKSWiHc0FmbiNQa09jVImuf5K9iWmVjW1t2y48bcrbUnbDThjTzeWyD5ci xg9A== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id bx9-20020a17090af48900b001bf73a5460csi6511933pjb.0.2022.03.16.23.27.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 23:27:24 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DEB0928BC17; Wed, 16 Mar 2022 22:13:00 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347567AbiCOKug (ORCPT + 99 others); Tue, 15 Mar 2022 06:50:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347604AbiCOKsA (ORCPT ); Tue, 15 Mar 2022 06:48:00 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3240522D6; Tue, 15 Mar 2022 03:45:02 -0700 (PDT) Received: from fraeml741-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4KHqlb4ryTz6809b; Tue, 15 Mar 2022 18:44:11 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml741-chm.china.huawei.com (10.206.15.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 15 Mar 2022 11:44:56 +0100 Received: from localhost.localdomain (10.69.192.58) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 15 Mar 2022 10:44:53 +0000 From: John Garry To: , , , , , , CC: , , , , John Garry Subject: [PATCH 0/2] scsi/libata: A potential tagging fix and improvement Date: Tue, 15 Mar 2022 18:39:04 +0800 Message-ID: <1647340746-17600-1-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Two loosely related patches are included: - Fix for scsi_realloc_sdev_budget_map(). I noticed that the budget token for scsi commands was way in excess of the device queue depth, so I think we need to fix the sbitmap depth. I need to test this more. - libata change to use scsi command budget token for qc tag for SAS host. I marked this as RFC as for SAS hosts I don't see anything which guarantees that the budget size is <= 32 always. For libsas hosts we resize the device depth to 32 in the slave configure callback, but this seems an unreliable approach since not all hosts may call this. In addition, I am worried that even if we resize the device depth properly in the slave config callback, we may still try to alloc qc tag prior to this - in lun scan, for example. So we need a way to guarantee that the device queue depth is <= 32 always, which I would be open to suggestions for. John Garry (2): scsi: core: Fix sbitmap depth in scsi_realloc_sdev_budget_map() libata: Use scsi cmnd budget token for qc tag for SAS host drivers/ata/libata-core.c | 5 +++-- drivers/ata/libata-sata.c | 21 ++++----------------- drivers/ata/libata-scsi.c | 2 +- drivers/ata/libata.h | 4 ++-- drivers/scsi/scsi_scan.c | 5 +++++ include/linux/libata.h | 1 - 6 files changed, 15 insertions(+), 23 deletions(-) -- 2.26.2