Re: (resend) [PATCH] vmscan,memcg: memcg aware swap token

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

 



> On Tue, 26 Apr 2011 16:59:19 +0900 (JST)
> KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx> wrote:
> 
> > @@ -75,3 +76,19 @@ void __put_swap_token(struct mm_struct *mm)
> >  		swap_token_mm = NULL;
> >  	spin_unlock(&swap_token_lock);
> >  }
> > +
> > +int has_swap_token_memcg(struct mm_struct *mm, struct mem_cgroup *memcg)
> > +{
> > +	if (memcg) {
> > +		struct mem_cgroup *swap_token_memcg;
> > +
> > +		/*
> > +		 * memcgroup reclaim can disable swap token only if token task
> > +		 * is in the same cgroup.
> > +		 */
> > +		swap_token_memcg = try_get_mem_cgroup_from_mm(swap_token_mm);
> > +		return ((mm == swap_token_mm) && (memcg == swap_token_memcg));
> > +	} else
> > +		return (mm == swap_token_mm);
> > +}
> 
> Seems to be missing a css_put()?

Yes! Please drop this one. I'll rework it at this weekend.

Thank you for the finding!

> 
> Either I'm mistaken or that's a bug.  Perhaps neither of these would
> have happened if we'd bothered to document
> try_get_mem_cgroup_from_mm().
> 



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  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@xxxxxxxxx";> email@xxxxxxxxx </a>


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