alistair23-linux/kernel/events
Oleg Nesterov 29dedee0e6 uprobes: Add mem_cgroup_charge_anon() into uprobe_write_opcode()
Hugh says:

    The one I noticed was that it forgets all about memcg (because
    it was copied from KSM, and there the replacement page has already
    been charged to a memcg). See how mm/memory.c do_anonymous_page()
    does a mem_cgroup_charge_anon().

Hopefully not a big problem, uprobes is a system-wide thing and only
root can insert the probes. But I agree, should be fixed anyway.

Add mem_cgroup_{un,}charge_anon() into uprobe_write_opcode(). To simplify
the error handling (and avoid the new "uncharge" label) the patch also
moves anon_vma_prepare() up before we alloc/charge the new page.

While at it fix the comment about ->mmap_sem, it is held for write.

Suggested-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
2014-05-14 13:57:24 +02:00
..
callchain.c perf: Roll back callchain buffer refcount under the callchain mutex 2013-08-16 17:55:50 +02:00
core.c perf: Allow building PMU drivers as modules 2014-04-18 12:54:45 +02:00
hw_breakpoint.c
internal.h perf: Fix arch_perf_out_copy_user default 2013-11-06 12:34:25 +01:00
Makefile
ring_buffer.c perf: Optimize ring-buffer write by depending on control dependencies 2013-12-11 15:53:22 +01:00
uprobes.c uprobes: Add mem_cgroup_charge_anon() into uprobe_write_opcode() 2014-05-14 13:57:24 +02:00