All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-memcg-set-memcg-when-split-page.patch added to -mm tree
@ 2021-03-05  1:53 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2021-03-05  1:53 UTC (permalink / raw)
  To: chenweilong, dingtianhong, guohanjun, hannes, hughd,
	kirill.shutemov, mhocko, mm-commits, npiggin, rui.xiang,
	shakeelb, wangkefeng.wang, zhouguanghui1, ziy


The patch titled
     Subject: mm/memcg: set memcg when split page
has been added to the -mm tree.  Its filename is
     mm-memcg-set-memcg-when-split-page.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/mm-memcg-set-memcg-when-split-page.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/mm-memcg-set-memcg-when-split-page.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Zhou Guanghui <zhouguanghui1@huawei.com>
Subject: mm/memcg: set memcg when split page

As described in the split_page function comment, for the non-compound high
order page, the sub-pages must be freed individually.  If the memcg of the
first page is valid, the tail pages cannot be uncharged when be freed.

For example, when alloc_pages_exact is used to allocate 1MB continuous
physical memory, 2MB is charged(kmemcg is enabled and __GFP_ACCOUNT is
set).  When make_alloc_exact free the unused 1MB and free_pages_exact free
the applied 1MB, actually, only 4KB(one page) is uncharged.

Therefore, the memcg of the tail page needs to be set when split page.

Link: https://lkml.kernel.org/r/20210304074053.65527-3-zhouguanghui1@huawei.com
Signed-off-by: Zhou Guanghui <zhouguanghui1@huawei.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
Cc: Hanjun Guo <guohanjun@huawei.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Rui Xiang <rui.xiang@huawei.com>
Cc: Tianhong Ding <dingtianhong@huawei.com>
Cc: Weilong Chen <chenweilong@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/page_alloc.c |    1 +
 1 file changed, 1 insertion(+)

--- a/mm/page_alloc.c~mm-memcg-set-memcg-when-split-page
+++ a/mm/page_alloc.c
@@ -3314,6 +3314,7 @@ void split_page(struct page *page, unsig
 	for (i = 1; i < (1 << order); i++)
 		set_page_refcounted(page + i);
 	split_page_owner(page, 1 << order);
+	split_page_memcg(page, 1 << order);
 }
 EXPORT_SYMBOL_GPL(split_page);
 
_

Patches currently in -mm which might be from zhouguanghui1@huawei.com are

mm-memcg-rename-mem_cgroup_split_huge_fixup-to-split_page_memcg.patch
mm-memcg-set-memcg-when-split-page.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-05  1:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-05  1:53 + mm-memcg-set-memcg-when-split-page.patch added to -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.