From patchwork Tue Oct 13 11:13:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: hongbo.zhang@freescale.com X-Patchwork-Id: 54833 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id B45B220490 for ; Tue, 13 Oct 2015 11:33:02 +0000 (UTC) Received: by wijq8 with SMTP id q8sf8871639wij.1 for ; Tue, 13 Oct 2015 04:33:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:mime-version:spamdiagnosticoutput :spamdiagnosticmetadata:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :content-type:content-transfer-encoding:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=Yd+d5i8t5ND5EALRQWhmgcfjLJ6kRurnyhdwOK2ssKs=; b=jN7mXuw+Fiuqclh3RY/PsIYJVDvI7qiay8rCs5Di2aw01g1CU8MKu6L0LNhsRZZ7dv GeJndCAPNSLXDP4cNQIZcR4f3GWj5MYwAu+G8GgPb3ZKi7D/Fvx1Qp9e+UJlaZhzmM26 PnoZD5zgENhN0yorYgOjyGqmnUcVA+vZgAPrCFwiIUVNQqZMR/5Bs4aplVrqnmptWBpk nDdETd0yTztTKUNOF/i+Ef8NBD9iZiZwa/R/evdwQcywHgr4IDrNMGBV958pdWGHkcNP 5/jbsFQprr9vTBPbJW1q7UfEPDBQxaj3bzeWkzUYggaD8pf0NHFTwPWnaEyCl4Bv8WV1 4wrg== X-Gm-Message-State: ALoCoQmETmYcc9OXB7dMMB+bC02e+WUOdfqtKmFJ8MX6o35d3cOuzOVJd2pBRI+PFrJEL4zQs+kb X-Received: by 10.112.140.202 with SMTP id ri10mr6165869lbb.10.1444735981823; Tue, 13 Oct 2015 04:33:01 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.30.18 with SMTP id e18ls586110lfe.35.gmail; Tue, 13 Oct 2015 04:33:01 -0700 (PDT) X-Received: by 10.112.209.4 with SMTP id mi4mr15057676lbc.7.1444735981710; Tue, 13 Oct 2015 04:33:01 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id qi7si1893720lbb.13.2015.10.13.04.33.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Oct 2015 04:33:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbwr8 with SMTP id r8so16100046lbw.2 for ; Tue, 13 Oct 2015 04:33:01 -0700 (PDT) X-Received: by 10.112.163.131 with SMTP id yi3mr14723161lbb.36.1444735981334; Tue, 13 Oct 2015 04:33:01 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp2073681lbq; Tue, 13 Oct 2015 04:33:00 -0700 (PDT) X-Received: by 10.107.159.3 with SMTP id i3mr11803305ioe.42.1444735980218; Tue, 13 Oct 2015 04:33:00 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id g8si2492420igh.103.2015.10.13.04.32.59; Tue, 13 Oct 2015 04:33:00 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id A2F9061B4D; Tue, 13 Oct 2015 11:32:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id F31E361A30; Tue, 13 Oct 2015 11:31:47 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 9E2E961A22; Tue, 13 Oct 2015 11:31:38 +0000 (UTC) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0120.outbound.protection.outlook.com [65.55.169.120]) by lists.linaro.org (Postfix) with ESMTPS id 0DEB9619F5 for ; Tue, 13 Oct 2015 11:31:36 +0000 (UTC) Received: from BN3PR0301CA0002.namprd03.prod.outlook.com (10.160.180.140) by BN3PR0301MB1268.namprd03.prod.outlook.com (10.161.209.148) with Microsoft SMTP Server (TLS) id 15.1.293.16; Tue, 13 Oct 2015 11:31:34 +0000 Received: from BN1BFFO11FD030.protection.gbl (2a01:111:f400:7c10::1:114) by BN3PR0301CA0002.outlook.office365.com (2a01:111:e400:4000::12) with Microsoft SMTP Server (TLS) id 15.1.293.16 via Frontend Transport; Tue, 13 Oct 2015 11:31:34 +0000 Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD030.mail.protection.outlook.com (10.58.144.93) with Microsoft SMTP Server (TLS) id 15.1.293.9 via Frontend Transport; Tue, 13 Oct 2015 11:31:33 +0000 Received: from hongbo.ap.freescale.net (hongbo.ap.freescale.net [10.193.20.96]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id t9DBVOFk009638; Tue, 13 Oct 2015 04:31:31 -0700 From: To: Date: Tue, 13 Oct 2015 19:13:06 +0800 Message-ID: <1444734798-29063-3-git-send-email-hongbo.zhang@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1444734798-29063-1-git-send-email-hongbo.zhang@freescale.com> References: <1444734798-29063-1-git-send-email-hongbo.zhang@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD030; 1:sQ2tcC78EuKAIKyavoASn8KPIlzve08EXUmIsGcbUHO1NoXSoW5DL51+TAlVKFqimpaBH1Qc4h5Z8c8RjdAJseewXekdWnsixpemJDe8nPL9cVUWVGVHlEDuywqcDlSzdzPWYY4i6tzNCpfypFKqMVUYntql2PuLmZpdjk9ufbw3VneBNDGKIfKpsUd/EXtmQRA04G7ZTgsUS9KCU++xnzu5tj2yOgZ6S+Rt+BbFcDqscvVYFNFLQ9NCvAhTXmdXzN9MKAvq22W/VGrj15gOVkvOF4ysOugjD9RiCEhyek0F9VjAEWadZJ4eNoxolMljv3Wd3wfV8p3x5dMukDCodDKwHr2wQr/0tcqyTRX5g/Z9dH+w/80ArWHr6SOVFGU2JKAQHWIJeEwvt+6F9R/AWw== X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(5001960100002)(189998001)(2950100001)(11100500001)(36756003)(2351001)(19580395003)(105606002)(229853001)(64706001)(5003940100001)(92566002)(110136002)(19580405001)(76176999)(47776003)(86152002)(85426001)(50226001)(50986999)(86362001)(87936001)(48376002)(106466001)(77096005)(5007970100001)(81156007)(33646002)(97736004)(104016004)(50466002)(6806005)(5008740100001)(5001920100001)(46102003)(41533002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:BN3PR0301MB1268; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BN3PR0301MB1268; 2:G6CDh+PlmpFZ4tH9/9UQdOCUgqbcn15yNnoFeV9uilOFs+4OTvJlPDebJzzXqqE2iZlFQuEPJ0myCkkBfRSWzMQvqKNY8uVPptuYQz04qMpaYkZulmhIkXg1uceK4+JHAaBVErx3Xq2QP5s2slly9/QHffD//P7hGSJHBpxwivE=; 3:XgmK5BepzoxeHcAS1IHgUYibH90NqVb81X9bZyRqytfRGiPgNydH0JzeLeQtuxzaT0VYejjaMzlhX58rlzk3EByOaJwoei7Ac5Gs7u2UxnLRmVhN19uSALM2RGgPTM9LAvnLaZfj8Au8tRUgIToL9BnGLETBUsXPJ4kzi+IWHVntGa7x0LzhVCgxB/ua3GLYX8XQjt6jiZY+WE7Kkr9lzquPdV6XJ8F2vv14/VAzLZc=; 25:GGTw4GMrc6KCqpfgubnXAt0Vkz47ob8g+Xs03VdeZREogAKQ224i/AZmp8qChi6uhFe/WZujuyIK1FffTI/cWsR/i7bSeyWW8i3+Rk9IzqBtgf224qHr1KTA/2mKjLAGXtpgyspOZkREA1XpB558bFqbUI95K1nfuO+YYG1mjOLqZL6pGn8O7H9AEZ2ivmnZNIC0fd/sRcqyTqPVUnZMp8pGKMweGEO1E2X6NSWsqpti/h1468kyJvo6zmU5NY5U+CVs/YAfjO7np6mWW1X1Bg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0301MB1268; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0301MB1268; 20:g4D89t68MIMj8ZYGK+tB0qsytA5F71xWWmwqjVideSDiSDk/5Ts6GN6lHkthTJ8W9FFQf83ZU8kZY37EPOBeeH1Dcuui5Q3/UDjNJ8qkFlywrYZDH/6CE5mYcKiEwp0/7DxBoucfkjU5NEOBs2fKAR1SpDgzlvjVPB2xndimAGGNeGAw4vRinl3j8wKVUueJKksdA5Evz5PQvDaVTtTRmZDf1dOUJiCHyqLTaLs0KVV67oOvpggQXQnho4Iidc58hv81g+UUBe4XU/tyxFVL1TIpnmbOMacMcebl6J5vcZRILl3vVOr6W7WwfP0icxpsh/0VzPYYGtDbr9MAyX8iS8qx245pDgibf3x0FLGeWMQ=; 4:RG8j+snlZLOCGshKWgzHzDpPwMd2RDKW8S0wYo/u4ezgeh/cCyfsDlWrrK3vvATgF2sw5w553bI9Nmve0KX6gpx/PWvpgKQwzAuzxVIx7yuuYipIDK10lX0iKAPbSfvS768AH80pKmv0Sv3qQTrtsW/BBldq6jsdEmp39cEBmNpUq0BGSkTCzNl2jr0m03U3XzmprEqgO3CCteMQ57Z2r74pccZzLSOpLZKXjuvHvVP1zOlR7YT8On/n5uFqtmRJ1cxb5vC5M5TCsX9o0LnlKgXWQtsNr2gJlKtf8xlZupgJ7nyyyknggFqSrcKbI3ectf5Ef3vYtENMh7JpC9fHpycgNeEG+8yq1JySWlTO3PM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(3002001); SRVR:BN3PR0301MB1268; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0301MB1268; X-Forefront-PRVS: 07283408BE X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0301MB1268; 23:QWcmrnlVynin+0q7QFvQ0A9EuDVBIhp+s08U6YB?= =?us-ascii?Q?/YU+09QeLXsfdjw7EEHV9rVZFKvmjj+otKm4ZznLKCdWlqpW73fczYdhCxaA?= =?us-ascii?Q?d9gAeg3OxcsZkWZeY/xMaBc190bFKAcRF5dDtW4xunhru/1c6inyt+sqlkcW?= =?us-ascii?Q?RxZzy/v74Gfpl2FZIYOTOZjQG12wdLuh+C4bcxvrgrpz8U8o1pCzyhuOR0lW?= =?us-ascii?Q?rsbQLPhk4dE8bZoQ1SuPxkDFzB8rNFAaRFgGdWLq/1rpYBnkQl4cNKUvAYY/?= =?us-ascii?Q?9if+nNCZYVaGhexIJFzid/LnLxrHAlbzThTYngwSGaAFvmsFUyHSw7I1l6kf?= =?us-ascii?Q?chionkZ+XkXqowNdlFjwgJoUeVQkeohZC1XDWSuTL004HU7ztGCbCLewh5pr?= =?us-ascii?Q?04PFaq1u7JciS5LuprQaD9QA54XL4tcM/LTZn+RgYKebx2ezCC4GOPGqGE+F?= =?us-ascii?Q?kRIfswQqLhZBBVzzgD/91Bu4Z2HIuRNSwGNLzDqyNFPx4Z7vfboUmQqSznHS?= =?us-ascii?Q?XXO2IqyllZYx6hWbtCbLLcyVMBjX7C12BCGcWoXtS+DezIx9OLdJmVh9jJfq?= =?us-ascii?Q?I3rHJpYz4A638W13kS6sCr4jAQ0Jw4+mUBfgd6/tfZUD0/XZseN6eE/+cety?= =?us-ascii?Q?QEMXfMWomuzmll47pJODSXDC6bazUEUywisfxOofc7t3HpURHQMPSMS3QQw2?= =?us-ascii?Q?QpO7OONhXAaY6JbXTMJUQ5uG9/VkgMlYTa6P2TnPXSXfEryqSVmQQi86eK/R?= =?us-ascii?Q?QjSfzJEJW+plQbcmIIBJuJWj/iq/Vkzhf2HCDqcw6p1mZuj8vsVnX0WEINlv?= =?us-ascii?Q?KY5MmDk7FAlijpITCvmmxpkFlrI/J92NM+hbnBO+1minAUuiLk7un3X/rURg?= =?us-ascii?Q?5msW2lz+x2ftLzESj2nr33fgReGCABekMCu9w2B8wtL8I7VkgfiKdagUtFB5?= =?us-ascii?Q?Qpdxfpuem1LB/trYadGyey000aYVT0q6iGcb67LAQ4tA6u0VFrwc7AZxRwDB?= =?us-ascii?Q?XBnGUe3MWsO/fATxVklmow1uxb+25YVRm5JFQL9LZOJbZ/lg8uW0YexelfWo?= =?us-ascii?Q?Z4JVYBUNz64E6SkXKwI1Y27Tql7CKE7/nJd/8/8l9kXgY+NUAwPFD+PT3/7n?= =?us-ascii?Q?DmuVgjz2iBPASG7dW7+3LIhhY+S7K64dTInuz4YnySuAsd7qJ9i43Q8aCnBG?= =?us-ascii?Q?3gBp6h1VdSEc/cYs=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0301MB1268; 5:+a39EtsgOMdIIs2kOaLtSi9ESzC3hGVV7l+MnEM1IYpFzAx1N/VwGJzHS/qq9Kxd8DuAZtqUDEV+XhJr5ELmDZ8bj1Eb0hWsU9e6bM0Or55sL2NFEQZwMsr26sqQ5jYsoqcF8xycxJFYmtFutiAhkQ==; 24:PDLJ5yBeaWsSlQgkPaLhnCy5eZsIwRASwegqPl2rutLhsNCZF0ldoykoF3RaH85NawuXLuFna7hGvdPUPYNavBeCi0G0cKgrHU9ilsl1dRQ=; 20:usrG+M9wXVniUdCg3iCjuaKSLJXFUhw7PR8+fS6XRP4wryBBTa2dLGtx2NEur0FkhxcRgps2OfLKVqmzXSUfFQ== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2015 11:31:33.9271 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0301MB1268 X-Topics: patch Cc: petri.savolainen@nokia.com, stuart.haslam@arm.com Subject: [lng-odp] [API NEXT PATCH v7 02/14] linux-generic: sysinfo: make the cpu_hz per-CPU data X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Hongbo Zhang For AMP system such as ARM big.LITTLE, cores are heterogeneous, and cpu_hz for each core may be different too, so this patch changes the cpu_hz to data array cpu_hz[] to contain data for each different core, while for the common SMP system, we can simply use the cpu_hz[0] to contain data for all cores because they are all same, but if like, we can fill each item in the data array too. The new API to get cpu_hz for each core on AMP system will be added later. Signed-off-by: Hongbo Zhang --- platform/linux-generic/include/odp_internal.h | 2 +- platform/linux-generic/odp_system_info.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index eac642c..8a1a219 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -26,7 +26,7 @@ extern __thread int __odp_errno; #define MAX_CPU_NUMBER 128 typedef struct { - uint64_t cpu_hz; + uint64_t cpu_hz[MAX_CPU_NUMBER]; uint64_t huge_page_size; uint64_t page_size; int cache_line_size; diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c index cf6d5a7..83226f8 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -149,7 +149,7 @@ static int cpuinfo_x86(FILE *file, odp_system_info_t *sysinfo) } } - sysinfo->cpu_hz = (uint64_t) (mhz * 1000000.0); + sysinfo->cpu_hz[0] = (uint64_t)(mhz * 1000000.0); return 0; } @@ -199,7 +199,7 @@ static int cpuinfo_octeon(FILE *file, odp_system_info_t *sysinfo) } /* bogomips seems to be 2x freq */ - sysinfo->cpu_hz = (uint64_t) (mhz * 1000000.0 / 2.0); + sysinfo->cpu_hz[0] = (uint64_t)(mhz * 1000000.0 / 2.0); return 0; } @@ -237,7 +237,7 @@ static int cpuinfo_powerpc(FILE *file, odp_system_info_t *sysinfo) } } - sysinfo->cpu_hz = (uint64_t) (mhz * 1000000.0); + sysinfo->cpu_hz[0] = (uint64_t)(mhz * 1000000.0); } @@ -330,7 +330,7 @@ static int systemcpu(odp_system_info_t *sysinfo) sysinfo->huge_page_size = huge_page_size(); /* Dummy values */ - sysinfo->cpu_hz = 1400000000; + sysinfo->cpu_hz[0] = 1400000000; sysinfo->cache_line_size = 64; strncpy(sysinfo->model_str[0], "UNKNOWN", sizeof(sysinfo->model_str)); @@ -376,7 +376,7 @@ int odp_system_info_init(void) */ uint64_t odp_sys_cpu_hz(void) { - return odp_global_data.system_info.cpu_hz; + return odp_global_data.system_info.cpu_hz[0]; } uint64_t odp_sys_huge_page_size(void)