linux-next: manual merge of the akpm-current tree with the cgroup tree

From: Stephen Rothwell
Date: Wed May 14 2014 - 03:22:58 EST


Hi Andrew,

Today's linux-next merge of the akpm-current tree got a conflict in
mm/memcontrol.c between commit 6770c64e5c8d ("cgroup: replace
cftype->trigger() with cftype->write()") from the cgroup tree and
commits 15aa061d2994 ("memcg: deprecate memory.force_empty knob") and
2423e4fd8967 ("memcg-deprecate-memoryforce_empty-knob-fix") from the
akpm-current tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

--
Cheers,
Stephen Rothwell sfr@xxxxxxxxxxxxxxxx

diff --cc mm/memcontrol.c
index 66447745d0c0,2cb81478d30c..000000000000
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@@ -833,9 -829,9 +826,9 @@@ retry
* we will to add it back at the end of reclaim to its correct
* position in the tree.
*/
- __mem_cgroup_remove_exceeded(mz->memcg, mz, mctz);
+ __mem_cgroup_remove_exceeded(mz, mctz);
if (!res_counter_soft_limit_excess(&mz->memcg->res) ||
- !css_tryget(&mz->memcg->css))
+ !css_tryget_online(&mz->memcg->css))
goto retry;
done:
return mz;
@@@ -4895,7 -4795,11 +4794,11 @@@ static ssize_t mem_cgroup_force_empty_w

if (mem_cgroup_is_root(memcg))
return -EINVAL;
+ pr_info_once("%s (%d): memory.force_empty is deprecated and will be "
+ "removed. Let us know if it is needed in your usecase at "
+ "linux-mm@xxxxxxxxx\n",
+ current->comm, task_pid_nr(current));
- return mem_cgroup_force_empty(memcg);
+ return mem_cgroup_force_empty(memcg) ?: nbytes;
}

static u64 mem_cgroup_hierarchy_read(struct cgroup_subsys_state *css,
@@@ -5176,8 -5080,26 +5080,26 @@@ static ssize_t mem_cgroup_write(struct
else
return -EINVAL;
break;
+ case RES_LOW_LIMIT:
+ if (mem_cgroup_is_root(memcg)) { /* Can't set limit on root */
+ ret = -EINVAL;
+ break;
+ }
+ ret = res_counter_memparse_write_strategy(buffer, &val);
+ if (ret)
+ break;
+ if (type == _MEM) {
+ ret = res_counter_set_low_limit(&memcg->res, val);
+ break;
+ }
+ /*
+ * memsw low limit doesn't make any sense and kmem is not
+ * implemented yet - if ever
+ */
+ return -EINVAL;
+
case RES_SOFT_LIMIT:
- ret = res_counter_memparse_write_strategy(buffer, &val);
+ ret = res_counter_memparse_write_strategy(buf, &val);
if (ret)
break;
/*
@@@ -6117,9 -6020,15 +6024,15 @@@ static struct cftype mem_cgroup_files[
.read_u64 = mem_cgroup_read_u64,
},
{
+ .name = "low_limit_in_bytes",
+ .private = MEMFILE_PRIVATE(_MEM, RES_LOW_LIMIT),
+ .write_string = mem_cgroup_write,
+ .read_u64 = mem_cgroup_read_u64,
+ },
+ {
.name = "soft_limit_in_bytes",
.private = MEMFILE_PRIVATE(_MEM, RES_SOFT_LIMIT),
- .write_string = mem_cgroup_write,
+ .write = mem_cgroup_write,
.read_u64 = mem_cgroup_read_u64,
},
{
@@@ -6134,7 -6043,8 +6047,8 @@@
},
{
.name = "force_empty",
+ .flags = CFTYPE_INSANE,
- .trigger = mem_cgroup_force_empty_write,
+ .write = mem_cgroup_force_empty_write,
},
{
.name = "use_hierarchy",

Attachment: signature.asc
Description: PGP signature