> But it seems to me worrying and fragile while they diverge in this way.
Well...
you are right.
Hmm.. OK, I propse alternative way.
step1: commit this patch
step2: implement active/inactive anon balancing routine
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Thank you for good patch.
btw, furtunately, memcg reclaim has some retry.
thus, lru imbalancing doesn't cause OOM, it only cause small performance degression.
IMHO your patch doesn't have any risk.
--