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=-10.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 E9BE0C4361A for ; Thu, 3 Dec 2020 14:55:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8E5F0206D5 for ; Thu, 3 Dec 2020 14:55:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728124AbgLCOzo (ORCPT ); Thu, 3 Dec 2020 09:55:44 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:2200 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726056AbgLCOzo (ORCPT ); Thu, 3 Dec 2020 09:55:44 -0500 Received: from fraeml743-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4CmzND2Zsqz67LbF; Thu, 3 Dec 2020 22:53:00 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml743-chm.china.huawei.com (10.206.15.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 3 Dec 2020 15:54:57 +0100 Received: from [10.47.8.200] (10.47.8.200) 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.1913.5; Thu, 3 Dec 2020 14:54:56 +0000 Subject: Re: [RESEND PATCH v3 0/4] iommu/iova: Solve longterm IOVA issue To: Dmitry Safonov <0x7f454c46@gmail.com>, Will Deacon CC: Joerg Roedel , , Catalin Marinas , , , , , open list References: <1605608734-84416-1-git-send-email-john.garry@huawei.com> <160685669713.992935.17438167536143205811.b4-ty@kernel.org> From: John Garry Message-ID: <6e09d847-fb7f-1ec1-02bf-f0c8b315845f@huawei.com> Date: Thu, 3 Dec 2020 14:54:27 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.47.8.200] X-ClientProxiedBy: lhreml734-chm.china.huawei.com (10.201.108.85) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/12/2020 06:04, Dmitry Safonov wrote: > On Tue, 1 Dec 2020 at 21:50, Will Deacon wrote: >> On Tue, 17 Nov 2020 18:25:30 +0800, John Garry wrote: >>> This series contains a patch to solve the longterm IOVA issue which >>> leizhen originally tried to address at [0]. >>> >>> A sieved kernel log is at the following, showing periodic dumps of IOVA >>> sizes, per CPU and per depot bin, per IOVA size granule: >>> https://raw.githubusercontent.com/hisilicon/kernel-dev/topic-iommu-5.10-iova-debug-v3/aging_test >>> >>> [...] >> Applied the final patch to arm64 (for-next/iommu/iova), thanks! >> >> [4/4] iommu: avoid taking iova_rbtree_lock twice >> https://git.kernel.org/arm64/c/3a651b3a27a1 > Glad it made in next, 2 years ago I couldn't convince iommu maintainer > it's worth it (but with a different justification): > https://lore.kernel.org/linux-iommu/20180621180823.805-3-dima@arista.com/ Hi Dmitry, I was unaware of your series, and it’s unfortunate that your optimization never made it. However I was having a quick look there, and, in case you did not notice, that the code which you were proposing changing in patch #1 for intel-iommu.c was removed in e70b081c6f37 ("iommu/vt-d: Remove IOVA handling code from the non-dma_ops path"). BTW, split_and_remove_iova() has no in-tree users anymore, so I can send a patch to delete if nobody else wants to. BTW2, there's some more patches in my series which could use a review if you're feeling very helpful :) Cheers, John 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=-10.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 DB8A2C4361A for ; Thu, 3 Dec 2020 14:55:11 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 15D17206D6 for ; Thu, 3 Dec 2020 14:55:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 15D17206D6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 8421287B37; Thu, 3 Dec 2020 14:55:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GBdwXec5R8d6; Thu, 3 Dec 2020 14:55:09 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 5B05D87B30; Thu, 3 Dec 2020 14:55:09 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 43388C0FA8; Thu, 3 Dec 2020 14:55:09 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9C90BC0FA7 for ; Thu, 3 Dec 2020 14:55:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8B0D886DAF for ; Thu, 3 Dec 2020 14:55:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id y1U7kXDZdWR7 for ; Thu, 3 Dec 2020 14:55:05 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 5706B875A7 for ; Thu, 3 Dec 2020 14:55:05 +0000 (UTC) Received: from fraeml743-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4CmzND2Zsqz67LbF; Thu, 3 Dec 2020 22:53:00 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml743-chm.china.huawei.com (10.206.15.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 3 Dec 2020 15:54:57 +0100 Received: from [10.47.8.200] (10.47.8.200) 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.1913.5; Thu, 3 Dec 2020 14:54:56 +0000 Subject: Re: [RESEND PATCH v3 0/4] iommu/iova: Solve longterm IOVA issue To: Dmitry Safonov <0x7f454c46@gmail.com>, Will Deacon References: <1605608734-84416-1-git-send-email-john.garry@huawei.com> <160685669713.992935.17438167536143205811.b4-ty@kernel.org> From: John Garry Message-ID: <6e09d847-fb7f-1ec1-02bf-f0c8b315845f@huawei.com> Date: Thu, 3 Dec 2020 14:54:27 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Originating-IP: [10.47.8.200] X-ClientProxiedBy: lhreml734-chm.china.huawei.com (10.201.108.85) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Cc: Catalin Marinas , robin.murphy@arm.com, linuxarm@huawei.com, iommu@lists.linux-foundation.org, xiyou.wangcong@gmail.com, kernel-team@android.com, open list X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: base64 Content-Type: text/plain; charset="utf-8"; Format="flowed" Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" T24gMDMvMTIvMjAyMCAwNjowNCwgRG1pdHJ5IFNhZm9ub3Ygd3JvdGU6Cj4gT24gVHVlLCAxIERl YyAyMDIwIGF0IDIxOjUwLCBXaWxsIERlYWNvbjx3aWxsQGtlcm5lbC5vcmc+ICB3cm90ZToKPj4g T24gVHVlLCAxNyBOb3YgMjAyMCAxODoyNTozMCArMDgwMCwgSm9obiBHYXJyeSB3cm90ZToKPj4+ IFRoaXMgc2VyaWVzIGNvbnRhaW5zIGEgcGF0Y2ggdG8gc29sdmUgdGhlIGxvbmd0ZXJtIElPVkEg aXNzdWUgd2hpY2gKPj4+IGxlaXpoZW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