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 X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76840C4332E for ; Fri, 19 Mar 2021 13:41:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5BFBF64F74 for ; Fri, 19 Mar 2021 13:41:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229995AbhCSNk6 (ORCPT ); Fri, 19 Mar 2021 09:40:58 -0400 Received: from verein.lst.de ([213.95.11.211]:46257 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230015AbhCSNku (ORCPT ); Fri, 19 Mar 2021 09:40:50 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 6A6C368BFE; Fri, 19 Mar 2021 14:40:47 +0100 (CET) Date: Fri, 19 Mar 2021 14:40:47 +0100 From: Christoph Hellwig To: John Garry Cc: joro@8bytes.org, will@kernel.org, jejb@linux.ibm.com, martin.petersen@oracle.com, hch@lst.de, m.szyprowski@samsung.com, robin.murphy@arm.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linuxarm@huawei.com Subject: Re: [PATCH 0/6] dma mapping/iommu: Allow IOMMU IOVA rcache range to be configured Message-ID: <20210319134047.GA5729@lst.de> References: <1616160348-29451-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1616160348-29451-1-git-send-email-john.garry@huawei.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 19, 2021 at 09:25:42PM +0800, John Garry wrote: > For streaming DMA mappings involving an IOMMU and whose IOVA len regularly > exceeds the IOVA rcache upper limit (meaning that they are not cached), > performance can be reduced. > > This is much more pronounced from commit 4e89dce72521 ("iommu/iova: Retry > from last rb tree node if iova search fails"), as discussed at [0]. > > IOVAs which cannot be cached are highly involved in the IOVA aging issue, > as discussed at [1]. I'm confused. If this a limit in the IOVA allocator, dma-iommu should be able to just not grow the allocation so larger without help from the driver. If contrary to the above description it is device-specific, the driver could simply use dma_get_max_seg_size().