Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp801635rwd; Thu, 15 Jun 2023 02:09:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5D1XYWBbb/Wwk1FrvqINB67lcdoWKdqjeuhSKXgfkF0MoBvWM+/rN0XNZ3n5uIV66mEW5g X-Received: by 2002:aa7:d80f:0:b0:514:92d8:54b3 with SMTP id v15-20020aa7d80f000000b0051492d854b3mr10815364edq.12.1686820192825; Thu, 15 Jun 2023 02:09:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686820192; cv=none; d=google.com; s=arc-20160816; b=ygn8de+IOsrAyFDTfh7V6U6nMJlns/bURsi+MURxqjVdzDOVl3dJxsxt5uW0D65hE5 ukJNMZsVeB9a65J5TZNj4AGbjy6aL7GWDTqlav1rEeM1Jb4ldIwbnygkGLpgvdgs9JB9 FO+X1wr3D/1JYpgjP5UDtZE0zYvxngW8muux2ulaK95W8hb0jtF8FkHWxRkMtHIurAvA n6fIDogcVIXXdlBj49RBkx3cTpaPRzxPxkGzTZrUIgyTDq9nmtCKXTCQNHogzfqxLrjA +zKlIvQfcNVtVo+m57s8lSfLTCR86shL2ZEOZzHiGpkYM//qhJPyCllAJrFPdYPfAvGX ClDw== 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:content-language:subject:user-agent:mime-version :date:message-id; bh=inRrednvwiRb9KQCDX+px0B8Ovuib2GXHZKTIvdBs9k=; b=gY6m2oowzbW8bT6jQ1bhV+B9WeV0gnUE9Pu+6Hve1Zdxq4ef7JI+JxfqSXtPChU6eG 1zDnjro7VNou7vf3AcM4Vl8JDgXLBJ/9vUVvB7lAwNiiBzeDQJC2fAqX4v32/CBgLJei Bq1VfXX/Oc0GjFbJimquT0pE6MnVENrGcoWvq32hNJHyYi7z8uxoo7LdK6akRdkM1/8I fUddcmuSDXFf3Lf/OJvcGga/s/sMBCYONFvATtdEiV+RK5nDXVdmFUPyZ46Vz5YusC0k GShwY00cP9Ad0FHgigq3gW10+h+JRbe8nosN+mG84MstgxVZxYeKYBFA4xWIMIVP1Zes j1qg== 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=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l17-20020a056402345100b0051a1fc52396si1017983edc.392.2023.06.15.02.09.25; Thu, 15 Jun 2023 02:09:52 -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=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244643AbjFOJFF (ORCPT + 99 others); Thu, 15 Jun 2023 05:05:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244762AbjFOJEz (ORCPT ); Thu, 15 Jun 2023 05:04:55 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4079C1FCC for ; Thu, 15 Jun 2023 02:04:54 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 390011FB; Thu, 15 Jun 2023 02:05:38 -0700 (PDT) Received: from [10.57.85.251] (unknown [10.57.85.251]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C18CA3F71E; Thu, 15 Jun 2023 02:04:52 -0700 (PDT) Message-ID: <198a73b0-d7c0-57d6-5ef9-4e9dddb6365b@arm.com> Date: Thu, 15 Jun 2023 10:04:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v4] iommu: Optimise PCI SAC address trick Content-Language: en-GB To: John Garry , Jakub Kicinski , Joerg Roedel Cc: will@kernel.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Linus Torvalds References: <20230613105850.30172085@kernel.org> <4f9184c5-e6a2-08da-f44a-3000b6cdfe35@oracle.com> From: Robin Murphy In-Reply-To: <4f9184c5-e6a2-08da-f44a-3000b6cdfe35@oracle.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,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 2023-06-15 08:49, John Garry wrote: > On 13/06/2023 18:58, Jakub Kicinski wrote: >> On Fri, 14 Apr 2023 13:45:34 +0200 Joerg Roedel wrote: >>> Thanks for working on this, I think this is good to go. But given the >>> issues we had with last attempt I'd like to have this in linux-next for >>> a few weeks before sending it upstream. Therefore I will defer this >>> patch and merge it early in the next cycle. >> Is this patch queued up? I don't see it in linux-next and we keep >> hitting this issue in production. After a few NIC reconfigurations >> IOMMU starts consuming 90+% of CPU time. >> > > Since we're at rc6 time and a cautious approach was wanted to merge this > change, I doubt that this will be merged for this cycle. That's quite > unfortunate. > > Please note what I mentioned earlier about using dma_opt_mapping_size(). > This API is used by some block storage drivers to avoid your same > problem, by clamping max_sectors_kb at this size - see sysfs-block Doc > for info there. Maybe it can be used similarly for network drivers. It's not the same problem - in this case the mappings are already small enough to use the rcaches, and it seems more to do with the total number of unusable cached IOVAs being enough to keep the 32-bit space almost-but-not-quite full most of the time, defeating the max32_alloc_size optimisation whenever the caches run out of the right size entries. The manual workaround for now would be to boot with "iommu.forcedac=1" and hope that no other devices break because of it. Thanks, Robin.