diff options
author | Ingo Molnar <mingo@kernel.org> | 2013-09-20 12:00:42 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-09-20 12:01:01 +0200 |
commit | 40a0c68ca9b49fb3e7292c1bae035ba5bcb27903 (patch) | |
tree | 11682834d3442d4640c4464709a76a268869ffbd /kernel/res_counter.c | |
parent | c61037e905a5cb74c7d786c35ee2cdbab9ed63af (diff) | |
parent | 7e3115ef5149fc502e3a2e80719dba54a8e7409d (diff) |
Merge branch 'sched/urgent' into sched/core
Merge in the latest fixes before applying a dependent patch.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/res_counter.c')
-rw-r--r-- | kernel/res_counter.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/kernel/res_counter.c b/kernel/res_counter.c index ff55247e704..4aa8a305aed 100644 --- a/kernel/res_counter.c +++ b/kernel/res_counter.c @@ -17,8 +17,8 @@ void res_counter_init(struct res_counter *counter, struct res_counter *parent) { spin_lock_init(&counter->lock); - counter->limit = RESOURCE_MAX; - counter->soft_limit = RESOURCE_MAX; + counter->limit = RES_COUNTER_MAX; + counter->soft_limit = RES_COUNTER_MAX; counter->parent = parent; } @@ -178,23 +178,30 @@ u64 res_counter_read_u64(struct res_counter *counter, int member) #endif int res_counter_memparse_write_strategy(const char *buf, - unsigned long long *res) + unsigned long long *resp) { char *end; + unsigned long long res; - /* return RESOURCE_MAX(unlimited) if "-1" is specified */ + /* return RES_COUNTER_MAX(unlimited) if "-1" is specified */ if (*buf == '-') { - *res = simple_strtoull(buf + 1, &end, 10); - if (*res != 1 || *end != '\0') + res = simple_strtoull(buf + 1, &end, 10); + if (res != 1 || *end != '\0') return -EINVAL; - *res = RESOURCE_MAX; + *resp = RES_COUNTER_MAX; return 0; } - *res = memparse(buf, &end); + res = memparse(buf, &end); if (*end != '\0') return -EINVAL; - *res = PAGE_ALIGN(*res); + if (PAGE_ALIGN(res) >= res) + res = PAGE_ALIGN(res); + else + res = RES_COUNTER_MAX; + + *resp = res; + return 0; } |