Re: [PATCH 1/3] mm: memcg: remote memcg charging for kmem allocations

2018-06-20 Thread Johannes Weiner
On Tue, Jun 19, 2018 at 04:31:18PM -0700, Shakeel Butt wrote: > On Tue, Jun 19, 2018 at 9:22 AM Johannes Weiner wrote: > > > > On Mon, Jun 18, 2018 at 10:13:25PM -0700, Shakeel Butt wrote: > > > @@ -248,6 +248,30 @@ static inline void > > > memalloc_noreclaim_restore(unsigned int flags) > > >

Re: [PATCH 1/3] mm: memcg: remote memcg charging for kmem allocations

2018-06-20 Thread Johannes Weiner
On Tue, Jun 19, 2018 at 04:31:18PM -0700, Shakeel Butt wrote: > On Tue, Jun 19, 2018 at 9:22 AM Johannes Weiner wrote: > > > > On Mon, Jun 18, 2018 at 10:13:25PM -0700, Shakeel Butt wrote: > > > @@ -248,6 +248,30 @@ static inline void > > > memalloc_noreclaim_restore(unsigned int flags) > > >

Re: [PATCH 1/3] mm: memcg: remote memcg charging for kmem allocations

2018-06-19 Thread Shakeel Butt
On Tue, Jun 19, 2018 at 9:22 AM Johannes Weiner wrote: > > On Mon, Jun 18, 2018 at 10:13:25PM -0700, Shakeel Butt wrote: > > @@ -248,6 +248,30 @@ static inline void memalloc_noreclaim_restore(unsigned > > int flags) > > current->flags = (current->flags & ~PF_MEMALLOC) | flags; > > } > > >

Re: [PATCH 1/3] mm: memcg: remote memcg charging for kmem allocations

2018-06-19 Thread Shakeel Butt
On Tue, Jun 19, 2018 at 9:22 AM Johannes Weiner wrote: > > On Mon, Jun 18, 2018 at 10:13:25PM -0700, Shakeel Butt wrote: > > @@ -248,6 +248,30 @@ static inline void memalloc_noreclaim_restore(unsigned > > int flags) > > current->flags = (current->flags & ~PF_MEMALLOC) | flags; > > } > > >

Re: [PATCH 1/3] mm: memcg: remote memcg charging for kmem allocations

2018-06-19 Thread Johannes Weiner
On Mon, Jun 18, 2018 at 10:13:25PM -0700, Shakeel Butt wrote: > @@ -248,6 +248,30 @@ static inline void memalloc_noreclaim_restore(unsigned > int flags) > current->flags = (current->flags & ~PF_MEMALLOC) | flags; > } > > +#ifdef CONFIG_MEMCG > +static inline struct mem_cgroup

Re: [PATCH 1/3] mm: memcg: remote memcg charging for kmem allocations

2018-06-19 Thread Johannes Weiner
On Mon, Jun 18, 2018 at 10:13:25PM -0700, Shakeel Butt wrote: > @@ -248,6 +248,30 @@ static inline void memalloc_noreclaim_restore(unsigned > int flags) > current->flags = (current->flags & ~PF_MEMALLOC) | flags; > } > > +#ifdef CONFIG_MEMCG > +static inline struct mem_cgroup

[PATCH 1/3] mm: memcg: remote memcg charging for kmem allocations

2018-06-18 Thread Shakeel Butt
Introduce the memcg variant for kmalloc[_node] and kmem_cache_alloc[_node]. For kmem_cache_alloc, the kernel switches the root kmem cache with the memcg specific kmem cache for __GFP_ACCOUNT allocations to charge those allocations to the memcg. However, the memcg to charge is extracted from the

[PATCH 1/3] mm: memcg: remote memcg charging for kmem allocations

2018-06-18 Thread Shakeel Butt
Introduce the memcg variant for kmalloc[_node] and kmem_cache_alloc[_node]. For kmem_cache_alloc, the kernel switches the root kmem cache with the memcg specific kmem cache for __GFP_ACCOUNT allocations to charge those allocations to the memcg. However, the memcg to charge is extracted from the