From: Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
To: KAMEZAWA Hiroyuki
<kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
Cc: "akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org"
<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
"linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org"
<linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org>,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Michal Hocko <mhocko-AlSwsSmVLrQ@public.gmane.org>,
Hugh Dickins <hughd-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH v3] memcg: return -EINTR at bypassing try_charge().
Date: Wed, 21 Dec 2011 13:28:15 +0100 [thread overview]
Message-ID: <20111221122815.GF3870@cmpxchg.org> (raw)
In-Reply-To: <20111221192934.2751f8f1.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
On Wed, Dec 21, 2011 at 07:29:34PM +0900, KAMEZAWA Hiroyuki wrote:
> Thank you for review.
> I'm sorry if my response is delayed.
> ==
> >From 1e8c917c64b3947d2e54c6e5073d53d80bd97c30 Mon Sep 17 00:00:00 2001
> From: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
> Date: Wed, 21 Dec 2011 16:27:25 +0900
> Subject: [PATCH] memcg: return -EINTR at bypassing try_charge().
>
> This patch is a fix for memcg-simplify-lru-handling-by-new-rule.patch
> When running testprogram and stop it by Ctrl-C, add_lru/del_lru
> will find pc->mem_cgroup is NULL and get panic. The reason
> is bypass code in try_charge().
>
> At try_charge(), it checks the thread is fatal or not as..
> fatal_signal_pending() or TIF_MEMDIE. In this case, __try_charge()
> returns 0(success) with setting *ptr as NULL.
>
> Now, lruvec are deteremined by pc->mem_cgroup. So, it's better
> to reset pc->mem_cgroup as root_mem_cgroup. This patch does
> following change in try_charge()
> 1. return -EINTR at bypassing.
> 2. set *ptr = root_mem_cgroup at bypassing.
>
> By this change, in page fault / radix-tree-insert path,
> the page will be charged against root_mem_cgroup and the thread's
> operations will go ahead without trouble. In other path,
> migration or move_account etc..., -EINTR will stop the operation.
> (may need some cleanup later..)
>
> After this change, pc->mem_cgroup will have valid pointer if
> the page is used.
>
> Changelog: v2 -> v3
> - handle !mm case in another way.
> - removed redundant commments
> - fixed move_parent bug of uninitialized pointer
> Changelog: v1 -> v2
> - returns -EINTR at bypassing.
> - change error code handling at callers.
> - changed the name of patch.
>
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
Looks good now, thanks.
Acked-by: Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
WARNING: multiple messages have this Message-ID (diff)
From: Johannes Weiner <hannes@cmpxchg.org>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: "akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
cgroups@vger.kernel.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Michal Hocko <mhocko@suse.cz>, Hugh Dickins <hughd@google.com>
Subject: Re: [PATCH v3] memcg: return -EINTR at bypassing try_charge().
Date: Wed, 21 Dec 2011 13:28:15 +0100 [thread overview]
Message-ID: <20111221122815.GF3870@cmpxchg.org> (raw)
In-Reply-To: <20111221192934.2751f8f1.kamezawa.hiroyu@jp.fujitsu.com>
On Wed, Dec 21, 2011 at 07:29:34PM +0900, KAMEZAWA Hiroyuki wrote:
> Thank you for review.
> I'm sorry if my response is delayed.
> ==
> >From 1e8c917c64b3947d2e54c6e5073d53d80bd97c30 Mon Sep 17 00:00:00 2001
> From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Date: Wed, 21 Dec 2011 16:27:25 +0900
> Subject: [PATCH] memcg: return -EINTR at bypassing try_charge().
>
> This patch is a fix for memcg-simplify-lru-handling-by-new-rule.patch
> When running testprogram and stop it by Ctrl-C, add_lru/del_lru
> will find pc->mem_cgroup is NULL and get panic. The reason
> is bypass code in try_charge().
>
> At try_charge(), it checks the thread is fatal or not as..
> fatal_signal_pending() or TIF_MEMDIE. In this case, __try_charge()
> returns 0(success) with setting *ptr as NULL.
>
> Now, lruvec are deteremined by pc->mem_cgroup. So, it's better
> to reset pc->mem_cgroup as root_mem_cgroup. This patch does
> following change in try_charge()
> 1. return -EINTR at bypassing.
> 2. set *ptr = root_mem_cgroup at bypassing.
>
> By this change, in page fault / radix-tree-insert path,
> the page will be charged against root_mem_cgroup and the thread's
> operations will go ahead without trouble. In other path,
> migration or move_account etc..., -EINTR will stop the operation.
> (may need some cleanup later..)
>
> After this change, pc->mem_cgroup will have valid pointer if
> the page is used.
>
> Changelog: v2 -> v3
> - handle !mm case in another way.
> - removed redundant commments
> - fixed move_parent bug of uninitialized pointer
> Changelog: v1 -> v2
> - returns -EINTR at bypassing.
> - change error code handling at callers.
> - changed the name of patch.
>
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Looks good now, thanks.
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Johannes Weiner <hannes@cmpxchg.org>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: "akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
cgroups@vger.kernel.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Michal Hocko <mhocko@suse.cz>, Hugh Dickins <hughd@google.com>
Subject: Re: [PATCH v3] memcg: return -EINTR at bypassing try_charge().
Date: Wed, 21 Dec 2011 13:28:15 +0100 [thread overview]
Message-ID: <20111221122815.GF3870@cmpxchg.org> (raw)
In-Reply-To: <20111221192934.2751f8f1.kamezawa.hiroyu@jp.fujitsu.com>
On Wed, Dec 21, 2011 at 07:29:34PM +0900, KAMEZAWA Hiroyuki wrote:
> Thank you for review.
> I'm sorry if my response is delayed.
> ==
> >From 1e8c917c64b3947d2e54c6e5073d53d80bd97c30 Mon Sep 17 00:00:00 2001
> From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Date: Wed, 21 Dec 2011 16:27:25 +0900
> Subject: [PATCH] memcg: return -EINTR at bypassing try_charge().
>
> This patch is a fix for memcg-simplify-lru-handling-by-new-rule.patch
> When running testprogram and stop it by Ctrl-C, add_lru/del_lru
> will find pc->mem_cgroup is NULL and get panic. The reason
> is bypass code in try_charge().
>
> At try_charge(), it checks the thread is fatal or not as..
> fatal_signal_pending() or TIF_MEMDIE. In this case, __try_charge()
> returns 0(success) with setting *ptr as NULL.
>
> Now, lruvec are deteremined by pc->mem_cgroup. So, it's better
> to reset pc->mem_cgroup as root_mem_cgroup. This patch does
> following change in try_charge()
> 1. return -EINTR at bypassing.
> 2. set *ptr = root_mem_cgroup at bypassing.
>
> By this change, in page fault / radix-tree-insert path,
> the page will be charged against root_mem_cgroup and the thread's
> operations will go ahead without trouble. In other path,
> migration or move_account etc..., -EINTR will stop the operation.
> (may need some cleanup later..)
>
> After this change, pc->mem_cgroup will have valid pointer if
> the page is used.
>
> Changelog: v2 -> v3
> - handle !mm case in another way.
> - removed redundant commments
> - fixed move_parent bug of uninitialized pointer
> Changelog: v1 -> v2
> - returns -EINTR at bypassing.
> - change error code handling at callers.
> - changed the name of patch.
>
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Looks good now, thanks.
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
next prev parent reply other threads:[~2011-12-21 12:28 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-19 7:51 [PATCH] memcg: reset to root_mem_cgroup at bypassing KAMEZAWA Hiroyuki
2011-12-19 7:51 ` KAMEZAWA Hiroyuki
2011-12-19 7:51 ` KAMEZAWA Hiroyuki
2011-12-19 20:49 ` Hugh Dickins
2011-12-19 20:49 ` Hugh Dickins
2011-12-20 0:24 ` Hiroyuki Kamezawa
2011-12-20 0:24 ` Hiroyuki Kamezawa
2011-12-21 0:13 ` KAMEZAWA Hiroyuki
2011-12-21 0:13 ` KAMEZAWA Hiroyuki
2011-12-21 0:13 ` KAMEZAWA Hiroyuki
[not found] ` <20111221091347.4f1a10d8.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2011-12-21 3:25 ` Hugh Dickins
2011-12-21 3:25 ` Hugh Dickins
2011-12-21 4:00 ` KAMEZAWA Hiroyuki
2011-12-21 4:00 ` KAMEZAWA Hiroyuki
2011-12-21 4:00 ` KAMEZAWA Hiroyuki
[not found] ` <20111219165146.4d72f1bb.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2011-12-21 8:24 ` [PATCH v2] memcg: return -EINTR at bypassing try_charge() KAMEZAWA Hiroyuki
2011-12-21 8:24 ` KAMEZAWA Hiroyuki
2011-12-21 8:24 ` KAMEZAWA Hiroyuki
2011-12-21 9:57 ` Johannes Weiner
2011-12-21 9:57 ` Johannes Weiner
[not found] ` <20111221095708.GE3870-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2011-12-21 10:08 ` KAMEZAWA Hiroyuki
2011-12-21 10:08 ` KAMEZAWA Hiroyuki
2011-12-21 10:08 ` KAMEZAWA Hiroyuki
[not found] ` <20111221172423.5d036cdd.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2011-12-21 10:29 ` [PATCH v3] " KAMEZAWA Hiroyuki
2011-12-21 10:29 ` KAMEZAWA Hiroyuki
2011-12-21 10:29 ` KAMEZAWA Hiroyuki
[not found] ` <20111221192934.2751f8f1.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2011-12-21 12:28 ` Johannes Weiner [this message]
2011-12-21 12:28 ` Johannes Weiner
2011-12-21 12:28 ` Johannes Weiner
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=20111221122815.GF3870@cmpxchg.org \
--to=hannes-druugvl0lcnafugrpc6u6w@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=hughd-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
--cc=mhocko-AlSwsSmVLrQ@public.gmane.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.