From: Frederic Weisbecker <fweisbec@gmail.com>
To: Tejun Heo <tj@kernel.org>, Li Zefan <lizefan@huawei.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Glauber Costa <glommer@parallels.com>,
"Kirill A. Shutemov" <kirill@shutemov.name>
Subject: [PATCH 2/2] res_counter: Account max_usage when calling res_counter_charge_nofail()
Date: Wed, 25 Apr 2012 01:11:36 +0200 [thread overview]
Message-ID: <1335309096-12886-3-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1335309096-12886-1-git-send-email-fweisbec@gmail.com>
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>
Cc: Tejun Heo <tj@kernel.org>
Cc: Li Zefan <lizefan@huawei.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Glauber Costa <glommer@parallels.com>
Cc: Kirill A. Shutemov <kirill@shutemov.name>
---
kernel/res_counter.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/res_counter.c b/kernel/res_counter.c
index 07a2992..bebe2b1 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;
}
--
1.7.5.4
next prev parent reply other threads:[~2012-04-24 23:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-24 23:11 [PATCH 0/2] res_counter: Merge some common code Frederic Weisbecker
2012-04-24 23:11 ` [PATCH 1/2] res_counter: Merge res_counter_charge and res_counter_charge_nofail Frederic Weisbecker
2012-04-25 0:28 ` KAMEZAWA Hiroyuki
2012-04-25 14:40 ` Glauber Costa
2012-04-27 21:37 ` Tejun Heo
2012-04-24 23:11 ` Frederic Weisbecker [this message]
2012-04-25 0:29 ` [PATCH 2/2] res_counter: Account max_usage when calling res_counter_charge_nofail() KAMEZAWA Hiroyuki
2012-04-25 14:40 ` Glauber Costa
2012-04-27 21:38 ` Tejun Heo
2012-04-25 2:22 ` [PATCH 0/2] res_counter: Merge some common code Kirill A. Shutemov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1335309096-12886-3-git-send-email-fweisbec@gmail.com \
--to=fweisbec@gmail.com \
--cc=glommer@parallels.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome