summaryrefslogtreecommitdiff
path: root/drivers/vfio/platform/vfio_platform_common.c
diff options
context:
space:
mode:
authorYishai Hadas <yishaih@nvidia.com>2023-01-08 18:44:27 +0300
committerAlex Williamson <alex.williamson@redhat.com>2023-01-23 21:26:30 +0300
commit7658aeda334a624634b2ed0538feee374e24e1e3 (patch)
tree33056c5af5b9665c81e94dcde160df70cb8d98f3 /drivers/vfio/platform/vfio_platform_common.c
parent4a6c971a06ffc1d51bd26c03051d52c2e5977878 (diff)
downloadlinux-7658aeda334a624634b2ed0538feee374e24e1e3.tar.xz
vfio/platform: Use GFP_KERNEL_ACCOUNT for userspace persistent allocations
Use GFP_KERNEL_ACCOUNT for userspace persistent allocations. The GFP_KERNEL_ACCOUNT option lets the memory allocator know that this is untrusted allocation triggered from userspace and should be a subject of kmem accounting, and as such it is controlled by the cgroup mechanism. Signed-off-by: Yishai Hadas <yishaih@nvidia.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/20230108154427.32609-7-yishaih@nvidia.com Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio/platform/vfio_platform_common.c')
-rw-r--r--drivers/vfio/platform/vfio_platform_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/vfio/platform/vfio_platform_common.c b/drivers/vfio/platform/vfio_platform_common.c
index a9ad3f4d2613..9f27e8c30c92 100644
--- a/drivers/vfio/platform/vfio_platform_common.c
+++ b/drivers/vfio/platform/vfio_platform_common.c
@@ -142,7 +142,7 @@ static int vfio_platform_regions_init(struct vfio_platform_device *vdev)
cnt++;
vdev->regions = kcalloc(cnt, sizeof(struct vfio_platform_region),
- GFP_KERNEL);
+ GFP_KERNEL_ACCOUNT);
if (!vdev->regions)
return -ENOMEM;