Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4192852pxu; Wed, 9 Dec 2020 10:32:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJwz9IZeNghntax7aVEBQIY/enN1lN0/bBjknh7BM33m0D7xYtFUkPaJPpTSujHwmB065qhb X-Received: by 2002:aa7:c0c2:: with SMTP id j2mr302763edp.343.1607538728911; Wed, 09 Dec 2020 10:32:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607538728; cv=none; d=google.com; s=arc-20160816; b=hPcJBLJF6Cj4hGYqITJkgkKqsqizK7BjSUi9dBcUCUn6Ndb5QoVytRatESHSn+rLIO rXm+4DKCEgtre/h8jx0GPjfaOCw7MYRZu/sfHa5+OLIVMHT7jEHPikIrKfA6yHZB5Om4 ohyht4695rHkuY/+3yf3rQ4lLJSKnh/OCj0wFS2bl0z+IesRO2hGkC0bbKiOExLTabve e6/llzrCRFJtiQFXpk1l30iP7bCxQhSJDkK4qWpHUS3igHjNi0wfyT5uv6thLo33AFmg 0RvBRtZUmpLX/n9PlbdiXzF6fBFeVv1nexPCUP9dPPCRdBmWeGOg3+hOxkuiZhaO1h0l 85TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=gsl+Adk9dHUhBLfk/z8TskhWqvVHboAKfBhq9jfRn4A=; b=GEZNmNNzdCyytI4dXikV39wDr4ICS+GfhIfDjY+eQP42AAi+tJkyInKopbDJrhLEZX TFgD/qlWJ23wY5W2CuFq+7VUJeSNWreyjf168YdgGWKap7dWF8PoLUV1Jf8MY+BtF/ib wPvRKdx195lzNSDsyk4LGVxVuvb2EOPTiUtALq4l3MmR8f9NKVB4sm1nT1kRYyxa/I+o lGbNeR1HGGZ/Wm9aUPHcUam6a0sg7hZa30dIez2xRJfNAXY1h5DR4nEZ1nSw4whX+mvk ufcR5kO8toP6VFNxmjwuUa8Xa8OI4uQO5e+ojxavPjPpIQflgKZuWibZ4mp+1HRPsXSY BNKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hr21si1103664ejc.446.2020.12.09.10.31.45; Wed, 09 Dec 2020 10:32:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732917AbgLIS2Q (ORCPT + 99 others); Wed, 9 Dec 2020 13:28:16 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:9415 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733049AbgLIS17 (ORCPT ); Wed, 9 Dec 2020 13:27:59 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4Crlr04j05z7By3; Thu, 10 Dec 2020 02:26:40 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Thu, 10 Dec 2020 02:27:03 +0800 From: John Garry To: , CC: , , , , , John Garry Subject: [PATCH v4 0/3] iommu/iova: Solve longterm IOVA issue Date: Thu, 10 Dec 2020 02:23:06 +0800 Message-ID: <1607538189-237944-1-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Notice, for example, the following logs: [13175.355584] print_iova1 cpu_total=40135 depot_total=3866 total=44001 [83483.457858] print_iova1 cpu_total=62532 depot_total=24476 total=87008 Where total IOVA rcache size has grown from 44K->87K over a long time. Along with this patch, I included the following: - A smaller helper to clear all IOVAs for a domain - Change polarity of the IOVA magazine helpers Differences to v3: - Drop Cong's patch, already accepted - Add tags - Rebased Differnces to v2: - Update commit message for patch 3/4 Differences to v1: - Add IOVA clearing helper - Add patch to change polarity of mag helpers - Avoid logically-redundant extra variable in __iova_rcache_insert() [0] https://lore.kernel.org/linux-iommu/20190815121104.29140-3-thunder.leizhen@huawei.com/ [1] https://lore.kernel.org/linux-iommu/4b74d40a-22d1-af53-fcb6-5d70183705a8@huawei.com/ John Garry (3): iommu/iova: Add free_all_cpu_cached_iovas() iommu/iova: Avoid double-negatives in magazine helpers iommu/iova: Flush CPU rcache for when a depot fills drivers/iommu/iova.c | 58 ++++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 26 deletions(-) -- 2.26.2