public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel•org>
To: Andrew Morton <akpm@linux-foundation•org>,
	Stephen Rothwell <sfr@canb•auug.org.au>
Cc: linux-kernel@vger•kernel.org, linux-next@vger•kernel.org,
	Johannes Weiner <hannes@cmpxchg•org>,
	Michal Hocko <mhocko@suse•cz>
Subject: [linux-next / akpm] Heads up on minor conflicts in mm/memcontrol.c
Date: Fri, 16 May 2014 12:30:34 -0400	[thread overview]
Message-ID: <20140516163034.GF5379@htj.dyndns.org> (raw)

Hello,

Today's cgroup/for-next contains aa190dd36dad ("cgroup: remove
css_parent()").  The wrapper was added while transitioning
cgroup-based hierarchy to css-based one.  css-based hierarchy is
mostly getting into the shape now and the parent field is exported and
expected to remain stable, so the patch removes the wrapper before
updating the rest of hierarchy to be css-based.  This causes two
trivial conflicts in mm/memcontrol.c with
"f51add3a5415edbd2160f8c80ca338edebbaa734".

  static int mem_cgroup_oom_control_write(struct cgroup_subsys_state *css,
	  struct cftype *cft, u64 val)
  {
	  struct mem_cgroup *memcg = mem_cgroup_from_css(css);
  <<<<<<< HEAD
  =======
	  struct mem_cgroup *parent = mem_cgroup_from_css(memcg->css.parent);
  >>>>>>> 141fdfadf18c10fed33624bbd414fcc0cb74d7ca

	  /* cannot set to root cgroup and only 0 and 1 are allowed */
	  if (!css_parent(css) || !((val == 0) || (val == 1)))
		  return -EINVAL;

	  memcg->oom_kill_disable = val;
	  if (!val)
		  memcg_oom_recover(memcg);

	  return 0;
  }

  ...

  static int mem_cgroup_swappiness_write(struct cgroup_subsys_state *css,
					 struct cftype *cft, u64 val)
  {
	  struct mem_cgroup *memcg = mem_cgroup_from_css(css);
  <<<<<<< HEAD
  =======
	  struct mem_cgroup *parent = mem_cgroup_from_css(memcg->css.parent);

	  if (val > 100 || !parent)
		  return -EINVAL;

	  mutex_lock(&memcg_create_mutex);
  >>>>>>> 141fdfadf18c10fed33624bbd414fcc0cb74d7ca

	  if (val > 100)
		  return -EINVAL;

	  if (css_parent(css))
		  memcg->swappiness = val;
	  else
		  vm_swappiness = val;

	  return 0;
  }

For both cases, the resolution is simple.  Take the code from akpm and
change css_parent(css) to css->parent.

  static int mem_cgroup_oom_control_write(struct cgroup_subsys_state *css,
	  struct cftype *cft, u64 val)
  {
	  struct mem_cgroup *memcg = mem_cgroup_from_css(css);

	  /* cannot set to root cgroup and only 0 and 1 are allowed */
	  if (!css->parent || !((val == 0) || (val == 1)))
		  return -EINVAL;

	  memcg->oom_kill_disable = val;
	  if (!val)
		  memcg_oom_recover(memcg);

	  return 0;
  }

  ...

  static int mem_cgroup_swappiness_write(struct cgroup_subsys_state *css,
					 struct cftype *cft, u64 val)
  {
	  struct mem_cgroup *memcg = mem_cgroup_from_css(css);

	  if (val > 100)
		  return -EINVAL;

	  if (css->parent)
		  memcg->swappiness = val;
	  else
		  vm_swappiness = val;

	  return 0;
  }
										
Thanks.

-- 
tejun

                 reply	other threads:[~2014-05-16 16:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140516163034.GF5379@htj.dyndns.org \
    --to=tj@kernel$(echo .)org \
    --cc=akpm@linux-foundation$(echo .)org \
    --cc=hannes@cmpxchg$(echo .)org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=mhocko@suse$(echo .)cz \
    --cc=sfr@canb$(echo .)auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox