Re: [PATCH v2] vmpressure: make sure memcg stays alive until all users are signaled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri 12-07-13 17:54:27, Li Zefan wrote:
> On 2013/7/12 17:29, Michal Hocko wrote:
> > On Fri 12-07-13 17:20:09, Li Zefan wrote:
> > [...]
> >> But if I read the code correctly, even no one registers a vmpressure event,
> >> vmpressure() is always running and queue the work item.
> > 
> > True but checking there is somebody is rather impractical. First we
> > would have to take a events_lock to check this and then drop it after
> > scheduling the work. Which doesn't guarantee that the registered event
> > wouldn't go away.
> > And even trickier, we would have to do the same for all parents up the
> > hierarchy.
> > 
> 
> The thing is, we can forget about eventfd. eventfd is checked in
> vmpressure_work_fn(), while vmpressure() is always called no matter what.

But vmpressure is called only for an existing memcg. This means that
it cannot be called past css_offline so it must happen _before_ cgroup
eventfd cleanup code.

Or am I missing something?

> vmpressure()
>   queue_work()
>                       cgroup_diput()
>                         call_rcu(cgroup_free_rcu)                        
>                       ...
>                       queue_work(destroy_cgroup)
>                       ...
>                       cgroup_free_fn()
>                         mem_cgroup_destroy()
>   ...
>   vmpress_work_fn()
> 
> There's no guarantee that vmpressure work is run before cgroup destroy
> work, I think.
> 

-- 
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe cgroups" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux