Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm: memcontrol: use "max" instead of "infinity" in control knobs

The memcg control knobs indicate the highest possible value using the
symbolic name "infinity", which is long and awkward to type.

Switch to the string "max", which is just as descriptive but shorter and
sweeter.

This changes a user interface, so do it before the release and before
the development flag is dropped from the default hierarchy.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Tejun Heo <tj@kernel.org>
Cc: Vladimir Davydov <vdavydov@parallels.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Johannes Weiner and committed by
Linus Torvalds
d2973697 2ea55a2c

+8 -8
+2 -2
Documentation/cgroups/unified-hierarchy.txt
··· 404 404 be understood as an underflow into the highest possible value, -2 or 405 405 -10M etc. do not work, so it's not consistent. 406 406 407 - memory.low, memory.high, and memory.max will use the string 408 - "infinity" to indicate and set the highest possible value. 407 + memory.low, memory.high, and memory.max will use the string "max" to 408 + indicate and set the highest possible value. 409 409 410 410 5. Planned Changes 411 411
+6 -6
mm/memcontrol.c
··· 5247 5247 unsigned long low = ACCESS_ONCE(memcg->low); 5248 5248 5249 5249 if (low == PAGE_COUNTER_MAX) 5250 - seq_puts(m, "infinity\n"); 5250 + seq_puts(m, "max\n"); 5251 5251 else 5252 5252 seq_printf(m, "%llu\n", (u64)low * PAGE_SIZE); 5253 5253 ··· 5262 5262 int err; 5263 5263 5264 5264 buf = strstrip(buf); 5265 - err = page_counter_memparse(buf, "infinity", &low); 5265 + err = page_counter_memparse(buf, "max", &low); 5266 5266 if (err) 5267 5267 return err; 5268 5268 ··· 5277 5277 unsigned long high = ACCESS_ONCE(memcg->high); 5278 5278 5279 5279 if (high == PAGE_COUNTER_MAX) 5280 - seq_puts(m, "infinity\n"); 5280 + seq_puts(m, "max\n"); 5281 5281 else 5282 5282 seq_printf(m, "%llu\n", (u64)high * PAGE_SIZE); 5283 5283 ··· 5292 5292 int err; 5293 5293 5294 5294 buf = strstrip(buf); 5295 - err = page_counter_memparse(buf, "infinity", &high); 5295 + err = page_counter_memparse(buf, "max", &high); 5296 5296 if (err) 5297 5297 return err; 5298 5298 ··· 5307 5307 unsigned long max = ACCESS_ONCE(memcg->memory.limit); 5308 5308 5309 5309 if (max == PAGE_COUNTER_MAX) 5310 - seq_puts(m, "infinity\n"); 5310 + seq_puts(m, "max\n"); 5311 5311 else 5312 5312 seq_printf(m, "%llu\n", (u64)max * PAGE_SIZE); 5313 5313 ··· 5322 5322 int err; 5323 5323 5324 5324 buf = strstrip(buf); 5325 - err = page_counter_memparse(buf, "infinity", &max); 5325 + err = page_counter_memparse(buf, "max", &max); 5326 5326 if (err) 5327 5327 return err; 5328 5328