Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030424AbVLNDai (ORCPT ); Tue, 13 Dec 2005 22:30:38 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1030425AbVLNDai (ORCPT ); Tue, 13 Dec 2005 22:30:38 -0500 Received: from fmr17.intel.com ([134.134.136.16]:1700 "EHLO orsfmr002.jf.intel.com") by vger.kernel.org with ESMTP id S1030424AbVLNDah (ORCPT ); Tue, 13 Dec 2005 22:30:37 -0500 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C6005E.BF161B04" Subject: [PATCH 2/2] Export cpu info by sysfs X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Date: Wed, 14 Dec 2005 11:30:33 +0800 Message-ID: <8126E4F969BA254AB43EA03C59F44E840431BB3D@pdsmsx404> X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: [PATCH 2/2] Export cpu info by sysfs Thread-Index: AcYAXr3MAY022mytTW6hF4QBHYYZlw== From: "Zhang, Yanmin" To: Cc: "Pallipadi, Venkatesh" X-OriginalArrivalTime: 14 Dec 2005 03:30:36.0196 (UTC) FILETIME=[BF3C3E40:01C6005E] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 19560 Lines: 286 This is a multi-part message in MIME format. ------_=_NextPart_001_01C6005E.BF161B04 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable The second patch is to export cache info which is similar to /proc/pal/cpuX/cache_info. One important new item is shared_cpu_map. shared_cpu_map showes the cpu map sharing the cache. The items (attributes) are: level type coherency_line_size stride ways_of_associativity store_latency load_latency store_hints load_hints alias_boundary tag_lsb tag_msb size shared_cpu_map attributes This patch depends on the first patch because they change the same source file. Signed-off-by: Zhang Yanmin ------_=_NextPart_001_01C6005E.BF161B04 Content-Type: application/octet-stream; name="export_cache_info_sysfs_2.6.14_mm1_ia64.v12.patch" Content-Transfer-Encoding: base64 Content-Description: export_cache_info_sysfs_2.6.14_mm1_ia64.v12.patch Content-Disposition: attachment; filename="export_cache_info_sysfs_2.6.14_mm1_ia64.v12.patch" ZGlmZiAtTnJhdXAgbGludXgtMi42LjE0X21tMV90b3BvbG9neS9hcmNoL2lhNjQva2VybmVsL3Rv cG9sb2d5LmMgbGludXgtMi42LjE0X21tMV9jYWNoZS9hcmNoL2lhNjQva2VybmVsL3RvcG9sb2d5 LmMKLS0tIGxpbnV4LTIuNi4xNF9tbTFfdG9wb2xvZ3kvYXJjaC9pYTY0L2tlcm5lbC90b3BvbG9n eS5jCTIwMDUtMTEtMDkgMTc6MjY6NTYuMDAwMDAwMDAwICswODAwCisrKyBsaW51eC0yLjYuMTRf bW0xX2NhY2hlL2FyY2gvaWE2NC9rZXJuZWwvdG9wb2xvZ3kuYwkyMDA1LTExLTA5IDE3OjI5OjU4 LjAwMDAwMDAwMCArMDgwMApAQCAtMTksNiArMTksNyBAQAogI2luY2x1ZGUgPGxpbnV4L2luaXQu aD4KICNpbmNsdWRlIDxsaW51eC9ib290bWVtLmg+CiAjaW5jbHVkZSA8bGludXgvbm9kZW1hc2su aD4KKyNpbmNsdWRlIDxsaW51eC9ub3RpZmllci5oPgogI2luY2x1ZGUgPGFzbS9tbXpvbmUuaD4K ICNpbmNsdWRlIDxhc20vbnVtYS5oPgogI2luY2x1ZGUgPGFzbS9jcHUuaD4KQEAgLTI0NCw1ICsy NDUsNDY3IEBAIHN0YXRpYyBpbnQgX19jcHVpbml0IHRvcG9sb2d5X3N5c2ZzX2luaXQKIGRldmlj ZV9pbml0Y2FsbCh0b3BvbG9neV9zeXNmc19pbml0KTsKIAogI2VuZGlmIC8vQ09ORklHX1NNUAor CisKKy8qCisgKiBFeHBvcnQgY3B1IGNhY2hlIGluZm9ybWF0aW9uIHRocm91Z2ggc3lzZnMKKyAq LworCisvKgorICogIEEgYnVuY2ggb2Ygc3RyaW5nIGFycmF5IHRvIGdldCBwcmV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BhbF9jYWNoZV9zaGFy ZWRfaW5mb190OworCisvKiBHZXQgaW5mb3JtYXRpb24gb24gbG9naWNhbCB0byBwaHlzaWNhbCBw cm9jZXNzb3IgbWFwcGluZ3MuICovCitzdGF0aWMgaW5saW5lIHM2NAoraWE2NF9wYWxfY2FjaGVf c2hhcmVkX2luZm8odTY0IGxldmVsLAorCQl1NjQgdHlwZSwKKwkJdTY0IHByb2NfbnVtYmVyLAor CQlwYWxfY2FjaGVfc2hhcmVkX2luZm9fdCAqaW5mbykKK3sKKwlzdHJ1Y3QgaWE2NF9wYWxfcmV0 dmFsIGlwcnY7CisKKwlQQUxfQ0FMTChpcHJ2LCBQQUxfQ0FDSEVfU0hBUkVEX0lORk8sIGxldmVs LCB0eXBlLCBwcm9jX251bWJlcik7CisKKwlpZiAoaXBydi5zdGF0dXMgPT0gUEFMX1NUQVRVU19T VUNDRVNTKSB7CisJCWluZm8tPm51bV9zaGFyZWQgPSBpcHJ2LnYwOworCQlpbmZvLT5wcGxpMS5w cGxpMV9kYXRhID0gaXBydi52MTsKKwkJaW5mby0+cHBsaTIucHBsaTJfZGF0YSA9IGlwcnYudjI7 CisJfQorCisJcmV0dXJuIGlwcnYuc3RhdHVzOworfQogI2VuZGlmIC8qIF9fQVNTRU1CTFlfXyAq LwogCiAjZW5kaWYgLyogX0FTTV9JQTY0X1BBTF9IICovCg== ------_=_NextPart_001_01C6005E.BF161B04-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/