[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[dm-devel] Re: [PATCH 07/18] io-controller: Export disk time used and nr sectors dipatched through cgroups
- From: Gui Jianfeng <guijianfeng cn fujitsu com>
- To: Vivek Goyal <vgoyal redhat com>
- Cc: dhaval linux vnet ibm com, snitzer redhat com, dm-devel redhat com, dpshah google com, jens axboe oracle com, agk redhat com, balbir linux vnet ibm com, paolo valente unimore it, fernando oss ntt co jp, mikew google com, jmoyer redhat com, nauman google com, m-ikeda ds jp nec com, lizf cn fujitsu com, fchecconi gmail com, s-uchida ap jp nec com, containers lists linux-foundation org, linux-kernel vger kernel org, akpm linux-foundation org, righi andrea gmail com
- Subject: [dm-devel] Re: [PATCH 07/18] io-controller: Export disk time used and nr sectors dipatched through cgroups
- Date: Wed, 13 May 2009 10:39:07 +0800
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
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]