Message ID | 20231130200447.2319543-1-pasha.tatashin@soleen.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2809C4167B for <linux-mm@archiver.kernel.org>; Thu, 30 Nov 2023 20:04:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4435B8D0051; Thu, 30 Nov 2023 15:04:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3F3BD8D0001; Thu, 30 Nov 2023 15:04:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2E2888D0051; Thu, 30 Nov 2023 15:04:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 1FCAE8D0001 for <linux-mm@kvack.org>; Thu, 30 Nov 2023 15:04:54 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id DE26616031E for <linux-mm@kvack.org>; Thu, 30 Nov 2023 20:04:53 +0000 (UTC) X-FDA: 81515698866.14.7AFE871 Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) by imf05.hostedemail.com (Postfix) with ESMTP id 187A1100022 for <linux-mm@kvack.org>; Thu, 30 Nov 2023 20:04:50 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=soleen.com header.s=google header.b=bD8TjcdJ; dmarc=none; spf=pass (imf05.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.160.174 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701374691; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=fJ0QwjQQA2sBtrYbspl5aVVUOMzblP9BjaUBDTeLH4Y=; b=arPxnwW+NNTxaW5/XeJgujxzfB+EezIqHb8sg90q+LHaMUXI1L9x65MOcaSJFqycJzlVem qRYYKtibxs9suy5ICPylfa6MtBV0Dk/vuA7Tev4BT71TniRSyEqITSVXPKul0JmYKLxDdk VQJ+rSs8luP7OqpE+aaQXppiVVrgbTU= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=soleen.com header.s=google header.b=bD8TjcdJ; dmarc=none; spf=pass (imf05.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.160.174 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701374691; a=rsa-sha256; cv=none; b=Hjpv7iZKCg9GJvFABUqb1XZvT9ZX7OLWebTLh7NBYlB/wAzcy1q06yY5ARUiEhCpU8p5Z4 90tFbGogovq8S5kRThMhnAm737X392zmoGx+Y18rLw7SkD1lm1bEEBAWUwu6Ia3h5DSnuU P3b4dAc/kf6JZOJPo2rPZ8Op9UEkF5Y= Received: by mail-qt1-f174.google.com with SMTP id d75a77b69052e-4239f5c1ec2so7943911cf.0 for <linux-mm@kvack.org>; Thu, 30 Nov 2023 12:04:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1701374690; x=1701979490; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=fJ0QwjQQA2sBtrYbspl5aVVUOMzblP9BjaUBDTeLH4Y=; b=bD8TjcdJIK8+nElhPYXKz9G8JLuo2TnC3Hx2adLqLzauUzkM+LCHwTKVziPrBO5vRD aEx+tiQgk+zHQPwx6vePXjAn+aI6y5rugYuSlDLQWQtFMJxV3vESL+lqS4jdChKTML63 w5vbZGivBPM/3jhZRTPNotnbZkO2ctDy52vkXBLG0FVWmTUZtbxru4PqQcSsW4KOC9LY hWIqU7d/lTHHhdWhtHGM9V7EN4bybvcr891UuvLcKuRx7f43njRRyOVZFjdlUwpRT0kE qtUPlHPlWwxA+ytMPQ6uEpW3BaCSWqAF0eG4dBVJJrsShKlt/04wTK0pHoFboCkLYoJw xAeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701374690; x=1701979490; 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=fJ0QwjQQA2sBtrYbspl5aVVUOMzblP9BjaUBDTeLH4Y=; b=WEWPkfqr3TsVpEyf4DPVrddghkjMu6z0tbMYF7+CsFZKWYrLYbOpVqPGrs2WhYVQII 8xGvsaBM8BkXiwWP6TSlnBDu/lZvtg2q2tVbtEsn7fZ6SuvY19f6j4qjEIvn7Ur2/wGT 3SiETih6N7/wTydwYSOqtrS1JBHx0a32oZcA8vlKDvmbZMw+SIawrcz+TcPa6gXfE0fN TU/BT1N8uYg3eSPHiScyoARcjjk+CwWZ5RL0iF2mkSKABxrA9DAfpSO6dfX4xon5V8N4 TPUxXquQU57EBYyFJQStXuQfMJetqb7vGi0H9AdsyRuE4xqbkRNjktNFUUgug4tIRhQu PX8Q== X-Gm-Message-State: AOJu0YxySHqt58X9w/QQa4ce7bOVYDRjQE8l/LXMXXd1wUinCxIw96bk PS+Optx1sZe/InvI4j1yl6LVzw== X-Google-Smtp-Source: AGHT+IFTod/Py9hcH5oQn6ff5l7Gu58O8B3tXKspAhOROVnCb0qH7k4XfRrSgp2nr3dD/2mySscuWA== X-Received: by 2002:ac8:7c46:0:b0:423:8e6a:f7a with SMTP id o6-20020ac87c46000000b004238e6a0f7amr26732427qtv.64.1701374690104; Thu, 30 Nov 2023 12:04:50 -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 f27-20020ac86edb000000b0041ea59e639bsm787447qtv.70.2023.11.30.12.04.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 12:04:49 -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 Subject: [PATCH] vhost-vdpa: account iommu allocations Date: Thu, 30 Nov 2023 20:04:47 +0000 Message-ID: <20231130200447.2319543-1-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.43.0.rc2.451.g8631bc7472-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Stat-Signature: as3an6owk9entah8rystjanusyckffhi X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 187A1100022 X-HE-Tag: 1701374690-885909 X-HE-Meta: U2FsdGVkX19/aAtmyfIF7bFTA40A4fCHTweXUtH68rgBLuU1WX+oDF/ZTA1pO0nzJe/UGYhxDhzyg1IC4wLycl1wRoGgptvtJ15v5RzDSHRs/rXhWtqTxke3KFcbwZOeXUGDin6LbvswPChArDAkV9MTk2MzeXeA3SiYeyetZ4ud8A+OLDDhSimqUg38zfnIfOPH+smFInZ+dUZx5m1b39OG9fzBJzlGkbLrt6dQmYMU+7Qa8ISyBGo9iEmqwJXYs6KSzb9WmzFTR7jnR0H/8JfbhUo282k8g17u1iDb5x2K4lmieiKdSGS9drhz/0vW3uw6WD7YCxkj3JFXhi+Dm5WbDYgZrM6/vKU2ARqd8dZeU95EqX8v3RKEZuJmzqvXCc62PyqZzIAa4qetvxYeHVPNlAXSJhQxee6fytQNZs0oGAxBczYq4TErHmMXcFlnE5CF6rMONzzeOuGwKSah+UE8MRBUlvwyUBw5gVxhtlH9t9MYtNX5ZIvNjc9d7E7CJAroa6xTnZj6SvTKaAJweaPflyuhmV6OFLysTY8SbVGh6sx16W+oebpPUgTH7+Q3wSu2P2Gu7KPk+v28Mw1xVkbfWdS4kKRcxIlFxddXQvfEgYiNegiu3SBZoCEofCffmiH8CdtsZAKdO8kICnuzYNcSdU7GHB1dBbeaSia9W9Xw1V/SghGXj0ZPg+PGevSavczDldP6+2ATk9wWCFVLaW4D2uyM2QkhdeLuzqU7rMSlL2DJvYHWfkIW9Qm7zRdozQLpPw6w3UtcK7Y3vprY1Xhp8uF4its7qIS8E1Seg3cgsx23FE3lXUk4xUfYVko2/OKMx6Xxh7wUXXaw2MuISoWnzd24UjzQGq/uoH/SV3DEpiOyj2ZzbAyjcAaYCBUmFihjazhR0BYbaW9anPoMudKoePwOtzScbKxdjGIZR3ttXf6qseEzFK5y/7RM7Qnh4+WHXJiS+xJ4pOAHa2n 2qzLZAAj ex2h+gr44D6nlK5/oxaR9HHkJCgLlG9mJIsLj9coemIhgoxmRpzZWJkIPppLluUCVxptxA1F9odVMkDAnNVhCXYAkEQymVgTeGZ7Vbkh02UJxpYfEQejz8Q/3jEsyikMl+0n272LuVupvWWBcZp08ghFC+fQCwZpfWnFq+BcAyPPBzdqf2SaFVo+Q6nUKqhK6jAraesBEF0ZgFX0h9EA5xrf8zeeeG4uZAFL3gXrD8yTdTwrcEG1RNC4V4FGk6fxOAssHPW4SH6b7had1Hbqug9sz03m7nYFotE3iRVtfgyjKzWDWbBvnlVlsDW3F7zW1kmraUV96Bv6WhxiUpuroPAxJaTeNecwVYxwC0DvY5eOJX+HstbJRVVhlkAwVKk78L8E5JD55rHBVeG01FJ9pSIUkGwrsU4L//ZpsXgZoiO22C9VshGVoocu9OgWlVUbJrOpxY933l58jZdg= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000433, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
vhost-vdpa: account iommu allocations
|
expand
|
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);
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(-) This patch is spinned of from the series: https://lore.kernel.org/all/20231128204938.1453583-1-pasha.tatashin@soleen.com