res_counter: Account max_usage when calling res_counter_charge_nofail()
authorFrederic Weisbecker <[email protected]>
Tue, 24 Apr 2012 23:11:36 +0000 (01:11 +0200)
committerTejun Heo <[email protected]>
Fri, 27 Apr 2012 21:37:09 +0000 (14:37 -0700)
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 <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
Acked-by: KAMEZAWA Hiroyuki <[email protected]>
Acked-by: Glauber Costa <[email protected]>
Acked-by: Kirill A. Shutemov <[email protected]>
Cc: Li Zefan <[email protected]>
kernel/res_counter.c

index 07a29923aba21c13016f9b6b0d83f00b0d1fad60..bebe2b170d49ffd4c5b96590114f40d4d9fb69f9 100644 (file)
@@ -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;
 }