[PATCH] memcg: mark soft limit as deprecated

From: Michal Hocko
Date: Fri May 02 2014 - 07:16:57 EST


Now that we have low limit reclaim the soft limit reclaim should be
deprecated and not longer used. Print an information about this into the
log and mention it also in the memcg documentation.

Signed-off-by: Michal Hocko <mhocko@xxxxxxx>
---
Documentation/cgroups/memory.txt | 7 +++++++
mm/memcontrol.c | 9 +++++++--
2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
index 9bc3325e99ce..7f3a7414bdf2 100644
--- a/Documentation/cgroups/memory.txt
+++ b/Documentation/cgroups/memory.txt
@@ -652,6 +652,13 @@ heavily contended for, memory is allocated based on the soft limit
hints/setup. Currently soft limit based reclaim is set up such that
it gets invoked from balance_pgdat (kswapd).

+NOTE:
+Soft limit is considered deprecated and will be removed later.
+low_limit_in_bytes should be used instead. The main difference between
+the two is that the soft limit hammers groups over the selected limit to
+prevent reclaiming from other groups while low_limit excludes groups under
+the limit from reclaim and reclaim others.
+
7.1 Interface

Soft limits can be setup by using the following commands (in this example we
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 53193fec8c50..7a276c0d141e 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5162,10 +5162,15 @@ static int mem_cgroup_write(struct cgroup_subsys_state *css, struct cftype *cft,
* of semantics, for now, we support soft limits for
* control without swap
*/
- if (type == _MEM)
+ if (type == _MEM) {
+ pr_info("soft_limit_in_bytes is deprecated and should ");
+ pr_cont("be replaced by low_limit_in_bytes. Please let ");
+ pr_cont("us know if that doesn't work for you at ");
+ pr_cont("linux-mm@xxxxxxxxx\n");
ret = res_counter_set_soft_limit(&memcg->res, val);
- else
+ } else {
ret = -EINVAL;
+ }
break;
default:
ret = -EINVAL; /* should be BUG() ? */
--
2.0.0.rc0

--
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/