Re: [PATCH -mm] memcg: do not trigger OOM from add_to_page_cache_locked

2012-11-26 Thread Kamezawa Hiroyuki
M in this path. Reported-by: azurIt Signed-off-by: Michal Hocko As a short term fix, I think this patch will work enough and seems simple enough. Acked-by: KAMEZAWA Hiroyuki Reading discussion between you and Johannes, to release locks, I understand the memcg need to return "RETRY"

Re: [patch v2 2/6] memcg: keep prev's css alive for the whole mem_cgroup_iter

2012-11-28 Thread Kamezawa Hiroyuki
;s move the css_put at the end of the > function. > > Signed-off-by: Michal Hocko Acked-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vg

Re: [patch v2 3/6] memcg: rework mem_cgroup_iter to use cgroup iterators

2012-11-28 Thread Kamezawa Hiroyuki
(2012/11/27 3:47), Michal Hocko wrote: > mem_cgroup_iter curently relies on css->id when walking down a group > hierarchy tree. This is really awkward because the tree walk depends on > the groups creation ordering. The only guarantee is that a parent node > is visited before its children. > Exampl

Re: [patch v2 4/6] memcg: simplify mem_cgroup_iter

2012-11-28 Thread Kamezawa Hiroyuki
(2012/11/27 3:47), Michal Hocko wrote: > Current implementation of mem_cgroup_iter has to consider both css and > memcg to find out whether no group has been found (css==NULL - aka the > loop is completed) and that no memcg is associated with the found node > (!memcg - aka css_tryget failed because

Re: [PATCHSET cgroup/for-3.8] cpuset: decouple cpuset locking from cgroup core

2012-11-29 Thread Kamezawa Hiroyuki
(2012/11/29 6:34), Tejun Heo wrote: > Hello, guys. > > Depending on cgroup core locking - cgroup_mutex - is messy and makes > cgroup prone to locking dependency problems. The current code already > has lock dependency loop - memcg nests get_online_cpus() inside > cgroup_mutex. cpuset the other w

Re: [patch v2 3/6] memcg: rework mem_cgroup_iter to use cgroup iterators

2012-11-29 Thread Kamezawa Hiroyuki
r wrt. cgroup life cycle > - cgroup_next_descendant_pre expects NULL pos for the first iterartion >otherwise it might loop endlessly for intermediate node without any >children. > > Signed-off-by: Michal Hocko Acked-by: KAMEZAWA Hiroyuki -- To unsubscribe fro

Re: [patch v2 4/6] memcg: simplify mem_cgroup_iter

2012-11-29 Thread Kamezawa Hiroyuki
review easier. It will go away in the following patch. > > Signed-off-by: Michal Hocko Acked-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kern

Re: [patch v2 5/6] memcg: further simplify mem_cgroup_iter

2012-11-29 Thread Kamezawa Hiroyuki
to follow if we move the iteration > outside of the function (to __mem_cgrou_iter_next) so the distinction > is more clear. > This patch doesn't introduce any functional changes. > > Signed-off-by: Michal Hocko Very nice look ! Acked-by: KAMEZAWA Hiroyuki -- To unsubscri

Re: [patch v2 6/6] cgroup: remove css_get_next

2012-11-29 Thread Kamezawa Hiroyuki
(2012/11/27 3:47), Michal Hocko wrote: > Now that we have generic and well ordered cgroup tree walkers there is > no need to keep css_get_next in the place. > > Signed-off-by: Michal Hocko Hm, then, the next think will be css_is_ancestor() etc.. Acked-by: KAMEZAWA Hiroyuki -- To

Re: [BUG REPORT] [mm-hotplug, aio] aio ring_pages can't be offlined

2012-11-29 Thread Kamezawa Hiroyuki
(2012/11/30 14:57), Andrew Morton wrote: On Fri, 30 Nov 2012 11:42:05 +0800 Lin Feng wrote: hi Andrew, On 11/30/2012 07:39 AM, Andrew Morton wrote: Tricky. I expect the same problem would occur with pages which are under O_DIRECT I/O. Obviously O_DIRECT pages won't be pinned for such long

Re: [PATCH for 3.2.34] memcg: do not trigger OOM from add_to_page_cache_locked

2013-02-07 Thread Kamezawa Hiroyuki
(2013/02/06 23:01), Michal Hocko wrote: On Wed 06-02-13 02:17:21, azurIt wrote: 5-memcg-fix-1.patch is not complete. It doesn't contain the folloup I mentioned in a follow up email. Here is the full patch: Here is the log where OOM, again, killed MySQL server [search for "(mysqld)"]: http://w

Re: [PATCH for 3.2.34] memcg: do not trigger OOM from add_to_page_cache_locked

2013-02-07 Thread Kamezawa Hiroyuki
(2013/02/07 20:01), Kamezawa Hiroyuki wrote: (2013/02/06 23:01), Michal Hocko wrote: On Wed 06-02-13 02:17:21, azurIt wrote: 5-memcg-fix-1.patch is not complete. It doesn't contain the folloup I mentioned in a follow up email. Here is the full patch: Here is the log where OOM, again, k

Re: [PATCH for 3.2.34] memcg: do not trigger OOM from add_to_page_cache_locked

2013-02-07 Thread Kamezawa Hiroyuki
(2013/02/07 21:31), Michal Hocko wrote: On Thu 07-02-13 20:01:45, KAMEZAWA Hiroyuki wrote: (2013/02/06 23:01), Michal Hocko wrote: On Wed 06-02-13 02:17:21, azurIt wrote: 5-memcg-fix-1.patch is not complete. It doesn't contain the folloup I mentioned in a follow up email. Here is the

Re: [RFC][PATCH 1/7] memcg: use css_get in sock_update_memcg()

2013-04-04 Thread Kamezawa Hiroyuki
> > Signed-off-by: Li Zefan Thank you. Acked-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [RFC][PATCH 2/7] memcg: don't use mem_cgroup_get() when creating a kmemcg cache

2013-04-04 Thread Kamezawa Hiroyuki
(2013/04/03 18:12), Li Zefan wrote: > Use css_get()/css_put() instead of mem_cgroup_get()/mem_cgroup_put(). > > Signed-off-by: Li Zefan > --- > mm/memcontrol.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 43ca91d

Re: [RFC][PATCH 4/7] memcg: use css_get/put for swap memcg

2013-04-04 Thread Kamezawa Hiroyuki
); > > if (!mem_cgroup_is_root(mc.to)) { > /* > @@ -6627,7 +6633,7 @@ static void __mem_cgroup_clear_mc(void) > res_counter_uncharge(&mc.to->res, > PAGE_SIZE * mc.moved_swap)

Re: [RFC][PATCH 5/7] cgroup: make sure parent won't be destroyed before its children

2013-04-04 Thread Kamezawa Hiroyuki
gt; @@ -4171,6 +4178,9 @@ static long cgroup_create(struct cgroup *parent, struct > dentry *dentry, > for_each_subsys(root, ss) > dget(dentry); > > + /* hold a ref to the parent's dentry */ > + dget(parent->dentry); > + > /* creation

Re: [RFC][PATCH 6/7] memcg: don't need to get a reference to the parent

2013-04-05 Thread Kamezawa Hiroyuki
(2013/04/03 18:13), Li Zefan wrote: > The cgroup core guarantees it's always safe to access the parent. > > Signed-off-by: Li Zefan Acked-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to m

Re: [RFC][PATCH 7/7] memcg: kill memcg refcnt

2013-04-05 Thread Kamezawa Hiroyuki
(2013/04/03 18:14), Li Zefan wrote: > Now memcg has the same life cycle as the corresponding cgroup. > Kill the useless refcnt. > > Signed-off-by: Li Zefan very very very nice. Thank you. Acked-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send the line "unsubsc

Re: [PATCH] THP: fix comment about memory barrier

2013-04-05 Thread Kamezawa Hiroyuki
's [1] explicitly. > > So this patch fixes comment on THP and adds same comment for > do_anonymous_page, too because everybody except Hugh was missing > that. It means we needs COMMENT about that. > > [1] 0ed361dec "mm: fix PageUptodate data race" > > Cc: Mel Gorman >

Re: PROBLEM: Crash cgdeleting empty memory cgroups with memory.kmem.limit_in_bytes set

2013-02-21 Thread Kamezawa Hiroyuki
(2013/02/21 17:34), Glauber Costa wrote: On 02/21/2013 03:00 AM, Tejun Heo wrote: (cc'ing cgroup / memcg people and quoting whole body) Looks like something is going wrong with memcg cache destruction. Glauber, any ideas? Also, can we please not use names as generic as kmem_cache_destroy_work_

Re: [PATCH] slub: correctly bootstrap boot caches

2013-02-22 Thread Kamezawa Hiroyuki
need to make > sure that the pages indeed sit in there: the easiest way to do it is to make > sure the boot caches have the SLAB_STORE_USER debug flag set. > > Signed-off-by: Glauber Costa > Reported-by: Steffen Michalke > Cc: Christoph Lameter > Cc: Andrew Morton > Cc:

Re: [PATCH] memory cgroup: update root memory cgroup when node is onlined

2012-09-13 Thread Kamezawa Hiroyuki
(2012/09/13 16:14), Wen Congyang wrote: root_mem_cgroup->info.nodeinfo is initialized when the system boots. But NODE_DATA(nid) is null if the node is not onlined, so root_mem_cgroup->info.nodeinfo[nid]->zoneinfo[zone].lruvec.zone contains an invalid pointer. If we use numactl to bind a program t

Re: [RFC][PATCH 0/7] CGroup API: More structured API for CGroups control files

2008-02-15 Thread KAMEZAWA Hiroyuki
On Fri, 15 Feb 2008 12:44:18 -0800 Paul Menage <[EMAIL PROTECTED]> wrote: > > This set of patches makes the Control Groups API more structured and > self-describing. > > 1) Allows control files to be associated with data types such as > "u64", "string", "map", etc. These types show up in a new c

Re: [PART6 Patch] mempolicy: fix is_valid_nodemask()

2012-11-01 Thread Kamezawa Hiroyuki
(2012/11/01 3:21), David Rientjes wrote: On Wed, 31 Oct 2012, Wen Congyang wrote: From: Lai Jiangshan is_valid_nodemask() is introduced by 19770b32. but it does not match its comments, because it does not check the zone which > policy_zone. Also in b377fd, this commits told us, if highest zo

Re: [PATCH 1/8] cgroup: kill cgroup_subsys->__DEPRECATED_clear_css_refs

2012-11-02 Thread Kamezawa Hiroyuki
at cgroup_rmdir() will see more cleanup soon. > > Signed-off-by: Tejun Heo I thank you and Michal for this work. Reviewed-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH 2/8] cgroup: kill CSS_REMOVED

2012-11-02 Thread Kamezawa Hiroyuki
t's better to > simply unexport it. > > Signed-off-by: Tejun Heo > Cc: Johannes Weiner > Cc: Michal Hocko > Cc: Balbir Singh > Cc: KAMEZAWA Hiroyuki Reviewed-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send the line "unsubscribe linux-kernel&quo

Re: [PATCH 3/8] cgroup: use cgroup_lock_live_group(parent) in cgroup_create()

2012-11-02 Thread Kamezawa Hiroyuki
ecessary. > > Do it anyway such that locking is contained inside cgroup proper and > we don't get nasty surprises if we ever grow another caller of > cgroup_create(). > > Signed-off-by: Tejun Heo I welcome this change. Reviewed-by: KAMEZAWA Hiroyuki > --- >

Re: [PATCH 4/8] cgroup: deactivate CSS's and mark cgroup dead before invoking ->pre_destroy()

2012-11-02 Thread Kamezawa Hiroyuki
n from #1. > >3. Release cgroup_mutex and call ->pre_destroy(). > >4. Re-grab cgroup_mutex and continue destroying. > > After this change, controllers can safely assume that ->pre_destroy() > will only be called only once for a given cgroup and, once > ->

Re: [PATCH 5/8] cgroup: remove CGRP_WAIT_ON_RMDIR, cgroup_exclude_rmdir() and cgroup_release_and_wakeup_rmdir()

2012-11-02 Thread Kamezawa Hiroyuki
GRP_WAIT_ON_RMDIR is > unnecessary. Remove it and all the mechanisms supporting it. Note > that memcontrol.c changes are essentially revert of 887032670d > ("cgroup avoid permanent sleep at rmdir"). > > Signed-off-by: Tejun Heo > Cc: Michal Hocko > Cc: Balbir Singh

Re: [PATCH 6/8] memcg: make mem_cgroup_reparent_charges non failing

2012-11-02 Thread Kamezawa Hiroyuki
re_destroy doesn't have to take a reference to memcg's css > because all css' are marked dead already. > > tj: Remove now unused local variable @cgrp from > mem_cgroup_reparent_charges(). > > Signed-off-by: Michal Hocko > Reviewed-by: Glauber Costa >

Re: [PATCH 7/8] hugetlb: do not fail in hugetlb_cgroup_pre_destroy

2012-11-02 Thread Kamezawa Hiroyuki
-off-by: Michal Hocko > Reviewed-by: Tejun Heo > Reviewed-by: Glauber Costa > Signed-off-by: Tejun Heo Acked-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo i

Re: [PATCH 8/8] cgroup: make ->pre_destroy() return void

2012-11-02 Thread Kamezawa Hiroyuki
(2012/10/31 13:22), Tejun Heo wrote: > All ->pre_destory() implementations return 0 now, which is the only > allowed return value. Make it return void. > > Signed-off-by: Tejun Heo > Cc: Michal Hocko > Cc: Balbir Singh > Cc: KAMEZAWA Hiroyuki > Cc: Vivek Goyal

Re: [PATCH 1/8] cgroup: kill cgroup_subsys->__DEPRECATED_clear_css_refs

2012-11-02 Thread Kamezawa Hiroyuki
updated to explain local_irq_disable/enable() conversion. Signed-off-by: Tejun Heo Reviewed-by: Michal Hocko I should see this v2 thread 1st... Reviewed-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to m

Re: [PATCH 2/8] cgroup: kill CSS_REMOVED

2012-11-02 Thread Kamezawa Hiroyuki
local_irq_disable/enable() > added per Michal Hocko. > > Signed-off-by: Tejun Heo > Reviewed-by: Michal Hocko > Cc: Johannes Weiner > Cc: Balbir Singh > Cc: KAMEZAWA Hiroyuki Thank you. Reviewed-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send the line

Re: [PATCH 3/8] cgroup: use cgroup_lock_live_group(parent) in cgroup_create()

2012-11-02 Thread Kamezawa Hiroyuki
ecessary. > > Do it anyway such that locking is contained inside cgroup proper and > we don't get nasty surprises if we ever grow another caller of > cgroup_create(). > > Signed-off-by: Tejun Heo > Reviewed-by: Michal Hocko Reviewed-by: KAMEZAWA Hiroyuki -- To un

Re: [PATCH 4/8] cgroup: deactivate CSS's and mark cgroup dead before invoking ->pre_destroy()

2012-11-02 Thread Kamezawa Hiroyuki
r(). > > v2: cgroup_call_pre_destroy() removal moved to this patch per Michal. > Commit message updated per Glauber. > > Signed-off-by: Tejun Heo > Reviewed-by: Michal Hocko > Cc: Glauber Costa Reviewed-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: se

Re: [PATCH 5/8] cgroup: remove CGRP_WAIT_ON_RMDIR, cgroup_exclude_rmdir() and cgroup_release_and_wakeup_rmdir()

2012-11-02 Thread Kamezawa Hiroyuki
GRP_WAIT_ON_RMDIR is > unnecessary. Remove it and all the mechanisms supporting it. Note > that memcontrol.c changes are essentially revert of 887032670d > ("cgroup avoid permanent sleep at rmdir"). > > Signed-off-by: Tejun Heo > Reviewed-by: Michal Hocko > Cc:

Re: [PATCH 6/8] memcg: make mem_cgroup_reparent_charges non failing

2012-11-02 Thread Kamezawa Hiroyuki
re_destroy doesn't have to take a reference to memcg's css > because all css' are marked dead already. > > tj: Remove now unused local variable @cgrp from > mem_cgroup_reparent_charges(). > > Signed-off-by: Michal Hocko > Reviewed-by: Glauber Costa &g

Re: [PATCH 7/8] hugetlb: do not fail in hugetlb_cgroup_pre_destroy

2012-11-02 Thread Kamezawa Hiroyuki
-off-by: Michal Hocko > Reviewed-by: Tejun Heo > Reviewed-by: Glauber Costa > Signed-off-by: Tejun Heo Acked-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo i

Re: [PATCH 8/8] cgroup: make ->pre_destroy() return void

2012-11-02 Thread Kamezawa Hiroyuki
(2012/11/01 4:44), Tejun Heo wrote: > All ->pre_destory() implementations return 0 now, which is the only > allowed return value. Make it return void. > > Signed-off-by: Tejun Heo > Cc: Michal Hocko > Cc: Balbir Singh > Cc: KAMEZAWA Hiroyuki > Cc: Vivek Go

Re: [RESEND RFC 3/3] memory-hotplug: bug fix race between isolation and allocation

2012-07-27 Thread Kamezawa Hiroyuki
(2012/07/23 9:48), Minchan Kim wrote: > Like below, memory-hotplug makes race between page-isolation > and page-allocation so it can hit BUG_ON in __offline_isolated_pages. > > CPU A CPU B > > start_isolate_page_range > set_migratetype_isolate > spin_lock_i

Re: [PATCH 1/3] mm: use get_page_migratetype instead of page_private

2012-09-05 Thread Kamezawa Hiroyuki
(2012/09/05 16:26), Minchan Kim wrote: > page allocator uses set_page_private and page_private for handling > migratetype when it frees page. Let's replace them with [set|get] > _page_migratetype to make it more clear. > > Signed-off-by: Minchan Kim Hmm. one request from me. > --- > include/l

Re: [PATCH v2 1/3] use get_page_migratetype instead of page_private

2012-09-05 Thread Kamezawa Hiroyuki
t_page_migratetype with set_freepage_migratetype >* Add comment on set_freepage_migratetype > > Signed-off-by: Minchan Kim seems good to me. Acked-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vg

Re: [PATCH v2 2/3] mm: remain migratetype in freed page

2012-09-05 Thread Kamezawa Hiroyuki
isn't hurt. > > * from v1 >* Fix move_freepages's migratetype - Mel >* Add more kind explanation in description - Mel > > Signed-off-by: Minchan Kim Hmm, page->index is valid only when the page is the head of buddy chunk ? Anyway, Acked-by: KAMEZAWA Hiroyuki &

Re: [PATCH v2 3/3] memory-hotplug: bug fix race between isolation and allocation

2012-09-05 Thread Kamezawa Hiroyuki
ed by someone > */ > BUG_ON(!PageBuddy(page A)); > > This patch checks page's migratetype in freelist in > __test_page_isolated_in_pageblock. > So now __test_page_isolated_in_pageblock can check the page caused by above > race and > can fail of memory offlining. > >

Re: [PATCH v3 4/4] memory-hotplug: fix pages missed by race rather than failng

2012-09-06 Thread Kamezawa Hiroyuki
it is detected. > It could enhance memory-hotremove operation success ratio although > the race is really rare. > > Suggested-by: Mel Gorman > Signed-off-by: Minchan Kim Sounds reasonable. Thank you very much ! Acked-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send

Re: [PATCH v5 06/14] memcg: kmem controller infrastructure

2012-10-16 Thread Kamezawa Hiroyuki
d decls ] > > Signed-off-by: Glauber Costa > Acked-by: Michal Hocko > CC: Christoph Lameter > CC: Pekka Enberg > CC: Kamezawa Hiroyuki > CC: Johannes Weiner > CC: Tejun Heo Acked-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send the line

Re: [PATCH v5 12/14] execute the whole memcg freeing in free_worker

2012-10-16 Thread Kamezawa Hiroyuki
functions we really need moved away are: > >* free_css_id(), and >* mem_cgroup_remove_from_trees(). > > But because the later accesses per-zone info, > free_mem_cgroup_per_zone_info() needs to be moved as well. With that, we > are left with the per_cpu stats only. Better m

Re: [PATCH v4 14/14] Add documentation about the kmem controller

2012-10-17 Thread Kamezawa Hiroyuki
(2012/10/08 19:06), Glauber Costa wrote: > Signed-off-by: Glauber Costa > --- > Documentation/cgroups/memory.txt | 55 > +++- > 1 file changed, 54 insertions(+), 1 deletion(-) > Acked-by: KAMEZAWA Hiroyuki -- To unsubscribe from this l

Re: [RFC] memcg/cgroup: do not fail fail on pre_destroy callbacks

2012-10-17 Thread Kamezawa Hiroyuki
(2012/10/17 22:30), Michal Hocko wrote: > Hi, > memcg is the only controller which might fail in its pre_destroy > callback which makes the cgroup core more complicated for no good > reason. This is an attempt to change this unfortunate state. > > I am sending this a RFC because I would like to he

Re: [patch for-3.7 v2] mm, mempolicy: avoid taking mutex inside spinlock when reading numa_maps

2012-10-17 Thread Kamezawa Hiroyuki
ance concern on big NUMA, Can't we have another way to fix ? like this ? too ugly ? Again, I'm sorry if I misunderstand the points. == From bfe7e2ab1c1375b134ec12efce6517149318f75d Mon Sep 17 00:00:00 2001 From: KAMEZAWA Hiroyuki Date: Thu, 18 Oct 2012 13:17:25 +0900 Subject: [PATCH] h

Re: [patch for-3.7 v2] mm, mempolicy: avoid taking mutex inside spinlock when reading numa_maps

2012-10-17 Thread Kamezawa Hiroyuki
(2012/10/18 13:06), Kamezawa Hiroyuki wrote: (2012/10/18 6:31), David Rientjes wrote: As a result of commit 32f8516a8c73 ("mm, mempolicy: fix printing stack contents in numa_maps"), the mutex protecting a shared policy can be inadvertently taken while holding task_lock(task). Recent

Re: [patch for-3.7 v2] mm, mempolicy: avoid taking mutex inside spinlock when reading numa_maps

2012-10-17 Thread Kamezawa Hiroyuki
(2012/10/18 13:14), Linus Torvalds wrote: On Wed, Oct 17, 2012 at 9:06 PM, Kamezawa Hiroyuki wrote: if (vma && vma != priv->tail_vma) { struct mm_struct *mm = vma->vm_mm; +#ifdef CONFIG_NUMA + task_lock(priv->task); + __mp

[patch for-3.7 v3] mm, mempolicy: hold task->mempolicy refcount while reading numa_maps.

2012-10-19 Thread Kamezawa Hiroyuki
(2012/10/19 5:03), David Rientjes wrote: On Thu, 18 Oct 2012, Kamezawa Hiroyuki wrote: @@ -132,7 +162,7 @@ static void *m_start(struct seq_file *m, loff_t *pos) tail_vma = get_gate_vma(priv->task->mm); priv->tail_vma = tail_vma; - + hold_task_mempo

Re: [patch for-3.7 v3] mm, mempolicy: hold task->mempolicy refcount while reading numa_maps.

2012-10-21 Thread Kamezawa Hiroyuki
e while scanning. This patch tries to take reference count of task->mempolicy at reading numa_maps before calling get_vma_policy(). By this, task->mempolicy will not be freed until numa_maps reaches its end. Acked-by: David Rientjes Acked-by: KOSAKI Motohiro Signed-off-by: KAMEZAWA Hiroyuk

Re: [RFC 1/5] memcg: synchronize per-zone iterator access by a spinlock

2012-11-13 Thread Kamezawa Hiroyuki
issue so far. The > primary motivation for the change is different. The following patch > will change the way how the iterator is implemented and css->id > iteration will be replaced cgroup generic iteration which requires > storing mem_cgroup pointer into iterator and that requires

Re: [RFC] rework mem_cgroup iterator

2012-11-13 Thread Kamezawa Hiroyuki
(2012/11/14 0:30), Michal Hocko wrote: > Hi all, > this patch set tries to make mem_cgroup_iter saner in the way how it > walks hierarchies. css->id based traversal is far from being ideal as it > is not deterministic because it depends on the creation ordering. > > Diffstat looks promising but it

Re: [RFC 2/5] memcg: rework mem_cgroup_iter to use cgroup iterators

2012-11-13 Thread Kamezawa Hiroyuki
(2012/11/14 0:30), Michal Hocko wrote: > mem_cgroup_iter curently relies on css->id when walking down a group > hierarchy tree. This is really awkward because the tree walk depends on > the groups creation ordering. The only guarantee is that a parent node > is visited before its children. > Exampl

Re: [PATCH] res_counter: delete res_counter_write()

2012-11-14 Thread Kamezawa Hiroyuki
(2012/11/15 9:06), Greg Thelen wrote: > Since 628f423553 "memcg: limit change shrink usage" both > res_counter_write() and write_strategy_fn have been unused. This > patch deletes them both. > > Signed-off-by: Greg Thelen Thank you Acked-by: KAMEZAWA Hiroyuki --

Re: [RFC] rework mem_cgroup iterator

2012-11-14 Thread Kamezawa Hiroyuki
(2012/11/14 10:55), Li Zefan wrote: > On 2012/11/13 23:30, Michal Hocko wrote: >> Hi all, >> this patch set tries to make mem_cgroup_iter saner in the way how it >> walks hierarchies. css->id based traversal is far from being ideal as it >> is not deterministic because it depends on the creation or

Re: [RFC 2/5] memcg: rework mem_cgroup_iter to use cgroup iterators

2012-11-14 Thread Kamezawa Hiroyuki
(2012/11/14 19:10), Michal Hocko wrote: On Wed 14-11-12 09:20:03, KAMEZAWA Hiroyuki wrote: (2012/11/14 0:30), Michal Hocko wrote: [...] @@ -1096,30 +1096,64 @@ struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *root, mz = mem_cgroup_zoneinfo(root, nid, zid

Re: [patch 1/4] mm, oom: ensure sysrq+f always passes valid zonelist

2012-11-15 Thread Kamezawa Hiroyuki
-by: David Rientjes Thank you. Acked-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [patch 2/4] mm, oom: cleanup pagefault oom handler

2012-11-15 Thread Kamezawa Hiroyuki
moved. Cc: KAMEZAWA Hiroyuki Cc: KOSAKI Motohiro Cc: Michal Hocko Signed-off-by: David Rientjes I'm sorry if I missed something... --- mm/oom_kill.c | 49 +++-- 1 files changed, 7 insertions(+), 42 deletions(-) diff --git a/mm/oom_k

Re: [patch 3/4] mm, oom: remove redundant sleep in pagefault oom handler

2012-11-15 Thread Kamezawa Hiroyuki
(2012/11/14 18:15), David Rientjes wrote: out_of_memory() will already cause current to schedule if it has not been killed, so doing it again in pagefault_out_of_memory() is redundant. Remove it. Cc: KAMEZAWA Hiroyuki Cc: KOSAKI Motohiro Cc: Michal Hocko Signed-off-by: David Rientjes

Re: [patch 4/4] mm, oom: remove statically defined arch functions of same name

2012-11-15 Thread Kamezawa Hiroyuki
code up. Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Thomas Gleixner Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Paul Mundt Signed-off-by: David Rientjes I think this is good. Reviewed-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send the line "unsubscribe l

Re: [PATCH 3/7] memcg: remove test for current->mm in memcg_stop/resume_kmem_account

2012-11-15 Thread Kamezawa Hiroyuki
> Signed-off-by: Glauber Costa > CC: Michal Hocko > CC: Kamezawa Hiroyuki > CC: Johannes Weiner > CC: Andrew Morton 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-

Re: [PATCH 4/7] memcg: replace __always_inline with plain inline

2012-11-15 Thread Kamezawa Hiroyuki
ain from it when compiling with -Os. > This seems like a good behavior. > > Signed-off-by: Glauber Costa > CC: Michal Hocko > CC: Kamezawa Hiroyuki > CC: Johannes Weiner > CC: Andrew Morton I'm O.K. with this. Acked-by: KAMEZAWA Hiroyuki -- To unsubscribe from this

Re: [PATCH 2/7] move include of workqueue.h to top of slab.h file

2012-11-15 Thread Kamezawa Hiroyuki
(2012/11/15 11:54), Glauber Costa wrote: > Suggested by akpm. I originally decided to put it closer to the use of > the work struct, but let's move it to top. > > Signed-off-by: Glauber Costa > CC: Michal Hocko > CC: Kamezawa Hiroyuki > CC: Johannes Weiner > CC

Re: [PATCH 5/7] memcg: get rid of once-per-second cache shrinking for dead memcgs

2012-11-15 Thread Kamezawa Hiroyuki
that if the caches have free objects but are > not being shrunk, it is because we don't need that memory yet. > > Signed-off-by: Glauber Costa > CC: Michal Hocko > CC: Kamezawa Hiroyuki > CC: Johannes Weiner > CC: Andrew Morton I agree this patch but can we have a way t

Re: [PATCH 1/9 v2] cgroup: add cgroup_subsys->post_create()

2012-11-07 Thread Kamezawa Hiroyuki
s future use w/ descendant iterators per Michal. Signed-off-by: Tejun Heo Acked-by: Michal Hocko Cc: Glauber Costa Reviewed-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More m

Re: [PATCH 2/9] cgroup: Use rculist ops for cgroup->children

2012-11-07 Thread Kamezawa Hiroyuki
This isn't strictly necessary but is done so that the iteration order is more conventional. Signed-off-by: Tejun Heo Reviewed-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.or

Re: [PATCH 3/9] cgroup: implement generic child / descendant walk macros

2012-11-07 Thread Kamezawa Hiroyuki
Signed-off-by: Tejun Heo maybe better than using css->id in some(many) case. Reviewed-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH 4/9] cgroup_freezer: trivial cleanups

2012-11-07 Thread Kamezawa Hiroyuki
(2012/11/03 17:38), Tejun Heo wrote: * Clean-up indentation and line-breaks. Drop the invalid comment about freezer->lock. * Make all internal functions take @freezer instead of both @cgroup and @freezer. Signed-off-by: Tejun Heo Reviewed-by: KAMEZAWA Hiroyuki -- To unsubscr

Re: [PATCH 5/9] cgroup_freezer: prepare freezer_change_state() for full hierarchy support

2012-11-07 Thread Kamezawa Hiroyuki
handling later on. This patch doesn't introduce any behavior change. Signed-off-by: Tejun Heo Reviewed-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordom

Re: [PATCH 6/9] cgroup_freezer: make freezer->state mask of flags

2012-11-07 Thread Kamezawa Hiroyuki
(2012/11/03 17:38), Tejun Heo wrote: freezer->state was an enum value - one of THAWED, FREEZING and FROZEN. As the scheduled full hierarchy support requires more than one freezing condition, switch it to mask of flags. If FREEZING is not set, it's thawed. FREEZING is set if freezing or frozen.

Re: [PATCH 7/9] cgroup_freezer: introduce CGROUP_FREEZING_[SELF|PARENT]

2012-11-07 Thread Kamezawa Hiroyuki
(2012/11/03 17:38), Tejun Heo wrote: Introduce FREEZING_SELF and FREEZING_PARENT and make FREEZING OR of the two flags. This is to prepare for full hierarchy support. freezer_apply_date() is updated such that it can handle setting and clearing of both flags. The two flags are also exposed to u

Re: [PATCH 8/9] cgroup_freezer: add ->post_create() and ->pre_destroy() and track online state

2012-11-07 Thread Kamezawa Hiroyuki
b/kernel/cgroup_freezer.c > @@ -23,6 +23,7 @@ > #include > > enum freezer_state_flags { > + CGROUP_FREEZER_ONLINE = (1 << 0), /* freezer is fully online */ Could you explain what 'online' means here again, rather than changelog ? BTW, 'online' is a shared concept, between

Re: [PATCH 7/9] cgroup_freezer: introduce CGROUP_FREEZING_[SELF|PARENT]

2012-11-07 Thread Kamezawa Hiroyuki
(2012/11/08 13:45), Tejun Heo wrote: Hello, On Thu, Nov 08, 2012 at 01:42:22PM +0900, Kamezawa Hiroyuki wrote: (2012/11/03 17:38), Tejun Heo wrote: Introduce FREEZING_SELF and FREEZING_PARENT and make FREEZING OR of the two flags. This is to prepare for full hierarchy support

Re: [PATCH 6/9] cgroup_freezer: make freezer->state mask of flags

2012-11-07 Thread Kamezawa Hiroyuki
(2012/11/08 13:42), Tejun Heo wrote: Hello, Kame. On Thu, Nov 08, 2012 at 01:37:50PM +0900, Kamezawa Hiroyuki wrote: How about enum { __CGROUP_FREEZING, __CGROUP_FROZEN, }; #define CGROUP_FREEZER_STATE_MASK 0x3 #define CGROUP_FREEZER_STATE(state) ((state

Re: [PATCH 1/2] memcg, oom: provide more precise dump info while memcg oom happening

2012-11-08 Thread Kamezawa Hiroyuki
by: Sha Zhengju > Cc: Michal Hocko > Cc: KAMEZAWA Hiroyuki > Cc: David Rientjes > Cc: Andrew Morton > --- > mm/memcontrol.c | 71 > --- > mm/oom_kill.c |6 +++- > 2 files changed, 66 insertions(+), 11 del

Re: [PATCH V3] memcg, oom: provide more precise dump info while memcg oom happening

2012-11-09 Thread Kamezawa Hiroyuki
(2012/11/09 0:52), Sha Zhengju wrote: > From: Sha Zhengju > > Current when a memcg oom is happening the oom dump messages is still global > state and provides few useful info for users. This patch prints more pointed > memcg page statistics for memcg-oom. > > > We set up a simple cgroup hierarc

Re: [RFC v4 0/3] Support volatile for anonymous range

2012-12-25 Thread Kamezawa Hiroyuki
0swaps > > DONTNEED test > 28.02user 41.25system 0:05.80elapsed 1192%CPU (0avgtext+0avgdata > 387776maxresident)k > > [1] 74e3f3c3, vmscan: prevent background aging of anon page in no swap system > > Any comments are welcome! > > Cc: Michael Kerrisk > Cc:

Re: [PATCH v5 01/14] memory-hotplug: try to offline the memory twice to avoid dependence

2012-12-25 Thread Kamezawa Hiroyuki
(2012/12/24 21:09), Tang Chen wrote: > From: Wen Congyang > > memory can't be offlined when CONFIG_MEMCG is selected. > For example: there is a memory device on node 1. The address range > is [1G, 1.5G). You will find 4 new directories memory8, memory9, memory10, > and memory11 under the director

Re: [PATCH v5 02/14] memory-hotplug: check whether all memory blocks are offlined or not when removing memory

2012-12-25 Thread Kamezawa Hiroyuki
-by: Wen Congyang > Signed-off-by: Yasuaki Ishimatsu Acked-by: KAMEZAWA Hiroyuki a nitpick below. > --- > drivers/base/memory.c |6 + > include/linux/memory_hotplug.h |1 + > mm/memory_hotplug.c| 47 > +

Re: [PATCH v5 03/14] memory-hotplug: remove redundant codes

2012-12-25 Thread Kamezawa Hiroyuki
(2012/12/24 21:09), Tang Chen wrote: > From: Wen Congyang > > offlining memory blocks and checking whether memory blocks are offlined > are very similar. This patch introduces a new function to remove > redundant codes. > > Signed-off-by: Wen Congyang > --- > mm/memory_hotplug.c | 101 > +++

Re: [PATCH v5 04/14] memory-hotplug: remove /sys/firmware/memmap/X sysfs

2012-12-25 Thread Kamezawa Hiroyuki
(2012/12/24 21:09), Tang Chen wrote: > From: Yasuaki Ishimatsu > > When (hot)adding memory into system, /sys/firmware/memmap/X/{end, start, type} > sysfs files are created. But there is no code to remove these files. The patch > implements the function to remove them. > > Note: The code does not

Re: [PATCH v5 05/14] memory-hotplug: introduce new function arch_remove_memory() for removing page table depends on architecture

2012-12-25 Thread Kamezawa Hiroyuki
move_pages() for some archtecuture is not implemented >(I don't know how to implement it for s390). > > Signed-off-by: Wen Congyang Then, remove code will be symetric to add codes. Acked-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send the line "unsubscribe l

Re: [PATCH v5 07/14] memory-hotplug: move pgdat_resize_lock into sparse_remove_one_section()

2012-12-25 Thread Kamezawa Hiroyuki
FIX or -fix- in patch title will be appreciated, I think. Acked-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH v5 14/14] memory-hotplug: free node_data when a node is offlined

2012-12-25 Thread Kamezawa Hiroyuki
(2012/12/24 21:09), Tang Chen wrote: > From: Wen Congyang > > We call hotadd_new_pgdat() to allocate memory to store node_data. So we > should free it when removing a node. > > Signed-off-by: Wen Congyang I'm sorry but is it safe to remove pgdat ? All zone cache and zonelists are properly clea

Re: [RFC v4 0/3] Support volatile for anonymous range

2012-12-27 Thread Kamezawa Hiroyuki
(2012/12/26 12:46), Minchan Kim wrote: Hi Kame, What are you doing these holiday season? :) I can't believe you sit down in front of computer. Honestly, my holiday starts tomorrow ;) (but until 1/5 in the next year.) Hm, by the way, the user need to attach pages to the process by causing p

Re: [PATCH v5 14/14] memory-hotplug: free node_data when a node is offlined

2012-12-27 Thread Kamezawa Hiroyuki
(2012/12/27 21:16), Wen Congyang wrote: > At 12/26/2012 11:55 AM, Kamezawa Hiroyuki Wrote: >> (2012/12/24 21:09), Tang Chen wrote: >>> From: Wen Congyang >>> >>> We call hotadd_new_pgdat() to allocate memory to store node_data. So we >>> should free i

Re: [PATCH V3 2/8] Make TestSetPageDirty and dirty page accounting in one func

2012-12-27 Thread Kamezawa Hiroyuki
at (usec): min=1 , max=856333 , avg=31.043, stdev=1769.32 > > Note that the impact is little(<1%). > > > Signed-off-by: Sha Zhengju > Reviewed-by: Michal Hocko Acked-by: KAMEZAWA Hiroyuki Hmm,..this change should be double-checked by vfs, I/O guys... increasing hold time of ma

Re: [PATCH V3 3/8] use vfs __set_page_dirty interface instead of doing it inside filesystem

2012-12-27 Thread Kamezawa Hiroyuki
u > Acked-by: Sage Weil Acked-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH V3 5/8] memcg: add per cgroup writeback pages accounting

2012-12-27 Thread Kamezawa Hiroyuki
roup_update_page_stat() > mem_cgroup_end_update_page_stat() > > There're two writeback interface to modify: test_clear/set_page_writeback. > > Signed-off-by: Sha Zhengju Acked-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send the line "unsubscribe li

Re: [PATCH V3 6/8] memcg: Don't account root_mem_cgroup page statistics

2012-12-27 Thread Kamezawa Hiroyuki
(2012/12/26 2:27), Sha Zhengju wrote: > From: Sha Zhengju > > If memcg is enabled and no non-root memcg exists, all allocated pages > belongs to root_mem_cgroup and go through root memcg statistics routines > which brings some overheads. So for the sake of performance, we can give > up accounting

Re: [PATCH V3 7/8] memcg: disable memcg page stat accounting code when not in use

2012-12-27 Thread Kamezawa Hiroyuki
when not used. when the first non-root memcg comes to > life the code is patching in otherwise it is out. > > Signed-off-by: Sha Zhengju Acked-by: KAMEZAWA Hiroyuki -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord

Re: [PATCH V3 8/8] memcg: Document cgroup dirty/writeback memory statistics

2012-12-27 Thread Kamezawa Hiroyuki
(2012/12/26 2:28), Sha Zhengju wrote: > From: Sha Zhengju > > Signed-off-by: Sha Zhengju I don't think your words are bad but it may be better to sync with meminfo's text. > --- > Documentation/cgroups/memory.txt |2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/Documentation/

Re: [PATCH V3 7/8] memcg: disable memcg page stat accounting code when not in use

2012-12-27 Thread Kamezawa Hiroyuki
(2012/12/26 2:27), Sha Zhengju wrote: > From: Sha Zhengju > > It's inspired by a similar optimization from Glauber Costa > (memcg: make it suck faster; https://lkml.org/lkml/2012/9/25/154). > Here we use jump label to patch the memcg page stat accounting code > in or out when not used. when the f

Re: [PATCH 5/7] memcg: get rid of once-per-second cache shrinking for dead memcgs

2012-11-15 Thread Kamezawa Hiroyuki
(2012/11/15 22:47), Glauber Costa wrote: > On 11/15/2012 01:41 PM, Kamezawa Hiroyuki wrote: >> (2012/11/15 11:54), Glauber Costa wrote: >>> The idea is to synchronously do it, leaving it up to the shrinking >>> facilities in vmscan.c and/or others. Not actively retrying

  1   2   3   4   5   6   7   8   >