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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90668C32771 for ; Tue, 16 Aug 2022 10:35:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0C2798D0001; Tue, 16 Aug 2022 06:35:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 04A536B0075; Tue, 16 Aug 2022 06:35:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E2D628D0001; Tue, 16 Aug 2022 06:35:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id CE1CE6B0073 for ; Tue, 16 Aug 2022 06:35:17 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 996E61A080A for ; Tue, 16 Aug 2022 10:35:17 +0000 (UTC) X-FDA: 79805098674.30.AA68CB0 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by imf05.hostedemail.com (Postfix) with ESMTP id 73E35100063 for ; Tue, 16 Aug 2022 10:35:16 +0000 (UTC) Received: from fraeml737-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4M6SBg6djFz67bbZ; Tue, 16 Aug 2022 18:32:11 +0800 (CST) Received: from lhrpeml500003.china.huawei.com (7.191.162.67) by fraeml737-chm.china.huawei.com (10.206.15.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 16 Aug 2022 12:35:13 +0200 Received: from [10.48.156.171] (10.48.156.171) 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, 16 Aug 2022 11:35:12 +0100 Message-ID: Date: Tue, 16 Aug 2022 11:35:11 +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 From: John Garry Subject: Re: [ata] 0568e61225: stress-ng.copy-file.ops_per_sec -15.0% regression To: Oliver Sang , Damien Le Moal 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> <2e9cf5a6-c043-5ccf-e363-097c6c941891@huawei.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.48.156.171] X-ClientProxiedBy: lhrpeml500006.china.huawei.com (7.191.161.198) To lhrpeml500003.china.huawei.com (7.191.162.67) X-CFilter-Loop: Reflected ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660646117; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gT6+wAjwyoSZ2cAlV0pRs9KGwDGivCv+cAlEdZrZcSs=; b=YXTmcFgirnxO/GXN+NI24tVngEtPhlM4PujFHEureUctDCQjriWHcDqp0eGi9jlwNQL3e7 wFz6Xgkl2GTAeddIz4uy0qhEFlNEY9d232zJgZFnHE8MA/ngHmc61h239HxcI5d40ijoB1 7IHblOl+p/sVs63INmQr/vM/LveJCXc= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; spf=pass (imf05.hostedemail.com: domain of john.garry@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=john.garry@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660646117; a=rsa-sha256; cv=none; b=36lJQti2Dr7djayacMTtYS6ZKeu8/OhcagOSUfL4FOQrc16Q/ku4OvCRCq9pEFk/0tQoz8 QmfpaCxFv9PX+5f7Slzeiz7FTrS1xYl1X3TSVnEtUUx8DxP492HIGA3rG9KrTVezsfOmxh eE6fpTgFy4Xvf2dnEp+d1T6N9ik41TM= X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 73E35100063 X-Rspam-User: Authentication-Results: imf05.hostedemail.com; dkim=none; spf=pass (imf05.hostedemail.com: domain of john.garry@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=john.garry@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Stat-Signature: 389y9r6jymwggh5jty56xdt8w4fgi44s X-HE-Tag: 1660646116-335902 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 16/08/2022 07:57, Oliver Sang wrote: >>> For me, a complete kernel log may help. >> and since only 1HDD, the output of the following would be helpful: >> >> /sys/block/sda/queue/max_sectors_kb >> /sys/block/sda/queue/max_hw_sectors_kb >> >> And for 5.19, if possible. > for commit > 0568e61225 ("ata: libata-scsi: cap ata_device->max_sectors according to shost->max_sectors") > > root@lkp-icl-2sp1 ~# cat /sys/block/sda/queue/max_sectors_kb > 512 > root@lkp-icl-2sp1 ~# cat /sys/block/sda/queue/max_hw_sectors_kb > 512 > > for both commit > 4cbfca5f77 ("scsi: scsi_transport_sas: cap shost opt_sectors according to DMA optimal limit") > and v5.19 > > root@lkp-icl-2sp1 ~# cat /sys/block/sda/queue/max_sectors_kb > 1280 > root@lkp-icl-2sp1 ~# cat /sys/block/sda/queue/max_hw_sectors_kb > 32767 > thanks, I appreciate this. From the dmesg, I see 2x SATA disks - I was under the impression that the system only has 1x. Anyway, both drives show LBA48, which means the large max hw sectors at 32767KB: [ 31.129629][ T1146] ata6.00: 1562824368 sectors, multi 1: LBA48 NCQ (depth 32) So this is what I suspected: we are capped from the default shost max sectors (1024 sectors). This seems like the simplest fix for you: --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -1382,7 +1382,8 @@ extern const struct attribute_group *ata_common_sdev_groups[]; .proc_name = drv_name, \ .slave_destroy = ata_scsi_slave_destroy, \ .bios_param = ata_std_bios_param, \ - .unlock_native_capacity = ata_scsi_unlock_native_capacity + .unlock_native_capacity = ata_scsi_unlock_native_capacity,\ + .max_sectors = ATA_MAX_SECTORS_LBA48 A concern is that other drivers which use libata may have similar issues, as they use default in SCSI_DEFAULT_MAX_SECTORS for max_sectors: hisi_sas pm8001 aic9xxx mvsas isci So they may be needlessly hobbled for some SATA disks. However I have a system with hisi_sas controller and attached LBA48 disk. I tested performance for v5.19 vs 6.0 and it was about the same for fio rw=read @ ~120K IOPS. I can test this further. Thanks, John