[PATCH][RFC] memory.min_usage again
kamezawa.hiroyu at jp.fujitsu.com
Sun Sep 28 19:55:13 PDT 2008
On Mon, 29 Sep 2008 09:43:32 +0900 (JST)
yamamoto at valinux.co.jp (YAMAMOTO Takashi) wrote:
> > >
> > > I would prefer to see some heuristics around such a feature, mostly around the
> > > priority that do_try_to_free_pages() to determine how desperate we are for
> > > reclaiming memory.
> > >
> > Taking "priority" of memory reclaim path into account is good.
> > ==
> > static unsigned long shrink_inactive_list(unsigned long max_scan,
> > struct zone *zone, struct scan_control *sc,
> > int priority, int file)
> > ==
> > How about ignore min_usage if "priority < DEF_PRIORITY - 2" ?
> are you suggesting ignoring mlock etc as well in that case?
No. Just freeing pages, which are usually freed is good.
int mem_cgroup_canreclaim(struct page *page, struct mem_cgroup *mem1,
struct page_cgroup *pc;
int result = 1;
if (mem1 != NULL)
/* global lru is busy ? */
if (priority < DEF_PEIORITY - 1)
Maybe min_usage can works as *soft* mlock by this.
Or another idea.
Making memory.min_usage as memory.reclaim_priority_level and allows
priority_level == 0 => can_reclaim() returns 1 always.
priority_level == 1 => can_reclaim returns 1 if priority < DEF_PRIORITY-1.
priority_level == 2 => can_reclaim returns 1 if priority < DEF_PRIORITY-2.
(and only 0,1,2 are allowed.)
setting min_usage will not be prefered by lru management people.
This can work as "advice" to global lru.
More information about the Containers