Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp6835701rwb; Wed, 10 Aug 2022 01:52:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR7G18EJwkHFl6FLYdh79B8v+mCt39LfCZS+jvFHpgSsteFhnj0eOSxLs2scCr5c18vZO5qk X-Received: by 2002:a63:121a:0:b0:41a:6792:31e5 with SMTP id h26-20020a63121a000000b0041a679231e5mr21849601pgl.69.1660121531112; Wed, 10 Aug 2022 01:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660121531; cv=none; d=google.com; s=arc-20160816; b=KycwU8eIe7ZfCyZ0gS74l6mLQn9VN9T73fi7u9yRoGFXComv+5JOEbQBmYrCEKgCoB T3CyLNk+ZJQrho5wEHAdtG0yrjwQniF7a2X48lnbQGIef6SOpXBGJ8nc6eMQ+GaywTHk Qg12c2ZxyGASsaZWmvoEpL/zy7hopSQdL4JfH5rn4KLvGV9RJurowg2rIuM7y/L73u1p XyfufnOCeHYwiaHsH3LzC7nG37nc7Oj76OSHrk5Pd6bJe8E/qpen2rlmX+PU+TjyLSan DPzU4V+ZwvYBrkMyPzlla37+Corh2rOIJl9SrHkq4V45aXWlpfQu13HXVRykL8Tt+avU JDCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=1z1HHUmmc9ehzLd3tfEymiNccHq3ja5eQ1QQmYYH2Pw=; b=C5wOv2vSrybl0Rq6jVNXd5mgwEdIVSJCu4p9rX+0E0gJ1UwcYAMaep3OyXqmPQYupL fw2rYoxHxec0gM4gynp7yqC+kAY8KeqVoY+SrjFF5n3ZpF+LYn7ueYguY79ra+AeGNXG sfxzVSp39BgzX4tqgWKWuYwStgHwM3CzRs46gDWyWBkVS7ZZ1n5m3K39QHrLT4QQEukl LaQ/uR6aWE3/06ekCy0Af0809KUzao+WkgSitez7j0or+UgpSuYpImY6poOU3QJBuIVz d/1m7HSIGTzV3BLdvFhu++P/OoZBymUpjGrbfgjKHoYzojLafstds7KtnncAd9TIshbW SahQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j9-20020a63ec09000000b0041cc7bac751si11591380pgh.609.2022.08.10.01.51.57; Wed, 10 Aug 2022 01:52:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231562AbiHJIdk (ORCPT + 99 others); Wed, 10 Aug 2022 04:33:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230035AbiHJIda (ORCPT ); Wed, 10 Aug 2022 04:33:30 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60C8557250; Wed, 10 Aug 2022 01:33:29 -0700 (PDT) Received: from fraeml701-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4M2jrM3KsSz67Xgw; Wed, 10 Aug 2022 16:33:23 +0800 (CST) Received: from lhrpeml500003.china.huawei.com (7.191.162.67) by fraeml701-chm.china.huawei.com (10.206.15.50) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2375.24; Wed, 10 Aug 2022 10:33:27 +0200 Received: from [10.195.247.138] (10.195.247.138) by lhrpeml500003.china.huawei.com (7.191.162.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 10 Aug 2022 09:33:24 +0100 Message-ID: <82dbf4d6-2d43-20ff-22a7-857f9f11a5ce@huawei.com> Date: Wed, 10 Aug 2022 09:33:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [ata] 0568e61225: stress-ng.copy-file.ops_per_sec -15.0% regression To: Damien Le Moal , kernel test robot CC: Christoph Hellwig , "Martin K. Petersen" , LKML , "Linux Memory Management List" , , , , , , , References: <1f498d4a-f93f-ceb4-b713-753196e5e08d@opensource.wdc.com> <3451fa5a-6229-073f-ae18-0c232cd48ed5@huawei.com> <16f03f81-a8c7-bacf-c74c-67231f7f7202@huawei.com> From: John Garry In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.195.247.138] X-ClientProxiedBy: lhrpeml500005.china.huawei.com (7.191.163.240) To lhrpeml500003.china.huawei.com (7.191.162.67) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 On 09/08/2022 15:57, Damien Le Moal wrote: >>> As far as I can see, this patch should not make a difference unless the >>> ATA shost driver is setting the max_sectors value unnecessarily low. >> For __ATA_BASE_SHT, we don't set max_sectors. As such, we default >> shost->max_sectors = SCSI_DEFAULT_MAX_SECTORS (=1024) in >> scsi_host_alloc(). I assume no shost dma mapping limit applied. >> >> Then - for example - we could select dev->max_sectors = >> ATA_MAX_SECTORS_LBA48 (=65535) in ata_dev_configure(). >> >> So with commit 0568e6122574 we would have final max sectors = 1024, as >> opposed to 65535 previously. I guess that the problem is something like >> this. >> >> If so, it seems that we would need to apply the shost dma mapping limit >> separately in ata_scsi_dev_config() and not use shost->max_sectors. > OK. Will have a look at that. > We may need to introduce something like shost->max_hw_sectors, which is set according to sht max sectors and dma mapping limits. That could be also used in USB scsiglue slave_configure() Or else set max_sectors value for __ATA_BASE_SHT, but I don't know a sane value there considering ATA_MAX_SECTORS_LBA48 gives max_sectors of 65535. Damien, please let me know if you need help now. I am just waiting for you to test to prove this theory about dev->max_sectors being capped. I don't have an AHCI setup readily-available for testing - just SAS cards or QEMU. Thanks, John