Message ID | 20231226182827.294158-1-pasha.tatashin@soleen.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-11619-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1031683dyb; Tue, 26 Dec 2023 10:29:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IEldKBQ80S+SKng1snf6H3H4A4eGNt7nfR6/SXWipgYdRW6/j3+vFukmBAmGdpll3CFH/vP X-Received: by 2002:a05:620a:4942:b0:77f:3f7d:b49c with SMTP id vz2-20020a05620a494200b0077f3f7db49cmr9650816qkn.94.1703615339886; Tue, 26 Dec 2023 10:28:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703615339; cv=none; d=google.com; s=arc-20160816; b=DUrd96RrPD0ltNMk8RIJr2UCbmHpZevCWIL+SmboMVxXqdPYnQpUZ08frgKE/PniPF /ruTpR5aDXHvCOVdGiXBI9rCIO3loS8CgiGiL7cuaM3A7jkDb43CxgFc+f2q+Wxlx01U +eGu7P4UaZEJj7kxL81SXQVao2aGlCrRaYpwyl3XtpOxsphMOgGr1O+9q7qTN5/w3zJc 3GOZ6UnWb5hsp0ulNS64q89HMR9LgcFyvjmH2XXxV+ONveNM81+RPuCoSJjU/vwTpURi vEkaQ+/nh5roKzMH0pdEeDUyWkUFtF2qTT1tyVIPNK704hQyftu7Y68khNHLXn5Q7jQW 81TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:to:from :dkim-signature; bh=iVG9ArmoQ15xyAc+yxUrO+uyL/lDfCQ7yjtpIzOf96k=; fh=EawTQfI8QZMTr4xvs36NIsn3bUyHc0Smj6UncqR9GUw=; b=qx7WOQAYnqgKfmBxNvPWRqGP5DcqvloL9X1QmB3xpbtr8EupHhAVGyFHh4eieFcAT3 vwIAbelhskPvm4ugeJ8VYrmDOgTDDidA4x1iSX40fbwyKkKQfi+lQRRgYQmXDqLdr5Jm YzhVDJB9WjzKlCX9MEboxDkDYTI/arHmlGYD8oagcl6KbjGdeqDI39+XF6ZCt/yCb//C +EyTCU2HigriNAeQq9OVBRZ7Weq+xGQUAJiT2BVEb/SYgNivHmWA5D8tnHSmCX3JMrYH P0iQRvYtalZkdc4EfmT9ZhzNk3Uvpdb/GpMTNr45Dsm+Ily0Es6BNJrMH6PtW/4DhHeV uzjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=aGliPHUd; spf=pass (google.com: domain of linux-kernel+bounces-11619-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11619-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v18-20020a05620a0f1200b0077f0313e0f4si13502345qkl.419.2023.12.26.10.28.59 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 10:28:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11619-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=aGliPHUd; spf=pass (google.com: domain of linux-kernel+bounces-11619-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11619-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id AACDA1C21FE2 for <ouuuleilei@gmail.com>; Tue, 26 Dec 2023 18:28:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC71153E1A; Tue, 26 Dec 2023 18:28:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="aGliPHUd" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20D79524C9 for <linux-kernel@vger.kernel.org>; Tue, 26 Dec 2023 18:28:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soleen.com Received: by mail-qt1-f178.google.com with SMTP id d75a77b69052e-4277c62426fso40269751cf.1 for <linux-kernel@vger.kernel.org>; Tue, 26 Dec 2023 10:28:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1703615310; x=1704220110; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=iVG9ArmoQ15xyAc+yxUrO+uyL/lDfCQ7yjtpIzOf96k=; b=aGliPHUdB8U3RJNTI1zp45s5PMXpIevTm/lbl5/gLJusHvGDGsCDVDpf9TKlOd2Gz6 ValHQ/7PxpfsKmdzBLftziFHip6OW5+9n3CBvIWYb5P00zXPxK3HxUfUpusw98sMpgvW P4FGFt3O56aTSLILIAqmw0JytiS9xyVgfmkxzwHZMSQBWOwqCerd0/FR2detewgOSABH vcdfSamfZCFQLLRqwKiux0BFT6GCADcFGAJaTHtWk9E4ZtIK01X3VKlqDT8y2HhEZLfs G3VS97kQb4yP1zMoo/bFAFBQ80wb13sEu0ZafokNKPhuo92Koyxa5UipTwSOUoJ0FLc8 tiBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703615310; x=1704220110; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iVG9ArmoQ15xyAc+yxUrO+uyL/lDfCQ7yjtpIzOf96k=; b=tth+mpcPcZP/pbfXpFkpoMQOKKHNt4elP6n3BHE/i8xLawjzwD01ypuDmdT5p9jXh3 MWKATWo8WlS7hhmUtRF/DXNFOTz5pQlWBU/XZeUnCrFEUI5O/WI2wNOVKx9ngjISmeTZ kdKoHLnkBHoe+mDgEuffX3168VJzS3nlIZKIqrlZgQtwgaDJa6T7lHLqH+ysp35EwiZD 1G8yVeeve5HABwWfTJH6BgNvzRp6/z/565vl5kCXRu+YOzrNWsdpbwKdBXEKcsZSNnsx AkZtWdLpXhBPw5O+1QkbWPnExh5flPj4eUXG8ncIH7i3mVwfUIICzCfoWXTGpsoTsoM5 FDUg== X-Gm-Message-State: AOJu0YziEbHLqfbDj+DriFr5J5pOBjt13FBtf5l/JAltL0JVid8Woiag MhAJ87v5M0nsV473wDhz4naaHgx05d5v9Q== X-Received: by 2002:a05:622a:1817:b0:427:8376:a2f with SMTP id t23-20020a05622a181700b0042783760a2fmr9360806qtc.99.1703615310169; Tue, 26 Dec 2023 10:28:30 -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 cf23-20020a05622a401700b004276963b28asm6274675qtb.15.2023.12.26.10.28.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 10:28:29 -0800 (PST) From: Pasha Tatashin <pasha.tatashin@soleen.com> To: akpm@linux-foundation.org, linux-mm@kvack.org, pasha.tatashin@soleen.com, mst@redhat.com, jasowang@redhat.com, kvm@vger.kernel.org, virtualization@lists.linux.dev, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, rientjes@google.com Subject: [PATCH v2] vhost-vdpa: account iommu allocations Date: Tue, 26 Dec 2023 18:28:27 +0000 Message-ID: <20231226182827.294158-1-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783844843939059844 X-GMAIL-MSGID: 1786370158361138556 |
Series |
[v2] vhost-vdpa: account iommu allocations
|
|
Commit Message
Pasha Tatashin
Dec. 26, 2023, 6:28 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> 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.
Comments
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>
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);