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] [day] [month] [year] [list]
Date:	Fri, 11 May 2012 14:41:57 +0800
From:	"Yan, Zheng" <zheng.z.yan@...el.com>
To:	Anshuman Khandual <khandual@...ux.vnet.ibm.com>
CC:	a.p.zijlstra@...llo.nl, mingo@...e.hu, andi@...stfloor.org,
	eranian@...gle.com, jolsa@...hat.com, ming.m.lin@...el.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/9] perf: Generic intel uncore support

On 05/11/2012 02:31 PM, Anshuman Khandual wrote:
> On Wednesday 02 May 2012 07:37 AM, Yan, Zheng wrote:
> 
>> +static int __cpuinit uncore_cpu_prepare(int cpu)
>> +{
>> +	struct intel_uncore_type *type;
>> +	struct intel_uncore_pmu *pmu;
>> +	struct intel_uncore_box *exist, *box;
>> +	int i, j, phyid;
>> +
>> +	phyid = topology_physical_package_id(cpu);
>> +
>> +	/* allocate the box data structure */
>> +	for (i = 0; msr_uncores[i]; i++) {
>> +		type = msr_uncores[i];
>> +		for (j = 0; j < type->num_boxes; j++) {
>> +			exist = NULL;
>> +			pmu = &type->pmus[j];
>> +
>> +			if (pmu->func_id < 0)
>> +				pmu->func_id = j;
>> +			exist = uncore_pmu_find_box(pmu, phyid);
>> +			if (exist)
>> +				exist->refcnt++;
>> +			if (exist)
>> +				continue;
> 
> 
> 
> May be a redundant condition checking ^ ?

Yes, it's redundant. I will remove it in later patches.

Regards
Yan, Zheng
> 
>> +
>> +			box = uncore_alloc_box(cpu);
>> +			if (!box)
>> +				return -ENOMEM;
>> +
>> +			box->pmu = pmu;
>> +			box->phy_id = phyid;
>> +			uncore_pmu_add_box(pmu, box);
>> +		}
>> +	}
>> +	return 0;
> 
> 

--
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