From: Frederic Weisbecker Date: Tue, 24 Apr 2012 23:11:36 +0000 (+0200) Subject: res_counter: Account max_usage when calling res_counter_charge_nofail() X-Git-Tag: firefly_0821_release~3680^2~2820^2 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=0d4dde1ac9a5af74ac76c6ab90557d1ae7b8f5d8;p=firefly-linux-kernel-4.4.55.git res_counter: Account max_usage when calling res_counter_charge_nofail() Updating max_usage is something one would expect when we reach a new maximum usage value even when we do this by forcing through the limit with res_counter_charge_nofail(). (Whether we want to account failcnt when we force through the limit is another debate). Signed-off-by: Frederic Weisbecker Signed-off-by: Tejun Heo Acked-by: KAMEZAWA Hiroyuki Acked-by: Glauber Costa Acked-by: Kirill A. Shutemov Cc: Li Zefan --- diff --git a/kernel/res_counter.c b/kernel/res_counter.c index 07a29923aba2..bebe2b170d49 100644 --- a/kernel/res_counter.c +++ b/kernel/res_counter.c @@ -35,7 +35,7 @@ int res_counter_charge_locked(struct res_counter *counter, unsigned long val, } counter->usage += val; - if (!force && counter->usage > counter->max_usage) + if (counter->usage > counter->max_usage) counter->max_usage = counter->usage; return ret; }