Re: [PATCH] mm/memcg: set memcg when split pages

2021-03-03 Thread Zhouguanghui (OS Kernel)
在 2021/3/3 15:46, Michal Hocko 写道: > On Tue 02-03-21 17:56:07, Johannes Weiner wrote: >> On Tue, Mar 02, 2021 at 12:24:41PM -0800, Hugh Dickins wrote: >>> On Tue, 2 Mar 2021, Michal Hocko wrote: [Cc Johannes for awareness and fixup Nick's email] On Tue 02-03-21 01:34:51, Zhou Guanghu

Re: [PATCH] mm/memcg: set memcg when split pages

2021-03-03 Thread Michal Hocko
On Tue 02-03-21 17:56:07, Johannes Weiner wrote: > On Tue, Mar 02, 2021 at 12:24:41PM -0800, Hugh Dickins wrote: > > On Tue, 2 Mar 2021, Michal Hocko wrote: > > > [Cc Johannes for awareness and fixup Nick's email] > > > > > > On Tue 02-03-21 01:34:51, Zhou Guanghui wrote: > > > > When split page,

Re: [PATCH] mm/memcg: set memcg when split pages

2021-03-03 Thread Hugh Dickins
On Tue, 2 Mar 2021, Johannes Weiner wrote: > On Tue, Mar 02, 2021 at 12:24:41PM -0800, Hugh Dickins wrote: > > On Tue, 2 Mar 2021, Michal Hocko wrote: > > > [Cc Johannes for awareness and fixup Nick's email] > > > > > > On Tue 02-03-21 01:34:51, Zhou Guanghui wrote: > > > > When split page, the me

Re: [PATCH] mm/memcg: set memcg when split pages

2021-03-03 Thread Johannes Weiner
On Tue, Mar 02, 2021 at 12:24:41PM -0800, Hugh Dickins wrote: > On Tue, 2 Mar 2021, Michal Hocko wrote: > > [Cc Johannes for awareness and fixup Nick's email] > > > > On Tue 02-03-21 01:34:51, Zhou Guanghui wrote: > > > When split page, the memory cgroup info recorded in first page is > > > not co

Re: [PATCH] mm/memcg: set memcg when split pages

2021-03-02 Thread Hugh Dickins
On Tue, 2 Mar 2021, Michal Hocko wrote: > [Cc Johannes for awareness and fixup Nick's email] > > On Tue 02-03-21 01:34:51, Zhou Guanghui wrote: > > When split page, the memory cgroup info recorded in first page is > > not copied to tail pages. In this case, when the tail pages are > > freed, the u

Re: [PATCH] mm/memcg: set memcg when split pages

2021-03-02 Thread Michal Hocko
On Tue 02-03-21 10:17:03, Michal Hocko wrote: > [Cc Johannes for awareness and fixup Nick's email] > > On Tue 02-03-21 01:34:51, Zhou Guanghui wrote: > > When split page, the memory cgroup info recorded in first page is > > not copied to tail pages. In this case, when the tail pages are > > freed,

Re: [PATCH] mm/memcg: set memcg when split pages

2021-03-02 Thread Michal Hocko
On Tue 02-03-21 10:37:13, Zi Yan wrote: [...] > I have a question on copy_page_memcg above. By reading > __memcg_kmem_charge_page > and __memcg_kmem_uncharge_page, it seems to me that every single page requires > a css_get(&memcg->css) at charge time and a css_put(&memcg->css) at uncharge > time.

Re: [PATCH] mm/memcg: set memcg when split pages

2021-03-02 Thread Zi Yan
On 2 Mar 2021, at 2:05, Zhouguanghui (OS Kernel) wrote: > 在 2021/3/2 10:00, Zi Yan 写道: >> On 1 Mar 2021, at 20:34, Zhou Guanghui wrote: >> >>> When split page, the memory cgroup info recorded in first page is >>> not copied to tail pages. In this case, when the tail pages are >>> freed, the unchar

Re: [PATCH] mm/memcg: set memcg when split pages

2021-03-02 Thread Michal Hocko
[Cc Johannes for awareness and fixup Nick's email] On Tue 02-03-21 01:34:51, Zhou Guanghui wrote: > When split page, the memory cgroup info recorded in first page is > not copied to tail pages. In this case, when the tail pages are > freed, the uncharge operation is not performed. As a result, the

Re: [PATCH] mm/memcg: set memcg when split pages

2021-03-02 Thread Zhouguanghui (OS Kernel)
在 2021/3/2 10:00, Zi Yan 写道: > On 1 Mar 2021, at 20:34, Zhou Guanghui wrote: > >> When split page, the memory cgroup info recorded in first page is >> not copied to tail pages. In this case, when the tail pages are >> freed, the uncharge operation is not performed. As a result, the >> usage of thi

Re: [PATCH] mm/memcg: set memcg when split pages

2021-03-01 Thread Zi Yan
On 1 Mar 2021, at 20:34, Zhou Guanghui wrote: > When split page, the memory cgroup info recorded in first page is > not copied to tail pages. In this case, when the tail pages are > freed, the uncharge operation is not performed. As a result, the > usage of this memcg keeps increasing, and the OOM

[PATCH] mm/memcg: set memcg when split pages

2021-03-01 Thread Zhou Guanghui
When split page, the memory cgroup info recorded in first page is not copied to tail pages. In this case, when the tail pages are freed, the uncharge operation is not performed. As a result, the usage of this memcg keeps increasing, and the OOM may occur. So, the copying of first page's memory cgr