[RFC][PATCH 0/2] memcg: some updates to move_account and file_statraces

From: KAMEZAWA Hiroyuki
Date: Fri Oct 15 2010 - 04:12:04 EST



At implementing dirty page accounting support, one of problem is that
PG_writeback update can be called in IRQ context. So, following kind of dead-lock
can be considered.

lock_page_cgroup()
<--------------- IRQ
try to update Writeback state of memcg
lock_page_cgroup()
DEAD LOCK

To avoid this, one idea is IRQ disabling in lock_page_cgroup() but our concern is
it's too heavy.

Considering more, there are facts
- why update_file_stat() has to take lock_page_cgroup() is just for avoiding
race with move_account(). There are no race with charge/uncharge.

So, this series adds a new lock for mutual exection of move_account() and
update_file_stat(). This lock is always taken under IRQ disable.
This adds new lock to move_account()....so this makes move_account() slow.
It's a trade-off to be considered.


This series contains 2 patches. One is a trial to performance improvement,
next one is adding a new lock.
They are independent from each other.
All are onto mmotm-1014 + removing memcg-reduce-lock-hold-time-during-charge-moving.patch

Scores on my box at moving 8GB anon process.

== mmotm ==
root@bluextal kamezawa]# time echo 2530 > /cgroup/B/tasks

real 0m0.792s
user 0m0.000s
sys 0m0.780s

== After patch 1==
[root@bluextal kamezawa]# time echo 2257 > /cgroup/B/tasks

real 0m0.694s
user 0m0.000s
sys 0m0.683s

[After Patch #2]
[root@bluextal kamezawa]# time echo 2238 > /cgroup/B/tasks

real 0m0.741s
user 0m0.000s
sys 0m0.730s

Any comments/advices are welcome.

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/