linux-stable/include
Mina Almasry e9fe92ae0c hugetlb_cgroup: add reservation accounting for private mappings
Normally the pointer to the cgroup to uncharge hangs off the struct page,
and gets queried when it's time to free the page.  With hugetlb_cgroup
reservations, this is not possible.  Because it's possible for a page to
be reserved by one task and actually faulted in by another task.

The best place to put the hugetlb_cgroup pointer to uncharge for
reservations is in the resv_map.  But, because the resv_map has different
semantics for private and shared mappings, the code patch to
charge/uncharge shared and private mappings is different.  This patch
implements charging and uncharging for private mappings.

For private mappings, the counter to uncharge is in
resv_map->reservation_counter.  On initializing the resv_map this is set
to NULL.  On reservation of a region in private mapping, the tasks
hugetlb_cgroup is charged and the hugetlb_cgroup is placed is
resv_map->reservation_counter.

On hugetlb_vm_op_close, we uncharge resv_map->reservation_counter.

[akpm@linux-foundation.org: forward declare struct resv_map]
Signed-off-by: Mina Almasry <almasrymina@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Greg Thelen <gthelen@google.com>
Cc: Sandipan Das <sandipan@linux.ibm.com>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: Shuah Khan <shuah@kernel.org>
Link: http://lkml.kernel.org/r/20200211213128.73302-3-almasrymina@google.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-04-02 09:35:32 -07:00
..
acpi Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2020-03-30 16:17:15 -07:00
asm-generic asm-generic: make more kernel-space headers mandatory 2020-04-02 09:35:25 -07:00
clocksource clocksource/drivers/timer-ti-dm: Implement cpu_pm notifier for context save and restore 2020-03-16 12:40:29 +01:00
crypto
drm drm/dp_mst: Use full_pbn instead of available_pbn for bandwidth checks 2020-03-12 19:07:24 -04:00
dt-bindings media updates for v5.7-rc1 2020-03-30 13:42:05 -07:00
keys
kunit
kvm irqchip/gic-v4.1: Move doorbell management to the GICv4 abstraction layer 2020-03-24 12:15:51 +00:00
linux hugetlb_cgroup: add reservation accounting for private mappings 2020-04-02 09:35:32 -07:00
math-emu
media media: cec-notifier: make cec_notifier_get_conn() static 2020-03-20 09:02:45 +01:00
misc
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-03-31 17:29:33 -07:00
pcmcia
ras
rdma
scsi scsi: simplify scsi_partsize 2020-03-24 07:57:07 -06:00
soc net: dsa: felix: add port policers 2020-03-30 11:44:00 -07:00
sound
target
trace mm: mmap: add trace point of vm_unmapped_area 2020-04-02 09:35:30 -07:00
uapi mm/mremap: add MREMAP_DONTUNMAP to mremap() 2020-04-02 09:35:30 -07:00
vdso vdso: Fix clocksource.h macro detection 2020-03-23 18:51:08 +01:00
video
xen