linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes@cmpxchg.org>
To: Michal Hocko <mhocko@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Vladimir Davydov <vdavydov@parallels.com>,
	linux-mm@kvack.org, cgroups@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [patch] mm: memcontrol: fold mem_cgroup_start_move()/mem_cgroup_end_move()
Date: Thu, 23 Oct 2014 13:53:38 -0400	[thread overview]
Message-ID: <20141023175338.GA15937@phnom.home.cmpxchg.org> (raw)
In-Reply-To: <20141023155607.GN23011@dhcp22.suse.cz>

On Thu, Oct 23, 2014 at 05:56:07PM +0200, Michal Hocko wrote:
> On Thu 23-10-14 10:42:07, Johannes Weiner wrote:
> > Having these functions and their documentation split out and somewhere
> > makes it harder, not easier, to follow what's going on.
> > 
> > Inline them directly where charge moving is prepared and finished, and
> > put an explanation right next to it.
> 
> I do not see the open coded version much more readable or maintainable to be
> honest. mem_cgroup_{start,end}_move are a good markers of the transaction.

What transaction, though?  The names are really non-descript and they
actively hide what's going on.  mem_cgroup_start_move() could mean
anything that prepares for moving and it doesn't seem out of place in
can_attach().  atomic_inc(&memcg->moving_account) on the other hand is
much more specific and nicely shows that we are currently forcing the
page stat update slow path way too early.  There is no reason to make
it take the move_lock while we are still counting rss and precharging,
we are not actually moving charges and flipping pc->mem_cgroups yet.

[ I already have a patch to relocate it into mem_cgroup_move_charge(),
  but let's let the dust in -mm settle a bit first. :-) ]

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2014-10-23 17:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-23 14:42 Johannes Weiner
2014-10-23 15:56 ` Michal Hocko
2014-10-23 17:53   ` Johannes Weiner [this message]

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=20141023175338.GA15937@phnom.home.cmpxchg.org \
    --to=hannes@cmpxchg.org \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=vdavydov@parallels.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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