Re: [PATCHv9 03/36] memcg: adjust to support new THP refcounting
From: Jerome Marchand <hidden>
Date: 2015-07-31 14:46:49
Also in:
lkml
Attachments
- signature.asc [application/pgp-signature] 473 bytes
From: Jerome Marchand <hidden>
Date: 2015-07-31 14:46:49
Also in:
lkml
On 07/20/2015 04:20 PM, Kirill A. Shutemov wrote:
As with rmap, with new refcounting we cannot rely on PageTransHuge() to check if we need to charge size of huge page form the cgroup. We need to get information from caller to know whether it was mapped with PMD or PTE. We do uncharge when last reference on the page gone. At that point if we see PageTransHuge() it means we need to unchange whole huge page. The tricky part is partial unmap -- when we try to unmap part of huge page. We don't do a special handing of this situation, meaning we don't uncharge the part of huge page unless last user is gone or split_huge_page() is triggered. In case of cgroup memory pressure happens the partial unmapped page will be split through shrinker. This should be good enough. Signed-off-by: Kirill A. Shutemov <redacted> Tested-by: Sasha Levin <redacted> Tested-by: Aneesh Kumar K.V <redacted> Acked-by: Vlastimil Babka <redacted>
Acked-by: Jerome Marchand <redacted>
--- include/linux/memcontrol.h | 16 +++++++----- kernel/events/uprobes.c | 7 +++--- mm/filemap.c | 8 +++--- mm/huge_memory.c | 33 ++++++++++++------------ mm/memcontrol.c | 62 +++++++++++++++++----------------------------- mm/memory.c | 28 ++++++++++----------- mm/shmem.c | 21 +++++++++------- mm/swapfile.c | 9 ++++--- mm/userfaultfd.c | 6 ++--- 9 files changed, 92 insertions(+), 98 deletions(-)