Re: [patch] mm, thp: abort compaction if migration page cannot becharged to memcg

From: David Rientjes
Date: Thu Jun 21 2012 - 06:16:47 EST


On Thu, 21 Jun 2012, Kamezawa Hiroyuki wrote:

> I guess the best way will be never calling charge/uncharge at migration.
> ....but it has been a battle with many race conditions..
>
> Here is an alternative way, remove -ENOMEM in mem_cgroup_prepare_migration()
> by using res_counter_charge_nofail().
>
> Could you try this ?

I would love to be able to remove the -ENOMEM as the result of charging
the temporary page, but what happens if all cpus are calling into
migrate_pages() that are unmapping pages from the same memcg? This need
not only be happening from compaction, either. It feels like this
wouldn't scale appropriately and you risk going significantly over the
limit even for a brief enough period of time. I'd hate to be 128K over my
limit on a machine with 32 cores.

Comments from the memcg folks on if this is acceptable?

In the interim, do you have an objection to merging this patch as bandaid
for stable?
--
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/