Re: [PATCH] remove memory.limit v.s. memsw.limit comparison.

From: KAMEZAWA Hiroyuki
Date: Thu Jun 04 2009 - 22:22:21 EST


On Fri, 5 Jun 2009 09:34:20 +0900
Daisuke Nishimura <nishimura@xxxxxxxxxxxxxxxxx> wrote:
> > Sorry, I don't push this patch as this is. But adding documentation about
> > "What happens when you set memory.limit == memsw.limit" will be necessary.
> >
> I agree.
>
I'd like to prepare some.

> > ...maybe give all jobs to user-land and keep the kernel as it is now
> > is a good choice.
> >
> > BTW, I'd like to avoid useless swap-out in memory.limit == memsw.limit case.
> > If someone has good idea, please :(
> >
> I think so too.
>
> From my simple thoughts, how about changing __mem_cgroup_try_charge() like:
>
> 1. initialize "noswap" as "bool noswap = !!(mem->res.limit == mem->memsw.limit)".
> 2. add check "if (mem->res.limit == mem->memsw.limit)" on charge failure to mem->res
> and set "noswap" to true if needed.
> 3. charge mem->memsw before mem->res.
>
> There would be other ideas, but I prefer 1 among these choices.
>
ok, thank you for advices.

Regards,
-Kame


>
> Thanks,
> Daisuke Nishimura.
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/