From mboxrd@z Thu Jan 1 00:00:00 1970 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 9CA80C25B07 for ; Tue, 9 Aug 2022 14:17:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229715AbiHIORA (ORCPT ); Tue, 9 Aug 2022 10:17:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241106AbiHIOQ7 (ORCPT ); Tue, 9 Aug 2022 10:16:59 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB25D65C4; Tue, 9 Aug 2022 07:16:57 -0700 (PDT) Received: from fraeml704-chm.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4M2FS53Ggzz67FSP; Tue, 9 Aug 2022 22:14:13 +0800 (CST) Received: from lhrpeml500003.china.huawei.com (7.191.162.67) by fraeml704-chm.china.huawei.com (10.206.15.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2375.24; Tue, 9 Aug 2022 16:16:55 +0200 Received: from [10.195.245.222] (10.195.245.222) 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; Tue, 9 Aug 2022 15:16:53 +0100 Message-ID: <16f03f81-a8c7-bacf-c74c-67231f7f7202@huawei.com> Date: Tue, 9 Aug 2022 15:16:52 +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 From: John Garry 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> In-Reply-To: <3451fa5a-6229-073f-ae18-0c232cd48ed5@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.195.245.222] X-ClientProxiedBy: lhrpeml100006.china.huawei.com (7.191.160.224) To lhrpeml500003.china.huawei.com (7.191.162.67) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org On 09/08/2022 10:58, John Garry wrote: >>> >>> commit: 0568e6122574dcc1aded2979cd0245038efe22b6 ("ata: libata-scsi: >>> cap ata_device->max_sectors according to shost->max_sectors") >>> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master >>> >>> in testcase: stress-ng >>> on test machine: 96 threads 2 sockets Ice Lake with 256G memory >>> with following parameters: >>> >>>     nr_threads: 10% >>>     disk: 1HDD >>>     testtime: 60s >>>     fs: f2fs >>>     class: filesystem >>>     test: copy-file >>>     cpufreq_governor: performance >>>     ucode: 0xb000280 >> >> Without knowing what the device adapter is, hard to say where the >> problem is. I >> suspect that with the patch applied, we may be ending up with a small >> default >> max_sectors value, causing overhead due to more commands than necessary. >> >> Will check what I see with my test rig. > > 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. thanks, John