Re: [RFC] respect the referenced bit of KVM guest pages?

From: KAMEZAWA Hiroyuki
Date: Fri Aug 07 2009 - 04:26:33 EST


On Fri, 7 Aug 2009 13:24:34 +0530
Balbir Singh <balbir@xxxxxxxxxxxxxxxxxx> wrote:

> On Fri, Aug 7, 2009 at 8:41 AM, KOSAKI
> Motohiro<kosaki.motohiro@xxxxxxxxxxxxxx> wrote:
> > Current memcgroup logic also use recent_scan/recent_rotate statistics.
> > Isn't it enought?
>
> I don't understand the context, I'll look at the problem when I am
> back (I am away from work for the next few days).
>
Brief summary: (please point out if not correct)

prepare a memcg with
memory.limit_in_bytex=128MB

Run kvm on it, and use apps, those working-set is near to 256MB (then, heavy swap)
In this case,
- Anon memory are swapped-out even while there are file caches.
Especially, a page for stack which is frequently accessed can be
easily swapped out, again and again.

One of reasone is a recent change as:
"a page mapped with VM_EXEC is not pageout even if no reference"

Without memcg, a user can use Gigabytes of memory, above change
is very welcomed.

Then, current point is "how we can handle this case without bad effect".

One possibility I wonder is this is a problem of configuration mistake.
setting memory.memsw.limit_in_bytes to be proper value may change bahavior.
But it seems just a workaround.

Can't we find algorithmic/heuristic way to avoid too much swap-out ?
I think memcg can check # of swap-ins, but now, we don't have a tag
to see the sign of "recently swapped-out page is reused" case or
executable file pages are too much.

I wonder we can comapre
# of pageouted file-caches v.s. # of swapout anon.
and keeping "# of pageouted file-caches < # of swapout anon." (or use swappiness)
This state can be checked by recalim_stat. (per memcg)
Hmm?

I'm sorry I'll be on a trip Aug/11-Aug/17 and response will be delayed.

Thanks,
-Kame

--
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/