Re: [PATCH v1 3/4] mm: introduce page memcg flags

2020-09-25 Thread Johannes Weiner
On Thu, Sep 24, 2020 at 01:39:05PM -0700, Roman Gushchin wrote: > On Thu, Sep 24, 2020 at 04:01:22PM -0400, Johannes Weiner wrote: > > On Tue, Sep 22, 2020 at 01:36:59PM -0700, Roman Gushchin wrote: > > > The lowest bit in page->memcg_data is used to distinguish between > > > struct memory_cgroup p

Re: [PATCH v1 3/4] mm: introduce page memcg flags

2020-09-24 Thread Roman Gushchin
On Thu, Sep 24, 2020 at 04:01:22PM -0400, Johannes Weiner wrote: > On Tue, Sep 22, 2020 at 01:36:59PM -0700, Roman Gushchin wrote: > > The lowest bit in page->memcg_data is used to distinguish between > > struct memory_cgroup pointer and a pointer to a objcgs array. > > All checks and modifications

Re: [PATCH v1 3/4] mm: introduce page memcg flags

2020-09-24 Thread Johannes Weiner
On Tue, Sep 22, 2020 at 01:36:59PM -0700, Roman Gushchin wrote: > The lowest bit in page->memcg_data is used to distinguish between > struct memory_cgroup pointer and a pointer to a objcgs array. > All checks and modifications of this bit are open-coded. > > Let's formalize it using page memcg fla

Re: [PATCH v1 3/4] mm: introduce page memcg flags

2020-09-24 Thread Johannes Weiner
On Tue, Sep 22, 2020 at 01:36:59PM -0700, Roman Gushchin wrote: > @@ -422,7 +421,13 @@ static inline void clear_page_mem_cgroup(struct page > *page) > */ > static inline struct obj_cgroup **page_obj_cgroups(struct page *page) > { > - return (struct obj_cgroup **)(page->memcg_data & ~0x1UL)

Re: [PATCH v1 3/4] mm: introduce page memcg flags

2020-09-24 Thread Roman Gushchin
On Thu, Sep 24, 2020 at 12:03:35AM -0700, Shakeel Butt wrote: > On Tue, Sep 22, 2020 at 1:38 PM Roman Gushchin wrote: > > > > The lowest bit in page->memcg_data is used to distinguish between > > struct memory_cgroup pointer and a pointer to a objcgs array. > > All checks and modifications of this

Re: [PATCH v1 3/4] mm: introduce page memcg flags

2020-09-24 Thread Shakeel Butt
On Tue, Sep 22, 2020 at 1:38 PM Roman Gushchin wrote: > > The lowest bit in page->memcg_data is used to distinguish between > struct memory_cgroup pointer and a pointer to a objcgs array. > All checks and modifications of this bit are open-coded. > > Let's formalize it using page memcg flags, defi

[PATCH v1 3/4] mm: introduce page memcg flags

2020-09-22 Thread Roman Gushchin
The lowest bit in page->memcg_data is used to distinguish between struct memory_cgroup pointer and a pointer to a objcgs array. All checks and modifications of this bit are open-coded. Let's formalize it using page memcg flags, defined in page_memcg_flags enum and replace all open-coded accesses w