]> Git Repo - linux.git/commit - drivers/vfio/container.c
vfio: Use GFP_KERNEL_ACCOUNT for userspace persistent allocations
authorJason Gunthorpe <[email protected]>
Sun, 8 Jan 2023 15:44:24 +0000 (17:44 +0200)
committerAlex Williamson <[email protected]>
Mon, 23 Jan 2023 18:26:29 +0000 (11:26 -0700)
commit0886196ca8810c5b1f5097b71c4bc0df40b10208
treece3b10ea0f808d9a692bcc057b18fd84031fdd97
parent83ff6095ecf8bafd095a921a2267227519f510f8
vfio: 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.

The way to find the relevant allocations was for example to look at the
close_device function and trace back all the kfrees to their
allocations.

Signed-off-by: Jason Gunthorpe <[email protected]>
Signed-off-by: Yishai Hadas <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alex Williamson <[email protected]>
drivers/vfio/container.c
drivers/vfio/pci/vfio_pci_config.c
drivers/vfio/pci/vfio_pci_core.c
drivers/vfio/pci/vfio_pci_igd.c
drivers/vfio/pci/vfio_pci_intrs.c
drivers/vfio/pci/vfio_pci_rdwr.c
drivers/vfio/virqfd.c
This page took 0.056749 seconds and 4 git commands to generate.