lkml.org 
[lkml]   [2009]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 07/18] io-controller: Export disk time used and nr sectors dipatched through cgroups
Vivek Goyal wrote:
...
>
> +/*
> + * traverse through all the io_groups associated with this cgroup and calculate
> + * the aggr disk time received by all the groups on respective disks.
> + */
> +static u64 calculate_aggr_disk_time(struct io_cgroup *iocg)
> +{
> + struct io_group *iog;
> + struct hlist_node *n;
> + u64 disk_time = 0;
> +
> + rcu_read_lock();

This function is in slow-path, so no need to call rcu_read_lock(), just need to ensure
that the caller already holds the iocg->lock.

> + hlist_for_each_entry_rcu(iog, n, &iocg->group_data, group_node) {
> + /*
> + * There might be groups which are not functional and
> + * waiting to be reclaimed upon cgoup deletion.
> + */
> + if (rcu_dereference(iog->key))
> + disk_time += iog->entity.total_service;
> + }
> + rcu_read_unlock();
> +
> + return disk_time;
> +}
> +

--
Regards
Gui Jianfeng



\
 
 \ /
  Last update: 2009-05-13 04:43    [W:0.574 / U:0.124 seconds]
©2003-2014 Jasper Spaans. Advertise on this site