Re: [RFC][PATCH 5/11] memcg: account move and change force_empty

Randy Dunlap
2008-10-24T04:28:37Z

On Thu, 23 Oct 2008 18:05:38 +0900 KAMEZAWA Hiroyuki wrote:

> Documentation/controllers/memory.txt | 12 -
> mm/memcontrol.c | 277 ++++++++++++++++++++++++++---------
> 2 files changed, 214 insertions(+), 75 deletions(-)
>
> Index: mmotm-2.6.27+/mm/memcontrol.c
> ===================================================================
> --- mmotm-2.6.27+.orig/mm/memcontrol.c
> +++ mmotm-2.6.27+/mm/memcontrol.c
> @@ -538,6 +533,25 @@ nomem:
> return -ENOMEM;
> }
>
> +/**
> + * mem_cgroup_try_charge - get charge of PAGE_SIZE.
> + * @mm: an mm_struct which is charged against. (when *memcg is NULL)
> + * @gfp_mask: gfp_mask for reclaim.
> + * @memcg: a pointer to memory cgroup which is charged against.
> + *
> + * charge aginst memory cgroup pointed by *memcg. if *memcg == NULL, estimated
> + * memory cgroup from @mm is got and stored in *memcg.
> + *
> + * Retruns 0 if success. -ENOMEM at failure.

Returns

> + * This call can invoce OOM-Killer.

invoke

> + */

---
~Randy