Skip to content

Commit

Permalink
res_counter: Account max_usage when calling res_counter_charge_nofail()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Frederic Weisbecker authored and Tejun Heo committed Apr 27, 2012
1 parent 4d8438f commit 0d4dde1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/res_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 0d4dde1

Please sign in to comment.