From patchwork Thu Jul 9 10:46:02 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: 50934 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 003DA228E5 for ; Thu, 9 Jul 2015 10:48:08 +0000 (UTC) Received: by wgwk7 with SMTP id k7sf22945107wgw.0 for ; Thu, 09 Jul 2015 03:48:08 -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: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=dOaJ9hMq8Z4IyyrsKJTlg1XK9up8jkQ58szFrYOYvbY=; b=QkCVrhIoRn09fpxKybOKWfchDzfgxvRHHdTQ7fcAJCWFvxI4xgeYSYlfVE869Z68NC 6DNEZcAbpqNbls6ZmgOvWA+s60Q/nyTeVtlfJgOzYFUiliI+pMFLUcWsD/rKGjA3z+j1 WrQ5OUPaZHc36eHj09Jaajiaowo9JHhK5q/scdiZ9WUFwDkXSFoipOiPyh7SJQ9KDMAT 4H25LN0oN3Xm3u1Yk8HeLz8T7X7kkyiWCJPW+11U24/Bt5QrWsONpVzsJegSgCVeCw89 pyvTi2gpo2FHWMVaJtuxCOHpeRJQCZqdmq9nY20MvIrc6rzP0i+F1Vl8aahn7hSjQlXy wTGQ== X-Gm-Message-State: ALoCoQnH1XIPZsJuQzdwcAMcu4dzNPgN6veejPI2jaK9xx8gjW251PwU9Yq7d6v5211LAhPjpQja X-Received: by 10.152.88.70 with SMTP id be6mr7583141lab.9.1436438888266; Thu, 09 Jul 2015 03:48:08 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.180.135 with SMTP id do7ls453001lac.109.gmail; Thu, 09 Jul 2015 03:48:08 -0700 (PDT) X-Received: by 10.112.93.100 with SMTP id ct4mr1813874lbb.66.1436438888138; Thu, 09 Jul 2015 03:48:08 -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 dc7si4130862lad.124.2015.07.09.03.48.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2015 03:48:07 -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 lbbpo10 with SMTP id po10so72624172lbb.3 for ; Thu, 09 Jul 2015 03:48:07 -0700 (PDT) X-Received: by 10.112.209.106 with SMTP id ml10mr13941974lbc.112.1436438887846; Thu, 09 Jul 2015 03:48:07 -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.108.230 with SMTP id hn6csp577011lbb; Thu, 9 Jul 2015 03:48:06 -0700 (PDT) X-Received: by 10.140.194.199 with SMTP id p190mr24592629qha.76.1436438886125; Thu, 09 Jul 2015 03:48:06 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id k136si6145644qhk.30.2015.07.09.03.48.05; Thu, 09 Jul 2015 03:48:06 -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 1207D61FBE; Thu, 9 Jul 2015 10:48:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal 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 ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id E342261F6F; Thu, 9 Jul 2015 10:46:57 +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 27E1A61FAC; Thu, 9 Jul 2015 10:46:52 +0000 (UTC) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bn0106.outbound.protection.outlook.com [157.56.110.106]) by lists.linaro.org (Postfix) with ESMTPS id 6B34961FB2 for ; Thu, 9 Jul 2015 10:46:18 +0000 (UTC) Received: from BLUPR0301CA0025.namprd03.prod.outlook.com (10.162.113.163) by BL2PR03MB604.namprd03.prod.outlook.com (10.255.109.38) with Microsoft SMTP Server (TLS) id 15.1.207.19; Thu, 9 Jul 2015 10:46:16 +0000 Received: from BN1AFFO11FD019.protection.gbl (2a01:111:f400:7c10::103) by BLUPR0301CA0025.outlook.office365.com (2a01:111:e400:5259::35) with Microsoft SMTP Server (TLS) id 15.1.213.14 via Frontend Transport; Thu, 9 Jul 2015 10:46:16 +0000 Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1AFFO11FD019.mail.protection.outlook.com (10.58.52.79) with Microsoft SMTP Server (TLS) id 15.1.201.10 via Frontend Transport; Thu, 9 Jul 2015 10:46:16 +0000 Received: from hongbo.ap.freescale.net (hongbo.ap.freescale.net [10.193.20.67]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t69AkBfd022771; Thu, 9 Jul 2015 03:46:14 -0700 From: To: Date: Thu, 9 Jul 2015 18:46:02 +0800 Message-ID: <1436438768-4258-3-git-send-email-hongbo.zhang@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1436438768-4258-1-git-send-email-hongbo.zhang@freescale.com> References: <1436438768-4258-1-git-send-email-hongbo.zhang@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD019; 1:igBOE+bLyTEsqrawpG5bqO0jOwnCyD0HetdjdOnnLhzJ9atJdqWZtQZL2Q63D4FWHK6zi/+QQ+stBgCSC+WPpoQiVPbHQzHG+mdb4vNn8Rr68+EdFXuBFu2Y4ssx5QFNAl6e+bBVn4jQ/AYPKzx9EFftBiQz7lyDxCzpLTLGdwoC0ejJGt3P3W+VT8yKjd2ZlN24aLVm2DVZu5HQ2uQ27/ptV4PLn6H/iEzR6C5tSqr2JhC52imcnXP1ubyoL4WpKGvYSDCoUGXVe7N7TTSA3ajRuGNSHhguw0XbEXzx55wKwiPm4KVracYaQpMMru/U X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(339900001)(189002)(199003)(77156002)(19580405001)(189998001)(85426001)(46102003)(19580395003)(86152002)(2950100001)(5001960100002)(77096005)(6806004)(86362001)(62966003)(110136002)(50986999)(105606002)(76176999)(47776003)(87936001)(50226001)(104016003)(229853001)(33646002)(5003940100001)(92566002)(50466002)(48376002)(5001920100001)(2351001)(106466001)(36756003)(41533002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:BL2PR03MB604; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB604; 2:Q6PAzqwNt5ilf4XHWeVuUjS26aTjnrh4BK6HmnCx7GWvc4ouw1pmF2fJXoY9FNK0; 3:5o+s57eAyOEPIHejPgWIVlofxvFXGkNNxhKSU+yFCUHOougIy87tQtsUyHmdA6jYdnlZodWgK7tfydAI1hGy/C+1sUcKcSvu8la4NnUS0VtYmBYTyjifJq4S4VVgN/BbS+hQWfLmnRAJ6qUvi2pJBQtQ8WxLTPs29eZk5yCYruOfogMgQif0t9gCwJlyPDSmO0F2tlEMaf/nz62NGkmJKwawSFBX8c5Rw4BDfNDsUgE=; 25:0hshM9LJ/cueGJClU9Ged4PHAPmklsAZ0owiJ7E9lPeNhugMrXdDZwu60qHZ4uWpn+xfQhTq/jrZvH7a2xMvSrkSxKxlvRUh2Yv6L16rxdMrJ6MlxZXUDwdtFm5gbxDn8cSZoBwT/yyddgJx9rP7/WAS9HnuA/I0rf2CRDxcqv+QAUXQuoFpkrbheOs1+J2S3jczYhuW9z5zfswZelDbP1N/nFdZwCYv+3MpY9Wy9e8OX3Zbw6v9wsXG/vyjKZEL6d9IeZEaKet63GgTA5JfjI7Wjq8J3CP+rfSJzCHswEI=; 20:SAY4mA7CHH4RjUCqUaVEXKGI+POZJ3VaD6XD37lzeOlJoccVncLJPoum29Fg+uQ+PbK0SXaQMOP2qA/bDoVHrSU7J38uEzHFEqe+qG9enHubmYoJDsjvDHzKoHaaFR0Fy6AYa6IR2wpmYsT7s30DpNVw7M+5EgjFd+a+RrlbndtRKmqPNlWk1q7K42/G1Bz68YM57OIxMs1iatLWlNrTqFoLet+OchB7NItsnFSEKfKY9PNJPX8/eRgeR6BSnLHaDLPlXFGnr8lxNwee2+ZhSXMVmb8gXO/uawL/RS9ZQv8Ko3CWFKcOx7ZtxRr8lWRjmJdqFn0glEbbyN5FSf7PQyatndK3t2QW+7M/+AhenGc= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB604; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BL2PR03MB604; BCL:0; PCL:0; RULEID:; SRVR:BL2PR03MB604; X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB604; 4:i0Mbi2wv8v/aHbN18JkfGRqwlbyaudlqcr4s+uK1QbVtyh9nDGelclzkv135cTWrQkPi7ENe3VqI1br8n1y5FMlX7klCUmRn8pdurdBkgW9yAR5iFOuwgy6lLwkWRszKhr/4WA84nNJ9tSCL2+q6aH21Yo+Lk2qlt8/vhckW09d5syQRqa0EqlEUTytti7ZwypccmreUindZ1XizldAnDnfRm7VAKV3YX9upNz3X/tnn/IIBArKn+3B3girxOOFYUwxNg5Uy5uxDbX0FW9FVaEs3Bm39q3Yt4BheQPXCRQg= X-Forefront-PRVS: 0632519F33 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2PR03MB604; 23:xlWiuP9phiM33nFeX3E7ob045gU/ABbg9gxc2lf6Mr?= =?us-ascii?Q?HPerDA0lAMUesDtjKVV3Ka0TW8LmX8js8r/7X6RFFbMEsUPhY5w2H8vJm6tJ?= =?us-ascii?Q?JmjUoTc2VYrZrEztbXy9z3IrKPimFB1pciluCznelKOouKGgzVrxH4ny7CaK?= =?us-ascii?Q?Q4fEqK+SGDis+gx7imGU7cdA7Rv/d5Haag4vnkblTUfVaUQnAmh8MqBmq2lv?= =?us-ascii?Q?OuYnJ7rAFsoaxQfon22JBOyYUPOKkx6oct/PRqKSKlCLhCSdhTf8x8Puni3h?= =?us-ascii?Q?ct3Kj1XdPFHpMMV+4ip2BMd86ZuHpYqOlVtINWb/FhdrACzPh+AJfBYlVAaq?= =?us-ascii?Q?pW4SptGXmw/FIEnr8GcKIIiog6z7lXkBnmJDYKdQczNuO0LpIF1qRM0FCpDV?= =?us-ascii?Q?Q4/Te9yf+B7VmCO2oX6nxNXDGWYLGsq6KuQsRfbLZLkARbZmYTQ9BM7fTqYo?= =?us-ascii?Q?3yD9mecQq5p6gMQ2hWAMgHkmn81Gj1Ci5269pZkL890LeAH1+sdfBYotX+A1?= =?us-ascii?Q?4RmB1Ld4B7tI7knxLFNgdbMzRM0Qur/MYRovcgP1Z2fp6RWJbU8qCun0FFGS?= =?us-ascii?Q?dLsN0F4jNOi7wn1yswKe9Le0+kdbCX2UpONv60zTiJCznNAedg9NUczoSMgH?= =?us-ascii?Q?nZbnsqxYnDzYcen/nrMAangeyAFyJIVwCuNK6DpHGdCjiSCnfTbnTMrzSbqL?= =?us-ascii?Q?L8Mo3eKirYw+fScFgI5hVjbPjPGvSS3J9A4VfwGoB3mUzTjj/9R60qdEuuCk?= =?us-ascii?Q?oeyNY7FRLqePEo9LZzzU5Zk/25O963hqaHihHCAp8FW+mPblc0nqfpD8BJEn?= =?us-ascii?Q?rg8FRS0hY8zlnYzojo9BEq/msYu+HtxgKMKWsHbasIX7YolrL5sDb14IDOyo?= =?us-ascii?Q?8dhsKxVqhHMVdlgWK8xr6L97QvOa5+SB6+TaiCO51JJbnJ4E5GuOner/DfMz?= =?us-ascii?Q?BlcKmucSm9POO81TKUMveatIPID8wwaqXidus2UQz+OmMI8nXjNYG4Cfh3kH?= =?us-ascii?Q?f31Jt6u1g0vhdZK0m7As1v?= X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB604; 5:V69fCilE7fDc0Sob6aQ1/VbNzfWJIWPXh8ZcAfUTFQS7yaSDdMz/B3N20pHOVD5uE990j/9Kq9y0HlWwOGhDAedVe6KxFskSusXgFgWQFa4hYnKPbm3lbKaFt7cEmU33vKAkTMjXmC6QtVOFzhxGxA==; 24:6BSlx+4ZFGDiRWMY9u2HuvE/WkkZdNwan4xb3AykqChj0ZoKeBjlYoJIHh+60ssMMWnhM3kl4ko4EBqXuRt6ibnYRl+kNYkLNy6Z8ozk5iY=; 20:Z35AAMNRZE7d72URlI7WQPoiHStcA0+VnAM5TfI9jWNCSgLmYQgtZkfB0Lk8CnkclCXiE3oRjTpFtgLnWwswMw== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2015 10:46:16.2380 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR03MB604 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH v3 2/8] 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.mail=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 bcf7e63..8df8c23 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -25,7 +25,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 3add081..ab741eb 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -148,7 +148,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; } @@ -198,7 +198,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; } @@ -236,7 +236,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); } @@ -329,7 +329,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)); @@ -375,7 +375,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)