lkml.org 
[lkml]   [2012]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 05/12] blkcg: update blkg get functions take blkio_cgroup as parameter
On Wed, Jan 18, 2012 at 05:11:23PM -0800, Tejun Heo wrote:

[..]
> -static struct throtl_grp * throtl_get_tg(struct throtl_data *td)
> +static struct throtl_grp *throtl_get_tg(struct throtl_data *td,
> + struct blkio_cgroup *blkcg)
> {
> struct throtl_grp *tg = NULL, *__tg = NULL;
> - struct blkio_cgroup *blkcg;
> struct request_queue *q = td->queue;
>
> /* no throttling for dead queue */
> if (unlikely(blk_queue_dead(q)))
> return NULL;
>
> - blkcg = task_blkio_cgroup(current);
> tg = throtl_find_tg(td, blkcg);
> if (tg)
> return tg;
>
> + if (!css_tryget(&blkcg->css))
> + return NULL;
> +

This reference is to make sure that blkcg does not go away while we drop
the rcu lock and do the group allocation?

Thanks
Vivek


\
 
 \ /
  Last update: 2012-01-19 12:23    [from the cache]
©2003-2011 Jasper Spaans