lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A0BCDEE.5020708@cn.fujitsu.com>
Date:	Thu, 14 May 2009 15:53:18 +0800
From:	Gui Jianfeng <guijianfeng@...fujitsu.com>
To:	Vivek Goyal <vgoyal@...hat.com>
CC:	nauman@...gle.com, dpshah@...gle.com, lizf@...fujitsu.com,
	mikew@...gle.com, fchecconi@...il.com, paolo.valente@...more.it,
	jens.axboe@...cle.com, ryov@...inux.co.jp, fernando@....ntt.co.jp,
	s-uchida@...jp.nec.com, taka@...inux.co.jp, jmoyer@...hat.com,
	dhaval@...ux.vnet.ibm.com, balbir@...ux.vnet.ibm.com,
	linux-kernel@...r.kernel.org,
	containers@...ts.linux-foundation.org, righi.andrea@...il.com,
	agk@...hat.com, dm-devel@...hat.com, snitzer@...hat.com,
	m-ikeda@...jp.nec.com, akpm@...ux-foundation.org
Subject: Re: [PATCH 07/18] io-controller: Export disk time used and nr	sectors
 dipatched through cgroups

Vivek Goyal wrote:
> On Wed, May 13, 2009 at 10:39:07AM +0800, Gui Jianfeng wrote:
>> 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.
>>
> 
> Or can we get rid of requirement of iocg_lock here and just read the io
> group data under rcu read lock? Actually I am wondering why do we require
> an iocg_lock here. We are not modifying the rcu protected list. We are
> just traversing through it and reading the data.

  Yes, i think removing the iocg->lock from caller(io_cgroup_disk_time_read()) 
  is a better choice.

> 
> Thanks
> Vivek
> 
>>> +	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
> 
> 
> 

-- 
Regards
Gui Jianfeng

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ