Re: [PATCH -v2 4/6] memcg: make sure that memcg is not offline when charging

2014-02-05 Thread Michal Hocko
On Wed 05-02-14 11:45:43, Johannes Weiner wrote: > On Wed, Feb 05, 2014 at 05:19:40PM +0100, Michal Hocko wrote: > > On Wed 05-02-14 10:28:21, Johannes Weiner wrote: > > > Here is the only exception to the above: swapout records maintain > > > permanent css references, so they prevent css_free() fr

Re: [PATCH -v2 4/6] memcg: make sure that memcg is not offline when charging

2014-02-05 Thread Johannes Weiner
On Wed, Feb 05, 2014 at 05:19:40PM +0100, Michal Hocko wrote: > On Wed 05-02-14 10:28:21, Johannes Weiner wrote: > > Here is the only exception to the above: swapout records maintain > > permanent css references, so they prevent css_free() from running. > > For that reason alone we should run one o

Re: [PATCH -v2 4/6] memcg: make sure that memcg is not offline when charging

2014-02-05 Thread Michal Hocko
On Wed 05-02-14 17:19:40, Michal Hocko wrote: > On Wed 05-02-14 10:28:21, Johannes Weiner wrote: [...] > > I thought more about this and talked to Tejun as well. He told me > > that the rcu grace period between disabling tryget and calling > > css_offline() is currently an implementation detail of

Re: [PATCH -v2 4/6] memcg: make sure that memcg is not offline when charging

2014-02-05 Thread Tejun Heo
Hello, Michal. On Wed, Feb 05, 2014 at 05:19:40PM +0100, Michal Hocko wrote: > > Well, css_free() is the callback invoked when the ref counter hits 0, > > and that is a guarantee. From a memcg perspective, it's the right > > place to do reparenting, not css_offline(). > > OK, it seems I've total

Re: [PATCH -v2 4/6] memcg: make sure that memcg is not offline when charging

2014-02-05 Thread Michal Hocko
On Wed 05-02-14 10:28:21, Johannes Weiner wrote: > On Wed, Feb 05, 2014 at 02:38:34PM +0100, Michal Hocko wrote: > > On Tue 04-02-14 11:29:39, Johannes Weiner wrote: > > [...] > > > Maybe we should remove the XXX if it makes you think we should change > > > the current situation by any means necess

Re: [PATCH -v2 4/6] memcg: make sure that memcg is not offline when charging

2014-02-05 Thread Tejun Heo
Hello, guys. On Wed, Feb 05, 2014 at 10:28:21AM -0500, Johannes Weiner wrote: > I thought more about this and talked to Tejun as well. He told me > that the rcu grace period between disabling tryget and calling > css_offline() is currently an implementation detail of the refcounter > that css use

Re: [PATCH -v2 4/6] memcg: make sure that memcg is not offline when charging

2014-02-05 Thread Johannes Weiner
On Wed, Feb 05, 2014 at 02:38:34PM +0100, Michal Hocko wrote: > On Tue 04-02-14 11:29:39, Johannes Weiner wrote: > [...] > > Maybe we should remove the XXX if it makes you think we should change > > the current situation by any means necessary. This patch is not an > > improvement. > > > > I put t

Re: [PATCH -v2 4/6] memcg: make sure that memcg is not offline when charging

2014-02-05 Thread Michal Hocko
On Tue 04-02-14 11:29:39, Johannes Weiner wrote: [...] > Maybe we should remove the XXX if it makes you think we should change > the current situation by any means necessary. This patch is not an > improvement. > > I put the XXX there so that we one day maybe refactor the code in a > clean fashion

Re: [PATCH -v2 4/6] memcg: make sure that memcg is not offline when charging

2014-02-04 Thread Johannes Weiner
On Tue, Feb 04, 2014 at 02:28:58PM +0100, Michal Hocko wrote: > The current charge path might race with memcg offlining because holding > css reference doesn't neither prevent from task move to a different > group nor stop css offline. When a charging task is the last one in the > group and it is m

[PATCH -v2 4/6] memcg: make sure that memcg is not offline when charging

2014-02-04 Thread Michal Hocko
The current charge path might race with memcg offlining because holding css reference doesn't neither prevent from task move to a different group nor stop css offline. When a charging task is the last one in the group and it is moved to a different group in the middle of the charge the old memcg mi