vfio/platform: Use GFP_KERNEL_ACCOUNT for userspace persistent allocations
authorYishai Hadas <yishaih@nvidia.com>
Sun, 8 Jan 2023 15:44:27 +0000 (17:44 +0200)
committerAlex Williamson <alex.williamson@redhat.com>
Mon, 23 Jan 2023 18:26:30 +0000 (11:26 -0700)
commit7658aeda334a624634b2ed0538feee374e24e1e3
tree33056c5af5b9665c81e94dcde160df70cb8d98f3
parent4a6c971a06ffc1d51bd26c03051d52c2e5977878
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>
drivers/vfio/platform/vfio_platform_common.c
drivers/vfio/platform/vfio_platform_irq.c