Re: [PATCH 08/12] cgroup, memcg: move cgroup->event_list[_lock] and event callbacks into memcg

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

 



Hello, Michal.

On Fri, Aug 30, 2013 at 01:08:46PM +0200, Michal Hocko wrote:
> On Thu 15-08-13 12:02:26, Tejun Heo wrote:
> [...]
> > @@ -6030,12 +6050,13 @@ static void cgroup_event_ptable_queue_proc(struct file *file,
> >  static int cgroup_write_event_control(struct cgroup_subsys_state *css,
> >  				      struct cftype *cft, const char *buffer)
> >  {
> > -	struct cgroup *cgrp = css->cgroup;
> > +	struct mem_cgroup *memcg = mem_cgroup_from_css(css);
> >  	struct cgroup_event *event;
> >  	struct cgroup_subsys_state *cfile_css;
> >  	unsigned int efd, cfd;
> >  	struct file *efile;
> >  	struct file *cfile;
> > +	const char *name;
> >  	char *endp;
> >  	int ret;
> 
> AFAICS nothing prevents from registering a new event after css_offline
> is done already which would lead to a mem leak. The we would need to do
> css_tryget somewhere in the beginning. Or is there anything that would
> prevent from that?

An earlier patch titled "cgroup: make cgroup_event hold onto
cgroup_subsys_state instead of cgroup" updates cgroup_event such that
each cgroup_event acquires a css reference using css_tryget(), so if a
css has already been offlined, no new event will be created.

Thanks.

-- 
tejun
_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/containers




[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux