lkml.org 
[lkml]   [2010]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH] memcg remove css_get/put per pages v2
* KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> [2010-06-09 15:59:40]:

> + if (consume_stock(mem)) {
> + /*
> + * It seems dagerous to access memcg without css_get().
> + * But considering how consume_stok works, it's not
> + * necessary. If consume_stock success, some charges
> + * from this memcg are cached on this cpu. So, we
> + * don't need to call css_get()/css_tryget() before
> + * calling consume_stock().
> + */
> + rcu_read_unlock();
> + goto done;
> + }
> + if (!css_tryget(&mem->css)) {

If tryget fails, can one assume that this due to a race and the mem is
about to be freed?


--
Three Cheers,
Balbir


\
 
 \ /
  Last update: 2010-06-11 08:15    [W:0.062 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site