Message ID | 20231128204938.1453583-16-pasha.tatashin@soleen.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp4239205vqx; Tue, 28 Nov 2023 13:30:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IFztbiKINjXFureBxXBNkbtEMqqY14dd2yEEy/uT59e9qf2IR4S/+RhU9+eGZeVOegKlHms X-Received: by 2002:a05:6a20:7486:b0:18c:5795:669e with SMTP id p6-20020a056a20748600b0018c5795669emr11005998pzd.19.1701207012252; Tue, 28 Nov 2023 13:30:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701207012; cv=none; d=google.com; s=arc-20160816; b=NPT7AVbVCOO+oWVFOLm8fKguWVB9f/tED/WG2h81DubbB2E6d5ZcIm4jqPEyAN906Y kbNZ9BDrP4ZBLN9RbCfZkRxOMTMA6Iyd1t+q7T3LASDuqOwHZKMp5t5x+x6Vnidmnzfn KKuQhVA5O8ptjpe3+OUZSj9/QuBvHnZgYJCtHYKSP26+GDmxBMEwudB7k/hwG7mqaSPl fqtv96pUBsnabz2/9blaK1TRGdkKGOnZaGUpiKgk8Y89L0Jg0LSJOp7o3qjV45XM8SUb FnsgnQsTgBpTH1sL240r79cz8kPV6QEbzP+ShShH961CNf3L4frNPCiDqX36CU3WsIRA eMRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=iygGvNb1KE298FiVkmeH8gdBVxeTTuJw4eGKIF/nIuM=; fh=z7CihAYYs+frw4g3uL4utEDJXxOOJDcFFsLsywo+fzs=; b=lAJlzNZ0zEDz+bP7mIHLvXvWKdlsj8NSvwzjZTq3LsMzLWti+7AP3zhrqywVQGDWwH zI3h453/LhoWqfbT+/qSp2J/p62qQ9wSFZ793aK0cRBj5LXjWN8D5ZnkG03BXob/+O0k jqfoixKxh4/zOrdgeMGiQCWdbmb2SrLcGfLPa2QNt8ndRz61J/vZ4MuXVtIzCTPpHBp7 JUCOYckbVBqEtNGq+iHuga2GvsN1gvDas2C+2Sq+uFcTZ+pRoTX2K0BMnbGMfnPPdqW3 9W0B46/MdkGBVRu8emXm05LJSfDhWUpu3v2e4407GbDL9zqT6hmIpApEgx0mTVSrcXNx 62Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=TWRnXEVX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id o10-20020a056a0015ca00b006cb65cfde7fsi13422858pfu.91.2023.11.28.13.30.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 13:30:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=TWRnXEVX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id B217C80ABDFA; Tue, 28 Nov 2023 12:50:41 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346611AbjK1Uu2 (ORCPT <rfc822;toshivichauhan@gmail.com> + 99 others); Tue, 28 Nov 2023 15:50:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346271AbjK1Uty (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 28 Nov 2023 15:49:54 -0500 Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E4A52102 for <linux-kernel@vger.kernel.org>; Tue, 28 Nov 2023 12:49:56 -0800 (PST) Received: by mail-qv1-xf2d.google.com with SMTP id 6a1803df08f44-67a338dfca7so21119846d6.2 for <linux-kernel@vger.kernel.org>; Tue, 28 Nov 2023 12:49:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1701204595; x=1701809395; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=iygGvNb1KE298FiVkmeH8gdBVxeTTuJw4eGKIF/nIuM=; b=TWRnXEVXJruv36LJOKHOhLjpODPbkfmbkFVGiyOwKEshA3y7p2vwRpd/5C7W+qNM23 D6nv4XMHyxnItPBrp6yg8UyDYHblV+lzf/h7za7iL8ugRhzV9JfxwzHqKyxe7Xk8Uh/q PfP1iVJT2M4KQ7WfHjfApsQ4nZZ5x/pPJmPNH0lUx2TYkwjM3yON0sY4b8BF3B3MuZSB Qt9E/+FEDDPITVyILclLHYXmH6fhFO7Gd2aA+9IIMCVoLtHGobMgBqUWIWUXm9UbZ2uR 3PNpdpfkE6bslU98p/cRIQNaPtkG0vRMRtFyvh7U6nqZ2q0hT6WszqpUe9YACfO1iDi/ Dbqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701204595; x=1701809395; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iygGvNb1KE298FiVkmeH8gdBVxeTTuJw4eGKIF/nIuM=; b=ExkWjVhgMW3WysRcKlFNLyJ8y93iVW0rjQ0hqW6tMN04fD2+OM7EndlSdO6YvE5PiF 9f1PHyJdJme2fWg40xBVC29onnKdJw2zdM/EYsxdrBNuSTArdUnJbx+equUEBcf6xEPS 5tEFA6lbtdHsM8+ao8CsAn5l1rRB9rlI1Yze75znuoJCmdH//mjE/Hibc+CkAy7JP9y1 z1AR++Xpns1Yb78PJMvQp07JJcDlyIChbnPkuWMPJpDCoQOUb6+oao4XEI0wQefoh4dZ E1IBV+710+EzATFgYAhSrQQpFyCm474Z8JUe7VDQH7QcyKEe0kzkFea6UtE52rny9Z1q edZw== X-Gm-Message-State: AOJu0YwUv3Z7qwUeEJQtKRKDWEryN/TmUDha6cBl3os8Z+nY4G0CvtiA t9Vn4GbT9oIpmgbcXQnzw/2ydg== X-Received: by 2002:ad4:5dc6:0:b0:67a:21aa:6513 with SMTP id m6-20020ad45dc6000000b0067a21aa6513mr18119809qvh.17.1701204595440; Tue, 28 Nov 2023 12:49:55 -0800 (PST) Received: from soleen.c.googlers.com.com (55.87.194.35.bc.googleusercontent.com. [35.194.87.55]) by smtp.gmail.com with ESMTPSA id d11-20020a0cfe8b000000b0067a56b6adfesm1056863qvs.71.2023.11.28.12.49.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 12:49:54 -0800 (PST) From: Pasha Tatashin <pasha.tatashin@soleen.com> To: akpm@linux-foundation.org, alex.williamson@redhat.com, alim.akhtar@samsung.com, alyssa@rosenzweig.io, asahi@lists.linux.dev, baolu.lu@linux.intel.com, bhelgaas@google.com, cgroups@vger.kernel.org, corbet@lwn.net, david@redhat.com, dwmw2@infradead.org, hannes@cmpxchg.org, heiko@sntech.de, iommu@lists.linux.dev, jasowang@redhat.com, jernej.skrabec@gmail.com, jgg@ziepe.ca, jonathanh@nvidia.com, joro@8bytes.org, kevin.tian@intel.com, krzysztof.kozlowski@linaro.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, lizefan.x@bytedance.com, marcan@marcan.st, mhiramat@kernel.org, mst@redhat.com, m.szyprowski@samsung.com, netdev@vger.kernel.org, pasha.tatashin@soleen.com, paulmck@kernel.org, rdunlap@infradead.org, robin.murphy@arm.com, samuel@sholland.org, suravee.suthikulpanit@amd.com, sven@svenpeter.dev, thierry.reding@gmail.com, tj@kernel.org, tomas.mudrunka@gmail.com, vdumpa@nvidia.com, virtualization@lists.linux.dev, wens@csie.org, will@kernel.org, yu-cheng.yu@intel.com Subject: [PATCH 15/16] vhost-vdpa: account iommu allocations Date: Tue, 28 Nov 2023 20:49:37 +0000 Message-ID: <20231128204938.1453583-16-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.43.0.rc2.451.g8631bc7472-goog In-Reply-To: <20231128204938.1453583-1-pasha.tatashin@soleen.com> References: <20231128204938.1453583-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 28 Nov 2023 12:50:41 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783844843939059844 X-GMAIL-MSGID: 1783844843939059844 |
Series |
IOMMU memory observability
|
|
Commit Message
Pasha Tatashin
Nov. 28, 2023, 8:49 p.m. UTC
iommu allocations should be accounted in order to allow admins to
monitor and limit the amount of iommu memory.
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
---
drivers/vhost/vdpa.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On Tue, Nov 28, 2023 at 08:49:37PM +0000, Pasha Tatashin wrote: > iommu allocations should be accounted in order to allow admins to > monitor and limit the amount of iommu memory. > > Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> > --- > drivers/vhost/vdpa.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c > index da7ec77cdaff..a51c69c078d9 100644 > --- a/drivers/vhost/vdpa.c > +++ b/drivers/vhost/vdpa.c > @@ -968,7 +968,8 @@ static int vhost_vdpa_map(struct vhost_vdpa *v, struct vhost_iotlb *iotlb, > r = ops->set_map(vdpa, asid, iotlb); > } else { > r = iommu_map(v->domain, iova, pa, size, > - perm_to_iommu_flags(perm), GFP_KERNEL); > + perm_to_iommu_flags(perm), > + GFP_KERNEL_ACCOUNT); > } > if (r) { > vhost_iotlb_del_range(iotlb, iova, iova + size - 1); > -- > 2.43.0.rc2.451.g8631bc7472-goog
On Mon, Dec 25, 2023 at 11:09 AM Michael S. Tsirkin <mst@redhat.com> wrote: > > On Tue, Nov 28, 2023 at 08:49:37PM +0000, Pasha Tatashin wrote: > > iommu allocations should be accounted in order to allow admins to > > monitor and limit the amount of iommu memory. > > > > Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com> > > > Acked-by: Michael S. Tsirkin <mst@redhat.com> Thank you, Pasha
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index da7ec77cdaff..a51c69c078d9 100644 --- a/drivers/vhost/vdpa.c +++ b/drivers/vhost/vdpa.c @@ -968,7 +968,8 @@ static int vhost_vdpa_map(struct vhost_vdpa *v, struct vhost_iotlb *iotlb, r = ops->set_map(vdpa, asid, iotlb); } else { r = iommu_map(v->domain, iova, pa, size, - perm_to_iommu_flags(perm), GFP_KERNEL); + perm_to_iommu_flags(perm), + GFP_KERNEL_ACCOUNT); } if (r) { vhost_iotlb_del_range(iotlb, iova, iova + size - 1);