Skip to content

Commit

Permalink
mm: memcontrol: use "max" instead of "infinity" in control knobs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
hnaz authored and torvalds committed Feb 28, 2015
1 parent 2ea55a2 commit d297369
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Documentation/cgroups/unified-hierarchy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,8 @@ supported and the interface files "release_agent" and
be understood as an underflow into the highest possible value, -2 or
-10M etc. do not work, so it's not consistent.

memory.low, memory.high, and memory.max will use the string
"infinity" to indicate and set the highest possible value.
memory.low, memory.high, and memory.max will use the string "max" to
indicate and set the highest possible value.

5. Planned Changes

Expand Down
12 changes: 6 additions & 6 deletions mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -5247,7 +5247,7 @@ static int memory_low_show(struct seq_file *m, void *v)
unsigned long low = ACCESS_ONCE(memcg->low);

if (low == PAGE_COUNTER_MAX)
seq_puts(m, "infinity\n");
seq_puts(m, "max\n");
else
seq_printf(m, "%llu\n", (u64)low * PAGE_SIZE);

Expand All @@ -5262,7 +5262,7 @@ static ssize_t memory_low_write(struct kernfs_open_file *of,
int err;

buf = strstrip(buf);
err = page_counter_memparse(buf, "infinity", &low);
err = page_counter_memparse(buf, "max", &low);
if (err)
return err;

Expand All @@ -5277,7 +5277,7 @@ static int memory_high_show(struct seq_file *m, void *v)
unsigned long high = ACCESS_ONCE(memcg->high);

if (high == PAGE_COUNTER_MAX)
seq_puts(m, "infinity\n");
seq_puts(m, "max\n");
else
seq_printf(m, "%llu\n", (u64)high * PAGE_SIZE);

Expand All @@ -5292,7 +5292,7 @@ static ssize_t memory_high_write(struct kernfs_open_file *of,
int err;

buf = strstrip(buf);
err = page_counter_memparse(buf, "infinity", &high);
err = page_counter_memparse(buf, "max", &high);
if (err)
return err;

Expand All @@ -5307,7 +5307,7 @@ static int memory_max_show(struct seq_file *m, void *v)
unsigned long max = ACCESS_ONCE(memcg->memory.limit);

if (max == PAGE_COUNTER_MAX)
seq_puts(m, "infinity\n");
seq_puts(m, "max\n");
else
seq_printf(m, "%llu\n", (u64)max * PAGE_SIZE);

Expand All @@ -5322,7 +5322,7 @@ static ssize_t memory_max_write(struct kernfs_open_file *of,
int err;

buf = strstrip(buf);
err = page_counter_memparse(buf, "infinity", &max);
err = page_counter_memparse(buf, "max", &max);
if (err)
return err;

Expand Down

0 comments on commit d297369

Please sign in to comment.