Re: [PATCH 3/3] memcg: simplify and inline __mem_cgroup_from_kmem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]