Re: [RFC][PATCH] memcg: add valid check at allocating or freeing memory

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

 



Hi Daisuke-san,

two other things:

On Fri, Dec 24, 2010 at 09:31:31AM +0900, Daisuke Nishimura wrote:
> --- a/include/linux/memcontrol.h
> +++ b/include/linux/memcontrol.h
> @@ -146,6 +146,8 @@ unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order,
>  						gfp_t gfp_mask);
>  u64 mem_cgroup_get_limit(struct mem_cgroup *mem);
>  
> +bool mem_cgroup_bad_page_check(struct page *page);
> +void mem_cgroup_print_bad_page(struct page *page);

Can you put those under CONFIG_DEBUG_VM and the dummies below under
!CONFIG_CGROUP_MEM_RES_CTLR || !CONFIG_DEBUG_VM?

The most likely configuration on distro kernels is memcg enabled and
VM debugging disabled.  It would be good to save the unneeded function
calls in the allocator hotpath for the common case.

Also:

> @@ -336,6 +338,16 @@ u64 mem_cgroup_get_limit(struct mem_cgroup *mem)
>  	return 0;
>  }
>  
> +static inline bool
> +mem_cgroup_bad_page_check(struct page *page)
> +{
> +	return false;
> +}
> +
> +static void

That needs an `inline' as well.

Thanks!

	Hannes

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
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]