Messages in this thread | | | Date | Fri, 16 Oct 2015 15:19:22 -0700 | From | Johannes Weiner <> | Subject | Re: [PATCH 3/3] memcg: simplify and inline __mem_cgroup_from_kmem |
| |
On Fri, Oct 16, 2015 at 03:12:23PM -0700, Hugh Dickins wrote: > --- 4035m/mm/list_lru.c 2015-10-15 15:26:59.835572128 -0700 > +++ 4035M/mm/list_lru.c 2015-10-16 03:11:51.000000000 -0700 > @@ -63,6 +63,16 @@ list_lru_from_memcg_idx(struct list_lru_ > return &nlru->lru; > } > > +static __always_inline struct mem_cgroup *mem_cgroup_from_kmem(void *ptr) > +{ > + struct page *page; > + > + if (!memcg_kmem_enabled()) > + return NULL; > + page = virt_to_head_page(ptr); > + return page->mem_cgroup; > +} > + > static inline struct list_lru_one * > list_lru_from_kmem(struct list_lru_node *nlru, void *ptr) > {
I like this better than the mm.h include, too.
| |