Commit 0d4dde1a authored by Frederic Weisbecker's avatar Frederic Weisbecker Committed by Tejun Heo

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: default avatarFrederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Acked-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: default avatarGlauber Costa <glommer@parallels.com>
Acked-by: default avatarKirill A. Shutemov <kirill@shutemov.name>
Cc: Li Zefan <lizefan@huawei.com>
parent 4d8438f0
...@@ -35,7 +35,7 @@ int res_counter_charge_locked(struct res_counter *counter, unsigned long val, ...@@ -35,7 +35,7 @@ int res_counter_charge_locked(struct res_counter *counter, unsigned long val,
} }
counter->usage += val; counter->usage += val;
if (!force && counter->usage > counter->max_usage) if (counter->usage > counter->max_usage)
counter->max_usage = counter->usage; counter->max_usage = counter->usage;
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment