diff options
-rw-r--r-- | include/linux/res_counter.h | 2 | ||||
-rw-r--r-- | kernel/res_counter.c | 8 | ||||
-rw-r--r-- | mm/memcontrol.c | 4 | ||||
-rw-r--r-- | net/ipv4/tcp_memcontrol.c | 10 |
4 files changed, 12 insertions, 12 deletions
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h index 586bc7cb1dcf..201a69749659 100644 --- a/include/linux/res_counter.h +++ b/include/linux/res_counter.h | |||
@@ -54,7 +54,7 @@ struct res_counter { | |||
54 | struct res_counter *parent; | 54 | struct res_counter *parent; |
55 | }; | 55 | }; |
56 | 56 | ||
57 | #define RESOURCE_MAX ULLONG_MAX | 57 | #define RES_COUNTER_MAX ULLONG_MAX |
58 | 58 | ||
59 | /** | 59 | /** |
60 | * Helpers to interact with userspace | 60 | * Helpers to interact with userspace |
diff --git a/kernel/res_counter.c b/kernel/res_counter.c index ff55247e7049..3f0417f97e76 100644 --- a/kernel/res_counter.c +++ b/kernel/res_counter.c | |||
@@ -17,8 +17,8 @@ | |||
17 | void res_counter_init(struct res_counter *counter, struct res_counter *parent) | 17 | void res_counter_init(struct res_counter *counter, struct res_counter *parent) |
18 | { | 18 | { |
19 | spin_lock_init(&counter->lock); | 19 | spin_lock_init(&counter->lock); |
20 | counter->limit = RESOURCE_MAX; | 20 | counter->limit = RES_COUNTER_MAX; |
21 | counter->soft_limit = RESOURCE_MAX; | 21 | counter->soft_limit = RES_COUNTER_MAX; |
22 | counter->parent = parent; | 22 | counter->parent = parent; |
23 | } | 23 | } |
24 | 24 | ||
@@ -182,12 +182,12 @@ int res_counter_memparse_write_strategy(const char *buf, | |||
182 | { | 182 | { |
183 | char *end; | 183 | char *end; |
184 | 184 | ||
185 | /* return RESOURCE_MAX(unlimited) if "-1" is specified */ | 185 | /* return RES_COUNTER_MAX(unlimited) if "-1" is specified */ |
186 | if (*buf == '-') { | 186 | if (*buf == '-') { |
187 | *res = simple_strtoull(buf + 1, &end, 10); | 187 | *res = simple_strtoull(buf + 1, &end, 10); |
188 | if (*res != 1 || *end != '\0') | 188 | if (*res != 1 || *end != '\0') |
189 | return -EINVAL; | 189 | return -EINVAL; |
190 | *res = RESOURCE_MAX; | 190 | *res = RES_COUNTER_MAX; |
191 | return 0; | 191 | return 0; |
192 | } | 192 | } |
193 | 193 | ||
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 4b5cfb509270..2c71f243186e 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -4967,7 +4967,7 @@ static int memcg_update_kmem_limit(struct cgroup_subsys_state *css, u64 val) | |||
4967 | */ | 4967 | */ |
4968 | mutex_lock(&memcg_create_mutex); | 4968 | mutex_lock(&memcg_create_mutex); |
4969 | mutex_lock(&set_limit_mutex); | 4969 | mutex_lock(&set_limit_mutex); |
4970 | if (!memcg->kmem_account_flags && val != RESOURCE_MAX) { | 4970 | if (!memcg->kmem_account_flags && val != RES_COUNTER_MAX) { |
4971 | if (cgroup_task_count(css->cgroup) || memcg_has_children(memcg)) { | 4971 | if (cgroup_task_count(css->cgroup) || memcg_has_children(memcg)) { |
4972 | ret = -EBUSY; | 4972 | ret = -EBUSY; |
4973 | goto out; | 4973 | goto out; |
@@ -4977,7 +4977,7 @@ static int memcg_update_kmem_limit(struct cgroup_subsys_state *css, u64 val) | |||
4977 | 4977 | ||
4978 | ret = memcg_update_cache_sizes(memcg); | 4978 | ret = memcg_update_cache_sizes(memcg); |
4979 | if (ret) { | 4979 | if (ret) { |
4980 | res_counter_set_limit(&memcg->kmem, RESOURCE_MAX); | 4980 | res_counter_set_limit(&memcg->kmem, RES_COUNTER_MAX); |
4981 | goto out; | 4981 | goto out; |
4982 | } | 4982 | } |
4983 | static_key_slow_inc(&memcg_kmem_enabled_key); | 4983 | static_key_slow_inc(&memcg_kmem_enabled_key); |
diff --git a/net/ipv4/tcp_memcontrol.c b/net/ipv4/tcp_memcontrol.c index 8a57d79b0b16..559d4ae6ebf4 100644 --- a/net/ipv4/tcp_memcontrol.c +++ b/net/ipv4/tcp_memcontrol.c | |||
@@ -87,8 +87,8 @@ static int tcp_update_limit(struct mem_cgroup *memcg, u64 val) | |||
87 | if (!cg_proto) | 87 | if (!cg_proto) |
88 | return -EINVAL; | 88 | return -EINVAL; |
89 | 89 | ||
90 | if (val > RESOURCE_MAX) | 90 | if (val > RES_COUNTER_MAX) |
91 | val = RESOURCE_MAX; | 91 | val = RES_COUNTER_MAX; |
92 | 92 | ||
93 | tcp = tcp_from_cgproto(cg_proto); | 93 | tcp = tcp_from_cgproto(cg_proto); |
94 | 94 | ||
@@ -101,9 +101,9 @@ static int tcp_update_limit(struct mem_cgroup *memcg, u64 val) | |||
101 | tcp->tcp_prot_mem[i] = min_t(long, val >> PAGE_SHIFT, | 101 | tcp->tcp_prot_mem[i] = min_t(long, val >> PAGE_SHIFT, |
102 | net->ipv4.sysctl_tcp_mem[i]); | 102 | net->ipv4.sysctl_tcp_mem[i]); |
103 | 103 | ||
104 | if (val == RESOURCE_MAX) | 104 | if (val == RES_COUNTER_MAX) |
105 | clear_bit(MEMCG_SOCK_ACTIVE, &cg_proto->flags); | 105 | clear_bit(MEMCG_SOCK_ACTIVE, &cg_proto->flags); |
106 | else if (val != RESOURCE_MAX) { | 106 | else if (val != RES_COUNTER_MAX) { |
107 | /* | 107 | /* |
108 | * The active bit needs to be written after the static_key | 108 | * The active bit needs to be written after the static_key |
109 | * update. This is what guarantees that the socket activation | 109 | * update. This is what guarantees that the socket activation |
@@ -187,7 +187,7 @@ static u64 tcp_cgroup_read(struct cgroup_subsys_state *css, struct cftype *cft) | |||
187 | 187 | ||
188 | switch (cft->private) { | 188 | switch (cft->private) { |
189 | case RES_LIMIT: | 189 | case RES_LIMIT: |
190 | val = tcp_read_stat(memcg, RES_LIMIT, RESOURCE_MAX); | 190 | val = tcp_read_stat(memcg, RES_LIMIT, RES_COUNTER_MAX); |
191 | break; | 191 | break; |
192 | case RES_USAGE: | 192 | case RES_USAGE: |
193 | val = tcp_read_usage(memcg); | 193 | val = tcp_read_usage(memcg); |