linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] vhost-vdpa: account iommu allocations
@ 2023-12-26 18:28 Pasha Tatashin
  2023-12-26 20:19 ` David Rientjes
  0 siblings, 1 reply; 2+ messages in thread
From: Pasha Tatashin @ 2023-12-26 18:28 UTC (permalink / raw)
  To: akpm, linux-mm, pasha.tatashin, mst, jasowang, kvm,
	virtualization, netdev, linux-kernel, rientjes

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(-)

Changelog:

v1:
This patch is spinned of from the series:
https://lore.kernel.org/all/20231128204938.1453583-1-pasha.tatashin@soleen.com

v2:
- Synced with v6.7-rc7
- Added Acked-by Michael S. Tsirkin.

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.472.g3155946c3a-goog



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] vhost-vdpa: account iommu allocations
  2023-12-26 18:28 [PATCH v2] vhost-vdpa: account iommu allocations Pasha Tatashin
@ 2023-12-26 20:19 ` David Rientjes
  0 siblings, 0 replies; 2+ messages in thread
From: David Rientjes @ 2023-12-26 20:19 UTC (permalink / raw)
  To: Pasha Tatashin
  Cc: akpm, linux-mm, mst, jasowang, kvm, virtualization, netdev, linux-kernel

On Tue, 26 Dec 2023, 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>

Acked-by: David Rientjes <rientjes@google.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-26 20:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-26 18:28 [PATCH v2] vhost-vdpa: account iommu allocations Pasha Tatashin
2023-12-26 20:19 ` David Rientjes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox