diff options
author | Yishai Hadas <yishaih@nvidia.com> | 2023-01-08 18:44:26 +0300 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2023-01-23 21:26:30 +0300 |
commit | 4a6c971a06ffc1d51bd26c03051d52c2e5977878 (patch) | |
tree | 5e9b2338ee8b536f0b96fd07a14635c36a51335c /drivers/vfio/fsl-mc/vfio_fsl_mc.c | |
parent | cb8285b89f2cf1db866f5c5aae5ce8db7aef41dd (diff) | |
download | linux-4a6c971a06ffc1d51bd26c03051d52c2e5977878.tar.xz |
vfio/fsl-mc: 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-6-yishaih@nvidia.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio/fsl-mc/vfio_fsl_mc.c')
-rw-r--r-- | drivers/vfio/fsl-mc/vfio_fsl_mc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/vfio/fsl-mc/vfio_fsl_mc.c b/drivers/vfio/fsl-mc/vfio_fsl_mc.c index defeb8510ace..c89a047a4cd8 100644 --- a/drivers/vfio/fsl-mc/vfio_fsl_mc.c +++ b/drivers/vfio/fsl-mc/vfio_fsl_mc.c @@ -28,7 +28,7 @@ static int vfio_fsl_mc_open_device(struct vfio_device *core_vdev) int i; vdev->regions = kcalloc(count, sizeof(struct vfio_fsl_mc_region), - GFP_KERNEL); + GFP_KERNEL_ACCOUNT); if (!vdev->regions) return -ENOMEM; |