Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp349357imw; Thu, 14 Jul 2022 02:28:00 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tKVJEJSl4IU7nT8Y0Nq94xHQ6y1MSObFzxgke/rayG8iHvgqrLLYIZLdWvJqi/RS1dMx/b X-Received: by 2002:a17:907:3d86:b0:72b:4b25:1031 with SMTP id he6-20020a1709073d8600b0072b4b251031mr7627710ejc.536.1657790880061; Thu, 14 Jul 2022 02:28:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657790880; cv=none; d=google.com; s=arc-20160816; b=EB8EHAHaHHrvfh9UT7GYymwLW7hwM2zIL8gk/L1ZmrYBqjfRhdOBlBGLAuqdNSkvly E3rEPdrf61seyJtTSnmsiwgr0gbDz+wImap7l3r2zWlQ0rQOvCz/wtZzFCipVCPayUex Mo5PAQcUwVtWH2N0B2Soc/MNCrMUl0bqBliYIoA6bVzu8qlf6QKWYnVLx/0664GcL7RA uObZRxrOx2kxBHbzcQWQmhpC4b3ymgaHwiHYZG/dYiQCUKQTE/btlA3yoHomDQekZyac ZBdSPpLKzBelfQW4gPYSj7BU5NJDe/BISYOqwfJqSAOXvTvP+MvlT15A9SwXMcDbGx7n FtOw== 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=CPbwqLMHx/qDagiWCYOJ9WzF/EDEe3bwtc7I/7YPa50=; b=AU6G2ILH87iKyscOPY2Y+A3NYOnX78nDs2B9hZyZHA5gkTT3sC4SHXX7l2scHTKEYG Jdn8DN4yGquCClEwAQ36Mz6YsdcSsj1zR2VRMETIRU1vqSFTSBs5Jf9+F0+4ETEDqdOi wUdaK/m8hTHVO+K9kkPZDbVMcIEr4Deu9AuN9m7Mw/Ucm2ALmz0FPlYF9I/mobATCEUZ z53I9QzGPz+mxwzRizAAZgl28QaWdz6IaPgwJKpOeq8RvIAqZqFjcdPelRyJ33ZIaPez U2I3gdRU/w31vKylahUlrGS7vgXmMDgtixL+Mi8vpqcK0MrpU1/XzbdTQiFbHpjHpSJf +jiA== 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 hp23-20020a1709073e1700b00726a5db994bsi1452917ejc.477.2022.07.14.02.27.35; Thu, 14 Jul 2022 02:28:00 -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 S230126AbiGNJMH (ORCPT + 99 others); Thu, 14 Jul 2022 05:12:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237690AbiGNJLt (ORCPT ); Thu, 14 Jul 2022 05:11:49 -0400 X-Greylist: delayed 2399 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 14 Jul 2022 02:11:48 PDT Received: from sinsgout.his.huawei.com (sinsgout.his.huawei.com [119.8.179.247]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A2FB22B34; Thu, 14 Jul 2022 02:11:48 -0700 (PDT) Received: from sinmsgout03.his.huawei.com (unknown [172.28.115.130]) by sinsgout.his.huawei.com (SkyGuard) with ESMTP id 4Lk6CX1llBz3Z9D9; Thu, 14 Jul 2022 15:52:24 +0800 (CST) Received: from fraeml706-chm.china.huawei.com (unknown [172.18.156.208]) by sinmsgout03.his.huawei.com (SkyGuard) with ESMTP id 4Lk6B94QXHz9xGQ7; Thu, 14 Jul 2022 15:51:13 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml706-chm.china.huawei.com (10.206.15.55) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2375.24; Thu, 14 Jul 2022 09:52:14 +0200 Received: from [10.126.173.191] (10.126.173.191) 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.2375.24; Thu, 14 Jul 2022 08:52:13 +0100 Message-ID: <8a9d9c72-65c1-cb7d-80d7-4ac2b65871fe@huawei.com> Date: Thu, 14 Jul 2022 08:52:15 +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: [PATCH v5 0/5] DMA mapping changes for SCSI core To: "Martin K. Petersen" CC: Christoph Hellwig , , , , , , , , , , , , , References: <1656590892-42307-1-git-send-email-john.garry@huawei.com> <20220706134447.GA23753@lst.de> <5fd4814a-81b1-0e71-58e0-57a747eb684e@huawei.com> From: John Garry In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.126.173.191] X-ClientProxiedBy: lhreml725-chm.china.huawei.com (10.201.108.76) 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,NICE_REPLY_A, 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 14/07/2022 04:10, Martin K. Petersen wrote: Hi Martin, >> So I set max hw sectors at this ‘opt’ mapping size to ensure that we >> get no mappings which exceed this size. Indeed, I think max sectors is >> 128Kb today for my host, which would be same as dma_opt_mapping_size() >> value with an IOMMU enabled. And I find that only a small % of request >> size may exceed this 128kb size, but it still has a big performance >> impact. > The purpose of the soft limit is to pick the appropriate I/O size > (i.e. for best performance). The purpose of the hard limit is to ensure > we don't submit something the hardware can't handle or describe. > > IOW, the hard limit is not about performance at all. The hard limit is > mainly relevant for things that are way bigger than anything we'd issue > as regular filesystem I/O such as multi-megabyte firmware images, etc. > > It's perfectly fine for firmware download performance to be > "suboptimal". What is typically more important in that scenario is that > the firmware image makes it inside a single I/O. OK, fine. I've improved the next version such that the DMA mapping opt limit only affects the max_sectors default. Thanks, John