All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Glauber Costa <glommer@parallels.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Tejun Heo <tj@kernel.org>, Michal Hocko <mhocko@suse.cz>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>
Subject: Re: [PATCH 3/7] memcg: remove test for current->mm in memcg_stop/resume_kmem_account
Date: Thu, 15 Nov 2012 18:28:00 +0900	[thread overview]
Message-ID: <50A4B5A0.8040102@jp.fujitsu.com> (raw)
In-Reply-To: <1352948093-2315-4-git-send-email-glommer@parallels.com>

(2012/11/15 11:54), Glauber Costa wrote:
> The original reason for the existence of this test, was that
> memcg_kmem_cache_create could be called from either softirq context
> (where memcg_stop/resume_account is not needed), or process context,
> (where memcg_stop/resume_account is needed). Just skipping it
> in-function was the cleanest way to merge both behaviors. The reason for
> that is that we would try to create caches right away through
> memcg_kmem_cache_create if the context would allow us to.
> 
> However, the final version of the code that merged did not have this
> behavior and we always queue up new cache creation. Thus, instead of a
> comment explaining why current->mm test is needed, my proposal in this
> patch is to remove memcg_stop/resume_account from the worker thread and
> make sure all callers have a valid mm context.
> 
> Signed-off-by: Glauber Costa <glommer@parallels.com>
> CC: Michal Hocko <mhocko@suse.cz>
> CC: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> CC: Johannes Weiner <hannes@cmpxchg.org>
> CC: Andrew Morton <akpm@linux-foundation.org>

seems ok to me. But do we need VM_BUG_ON() ?
It seems functions called under memcg_stop_kmem_account() doesn't access
current->mm...

Anyway.
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>




WARNING: multiple messages have this Message-ID (diff)
From: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Glauber Costa <glommer@parallels.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Tejun Heo <tj@kernel.org>, Michal Hocko <mhocko@suse.cz>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>
Subject: Re: [PATCH 3/7] memcg: remove test for current->mm in memcg_stop/resume_kmem_account
Date: Thu, 15 Nov 2012 18:28:00 +0900	[thread overview]
Message-ID: <50A4B5A0.8040102@jp.fujitsu.com> (raw)
In-Reply-To: <1352948093-2315-4-git-send-email-glommer@parallels.com>

(2012/11/15 11:54), Glauber Costa wrote:
> The original reason for the existence of this test, was that
> memcg_kmem_cache_create could be called from either softirq context
> (where memcg_stop/resume_account is not needed), or process context,
> (where memcg_stop/resume_account is needed). Just skipping it
> in-function was the cleanest way to merge both behaviors. The reason for
> that is that we would try to create caches right away through
> memcg_kmem_cache_create if the context would allow us to.
> 
> However, the final version of the code that merged did not have this
> behavior and we always queue up new cache creation. Thus, instead of a
> comment explaining why current->mm test is needed, my proposal in this
> patch is to remove memcg_stop/resume_account from the worker thread and
> make sure all callers have a valid mm context.
> 
> Signed-off-by: Glauber Costa <glommer@parallels.com>
> CC: Michal Hocko <mhocko@suse.cz>
> CC: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> CC: Johannes Weiner <hannes@cmpxchg.org>
> CC: Andrew Morton <akpm@linux-foundation.org>

seems ok to me. But do we need VM_BUG_ON() ?
It seems functions called under memcg_stop_kmem_account() doesn't access
current->mm...

Anyway.
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>



--
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:[~2012-11-15  9:28 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-15  2:54 [PATCH 0/7] fixups for kmemcg Glauber Costa
2012-11-15  2:54 ` Glauber Costa
2012-11-15  0:47 ` David Rientjes
2012-11-15  0:47   ` David Rientjes
2012-11-15  2:54 ` [PATCH 1/7] memcg: simplify ida initialization Glauber Costa
2012-11-15  2:54   ` Glauber Costa
2012-11-15  2:54 ` [PATCH 2/7] move include of workqueue.h to top of slab.h file Glauber Costa
2012-11-15  2:54   ` Glauber Costa
2012-11-15  9:30   ` Kamezawa Hiroyuki
2012-11-15  9:30     ` Kamezawa Hiroyuki
2012-11-15  2:54 ` [PATCH 3/7] memcg: remove test for current->mm in memcg_stop/resume_kmem_account Glauber Costa
2012-11-15  2:54   ` Glauber Costa
2012-11-15  9:28   ` Kamezawa Hiroyuki [this message]
2012-11-15  9:28     ` Kamezawa Hiroyuki
2012-11-15  2:54 ` [PATCH 4/7] memcg: replace __always_inline with plain inline Glauber Costa
2012-11-15  2:54   ` Glauber Costa
2012-11-15  9:29   ` Kamezawa Hiroyuki
2012-11-15  9:29     ` Kamezawa Hiroyuki
2012-11-15  2:54 ` [PATCH 5/7] memcg: get rid of once-per-second cache shrinking for dead memcgs Glauber Costa
2012-11-15  2:54   ` Glauber Costa
2012-11-15  9:41   ` Kamezawa Hiroyuki
2012-11-15  9:41     ` Kamezawa Hiroyuki
2012-11-15 13:47     ` Glauber Costa
2012-11-15 13:47       ` Glauber Costa
2012-11-16  5:07       ` Kamezawa Hiroyuki
2012-11-16  5:07         ` Kamezawa Hiroyuki
2012-11-16  7:11         ` Glauber Costa
2012-11-16  7:11           ` Glauber Costa
2012-11-16  7:21           ` Kamezawa Hiroyuki
2012-11-16  7:21             ` Kamezawa Hiroyuki
2012-11-16 14:55             ` Michal Hocko
2012-11-16 14:55               ` Michal Hocko
2012-11-16 15:50               ` Glauber Costa
2012-11-16 15:50                 ` Glauber Costa
2012-11-15  2:54 ` [PATCH 6/7] memcg: add comments clarifying aspects of cache attribute propagation Glauber Costa
2012-11-15  2:54   ` Glauber Costa
2012-11-15  2:54 ` [PATCH 7/7] slub: drop mutex before deleting sysfs entry Glauber Costa
2012-11-15  2:54   ` Glauber Costa

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=50A4B5A0.8040102@jp.fujitsu.com \
    --to=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=glommer@parallels.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=penberg@kernel.org \
    --cc=tj@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.