Re: [PATCH v2 2/2] mm/memcg: set memcg when split page

2021-03-18 Thread Johannes Weiner
On Thu, Mar 18, 2021 at 03:05:00PM +0100, Michal Hocko wrote: > On Thu 11-03-21 12:37:20, Hugh Dickins wrote: > > On Thu, 11 Mar 2021, Michal Hocko wrote: > > > On Thu 11-03-21 10:21:39, Johannes Weiner wrote: > > > > On Thu, Mar 11, 2021 at 09:37:02AM +0100, Michal Hocko wrote: > > > > > Johannes,

Re: [PATCH v2 2/2] mm/memcg: set memcg when split page

2021-03-18 Thread Matthew Wilcox
On Thu, Mar 18, 2021 at 03:05:00PM +0100, Michal Hocko wrote: > On Thu 11-03-21 12:37:20, Hugh Dickins wrote: > > On Thu, 11 Mar 2021, Michal Hocko wrote: > > > On Thu 11-03-21 10:21:39, Johannes Weiner wrote: > > > > On Thu, Mar 11, 2021 at 09:37:02AM +0100, Michal Hocko wrote: > > > > > Johannes,

Re: [PATCH v2 2/2] mm/memcg: set memcg when split page

2021-03-18 Thread Michal Hocko
On Thu 11-03-21 12:37:20, Hugh Dickins wrote: > On Thu, 11 Mar 2021, Michal Hocko wrote: > > On Thu 11-03-21 10:21:39, Johannes Weiner wrote: > > > On Thu, Mar 11, 2021 at 09:37:02AM +0100, Michal Hocko wrote: > > > > Johannes, Hugh, > > > > > > > > what do you think about this approach? If we wan

Re: [PATCH v2 2/2] mm/memcg: set memcg when split page

2021-03-11 Thread Hugh Dickins
On Thu, 11 Mar 2021, Michal Hocko wrote: > On Thu 11-03-21 10:21:39, Johannes Weiner wrote: > > On Thu, Mar 11, 2021 at 09:37:02AM +0100, Michal Hocko wrote: > > > Johannes, Hugh, > > > > > > what do you think about this approach? If we want to stick with > > > split_page approach then we need to

Re: [PATCH v2 2/2] mm/memcg: set memcg when split page

2021-03-11 Thread Michal Hocko
On Thu 11-03-21 10:21:39, Johannes Weiner wrote: > On Thu, Mar 11, 2021 at 09:37:02AM +0100, Michal Hocko wrote: > > Johannes, Hugh, > > > > what do you think about this approach? If we want to stick with > > split_page approach then we need to update the missing place Matthew has > > pointed out.

Re: [PATCH v2 2/2] mm/memcg: set memcg when split page

2021-03-11 Thread Matthew Wilcox
On Thu, Mar 11, 2021 at 10:21:39AM -0500, Johannes Weiner wrote: > On Thu, Mar 11, 2021 at 09:37:02AM +0100, Michal Hocko wrote: > > Johannes, Hugh, > > > > what do you think about this approach? If we want to stick with > > split_page approach then we need to update the missing place Matthew has

Re: [PATCH v2 2/2] mm/memcg: set memcg when split page

2021-03-11 Thread Johannes Weiner
On Thu, Mar 11, 2021 at 09:37:02AM +0100, Michal Hocko wrote: > Johannes, Hugh, > > what do you think about this approach? If we want to stick with > split_page approach then we need to update the missing place Matthew has > pointed out. I find the __free_pages() code quite tricky as well. But fo

Re: [PATCH v2 2/2] mm/memcg: set memcg when split page

2021-03-11 Thread Michal Hocko
Johannes, Hugh, what do you think about this approach? If we want to stick with split_page approach then we need to update the missing place Matthew has pointed out. On Tue 09-03-21 14:03:36, Michal Hocko wrote: > On Tue 09-03-21 12:32:55, Matthew Wilcox wrote: > > On Tue, Mar 09, 2021 at 10:02:0

Re: [PATCH v2 2/2] mm/memcg: set memcg when split page

2021-03-09 Thread Michal Hocko
On Tue 09-03-21 12:32:55, Matthew Wilcox wrote: > On Tue, Mar 09, 2021 at 10:02:00AM +0100, Michal Hocko wrote: [...] > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > > index 913c2b9e5c72..d44dea2b8d22 100644 > > --- a/mm/memcontrol.c > > +++ b/mm/memcontrol.c > > @@ -3135,8 +3135,21 @@ int __m

Re: [PATCH v2 2/2] mm/memcg: set memcg when split page

2021-03-09 Thread Matthew Wilcox
On Tue, Mar 09, 2021 at 10:02:00AM +0100, Michal Hocko wrote: > On Mon 08-03-21 21:02:25, Matthew Wilcox wrote: > > On Thu, Mar 04, 2021 at 07:40:53AM +, Zhou Guanghui wrote: > > > For example, when alloc_pages_exact is used to allocate 1MB continuous > > > physical memory, 2MB is charged(kmemc

Re: [PATCH v2 2/2] mm/memcg: set memcg when split page

2021-03-09 Thread Michal Hocko
On Mon 08-03-21 21:02:25, Matthew Wilcox wrote: > On Thu, Mar 04, 2021 at 07:40:53AM +, Zhou Guanghui wrote: > > 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 fisrt page is valid, the

Re: [PATCH v2 2/2] mm/memcg: set memcg when split page

2021-03-08 Thread Andrew Morton
On Mon, 8 Mar 2021 20:47:31 + Matthew Wilcox wrote: > On Mon, Mar 08, 2021 at 12:42:27PM -0800, Andrew Morton wrote: > > On Mon, 8 Mar 2021 09:41:38 +0100 Michal Hocko wrote: > > > > > On Fri 05-03-21 15:58:40, Andrew Morton wrote: > > > > On Fri, 5 Mar 2021 12:52:52 +0100 Michal Hocko wro

Re: [PATCH v2 2/2] mm/memcg: set memcg when split page

2021-03-08 Thread Matthew Wilcox
On Thu, Mar 04, 2021 at 07:40:53AM +, Zhou Guanghui wrote: > 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 fisrt page is valid, the tail pages cannot be uncharged > when be freed. > > For

Re: [PATCH v2 2/2] mm/memcg: set memcg when split page

2021-03-08 Thread Matthew Wilcox
On Mon, Mar 08, 2021 at 12:42:27PM -0800, Andrew Morton wrote: > On Mon, 8 Mar 2021 09:41:38 +0100 Michal Hocko wrote: > > > On Fri 05-03-21 15:58:40, Andrew Morton wrote: > > > On Fri, 5 Mar 2021 12:52:52 +0100 Michal Hocko wrote: > > > > > > > On Thu 04-03-21 07:40:53, Zhou Guanghui wrote: >

Re: [PATCH v2 2/2] mm/memcg: set memcg when split page

2021-03-08 Thread Andrew Morton
On Mon, 8 Mar 2021 09:41:38 +0100 Michal Hocko wrote: > On Fri 05-03-21 15:58:40, Andrew Morton wrote: > > On Fri, 5 Mar 2021 12:52:52 +0100 Michal Hocko wrote: > > > > > On Thu 04-03-21 07:40:53, Zhou Guanghui wrote: > > > > As described in the split_page function comment, for the non-compound

Re: [PATCH v2 2/2] mm/memcg: set memcg when split page

2021-03-08 Thread Michal Hocko
On Fri 05-03-21 15:58:40, Andrew Morton wrote: > On Fri, 5 Mar 2021 12:52:52 +0100 Michal Hocko wrote: > > > On Thu 04-03-21 07:40:53, Zhou Guanghui wrote: > > > As described in the split_page function comment, for the non-compound > > > high order page, the sub-pages must be freed individually.

Re: [PATCH v2 2/2] mm/memcg: set memcg when split page

2021-03-05 Thread Andrew Morton
On Fri, 5 Mar 2021 12:52:52 +0100 Michal Hocko wrote: > On Thu 04-03-21 07:40:53, Zhou Guanghui wrote: > > 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 fisrt page is valid, the tail pag

Re: [PATCH v2 2/2] mm/memcg: set memcg when split page

2021-03-05 Thread Michal Hocko
On Thu 04-03-21 07:40:53, Zhou Guanghui wrote: > 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 fisrt page is valid, the tail pages cannot be uncharged > when be freed. > > For example, when a

Re: [PATCH v2 2/2] mm/memcg: set memcg when split page

2021-03-04 Thread Shakeel Butt
On Wed, Mar 3, 2021 at 11:57 PM Zhou Guanghui wrote: > > 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 fisrt page is valid, the tail pages cannot be uncharged > when be freed. > > For example

Re: [PATCH v2 2/2] mm/memcg: set memcg when split page

2021-03-04 Thread Zi Yan
On 4 Mar 2021, at 2:40, Zhou Guanghui wrote: > 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 fisrt page is valid, the tail pages cannot be uncharged s/fisrt/first/ > when be freed. > > For

Re: [PATCH v2 2/2] mm/memcg: set memcg when split page

2021-03-04 Thread Johannes Weiner
On Thu, Mar 04, 2021 at 07:40:53AM +, Zhou Guanghui wrote: > 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 fisrt page is valid, the tail pages cannot be uncharged > when be freed. > > For

[PATCH v2 2/2] mm/memcg: set memcg when split page

2021-03-03 Thread Zhou Guanghui
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 fisrt page is valid, the tail pages cannot be uncharged when be freed. For example, when alloc_pages_exact is used to allocate 1MB continuous physica