Commit 0d4dde1ac9a5af74ac76c6ab90557d1ae7b8f5d8

Authored by Frederic Weisbecker
Committed by Tejun Heo
1 parent 4d8438f044

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 <fweisbec@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Glauber Costa <glommer@parallels.com>
Acked-by: Kirill A. Shutemov <kirill@shutemov.name>
Cc: Li Zefan <lizefan@huawei.com>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

kernel/res_counter.c
... ... @@ -35,7 +35,7 @@
35 35 }
36 36  
37 37 counter->usage += val;
38   - if (!force && counter->usage > counter->max_usage)
  38 + if (counter->usage > counter->max_usage)
39 39 counter->max_usage = counter->usage;
40 40 return ret;
41 41 }