From patchwork Tue Jan 17 16:28:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Trofimov X-Patchwork-Id: 91690 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp574037qgi; Tue, 17 Jan 2017 08:29:04 -0800 (PST) X-Received: by 10.237.41.36 with SMTP id s33mr33211503qtd.139.1484670544835; Tue, 17 Jan 2017 08:29:04 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id m86si16913064qkl.237.2017.01.17.08.29.04; Tue, 17 Jan 2017 08:29:04 -0800 (PST) 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; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 254E36095A; Tue, 17 Jan 2017 16:29:04 +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_H4, RCVD_IN_MSPIKE_WL, 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 F3ECF60653; Tue, 17 Jan 2017 16:28:58 +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 8A2D960954; Tue, 17 Jan 2017 16:28:53 +0000 (UTC) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0069.outbound.protection.outlook.com [104.47.0.69]) by lists.linaro.org (Postfix) with ESMTPS id 9658960513 for ; Tue, 17 Jan 2017 16:28:51 +0000 (UTC) Received: from e109786-lin.cambridge.arm.com (217.140.96.140) by AM5PR0801MB1746.eurprd08.prod.outlook.com (10.169.247.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Tue, 17 Jan 2017 16:28:49 +0000 From: Sergei Trofimov To: Date: Tue, 17 Jan 2017 16:28:36 +0000 Message-ID: <1484670521-28503-1-git-send-email-sergei.trofimov@arm.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: DB6PR0301CA0004.eurprd03.prod.outlook.com (10.168.49.14) To AM5PR0801MB1746.eurprd08.prod.outlook.com (10.169.247.12) X-MS-Office365-Filtering-Correlation-Id: d8f0aad9-f06a-42d8-0672-08d43ef5eb4b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:AM5PR0801MB1746; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1746; 3:KyTRGDxBKBuNqLMOXd1SDldqptYgKCWT6G40sWxs8sc1f4oDjSM8ySGrCnD+QXfmJxKV3LAAdx13s2uZUXo8CTf8VDffqm/vkJwAsTFfJJNAKgL91MyJUjN5gxXu2bhXJ1TJaEb+VUeHBk/Fs3VbxdTgYw/Y7VJrzFDP0vhNAyqJoO6lAnrauVv4v9cdycSoUkCHMwQkAM4VBlWAPqTJPz+wKzG/AbCQy+QYuN3T80rN11Bkakj37ZLs3Kk+cwNjvvVH+R1xshykoXjk+yqW7Q== X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1746; 25:24ImnWnxppaCug7l6NTkJx0PXOoQpgirDdk43l7JKCmsqwNoLmBQT/ilrmdIMOLT2MCXB40eleTOIXzcqFxOi3QFDVijaapAlScxMJ4nOP0U3oU4go5pOvpikncEDllDGOKnR3/NFUre3kN4nRGB/nEDJFk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yfv/7yaYOHUMo8GTMUzBB7hxcS4k5wFYEWNv45oWr7JYDv8= NoDisclaimer: True X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6041248)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(6072148); SRVR:AM5PR0801MB1746; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0801MB1746; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1746; 4:gOms/xuxX+NWa4pNjnALTs8lC0+1ldIECcyM72V9ckHVlXeBzqwb3QW90WQy7qj4or7dovmIV5dL1DfSsaLqkU85d6/qc6HM+yg17ZPnE3wFo8JmQTSiU+aFlrWJQRM23mfoapIcwt0svCrXR9FVxgXqe3VhbaSuyDO3QjXI5z2eZZ7RR2T77iPAY9cgpZM4ZpVf2LDWZjyyXiP+IgK4FS4c4eBUVS8vW6tYRRZP9Fi9ZWw7IqM8C8VewMAZ/AUrNkQuX0H+8cwRW/RLjrMZ/SjUd6Mn/Zv0+3+2Atx5tng6y9PH+nE+Ub7DePymstaNUqHJbEtqqDVKJ0s59h9EhtsN7Pr9J8baocGF+PeBvWOQqAc+/ukxcbV6/eMAJ9IbTqIXdyhSU/wZACzgCiJWiO5pWtVHylXaa2JlEGqbJHvCnfuAQpbUc8AQlHo1evdEIZar2vgBtROEwth3Nr7jwpo8iDEw19oJ/g2DrSCRF51EIwvZdR46yEPK/Leg2h2vevkRQCGOc/xEYnDCKOkSO6IRv7K7nLRgTgf4vp1XXwN5xNeZP6mfOYyTM4uR/XRFD++xOEO9F7sk9DARFfrqhg== X-Forefront-PRVS: 01901B3451 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(39840400002)(39410400002)(39860400002)(39850400002)(199003)(51234002)(189002)(6666003)(81166006)(8676002)(50226002)(81156014)(305945005)(450100001)(7736002)(38730400001)(6116002)(97736004)(92566002)(6916009)(47776003)(2906002)(3846002)(54906002)(33646002)(66066001)(48376002)(50466002)(50986999)(189998001)(4326007)(25786008)(36756003)(6486002)(110136003)(106356001)(105586002)(5660300001)(101416001)(68736007)(42186005)(2351001)(86362001)(5003940100001)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0801MB1746; H:e109786-lin.cambridge.arm.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0801MB1746; 23:ERKW8+NyRX5vbDpCGEMawzM0YG0r2b2kvROvzzJ?= 0dn3BCub5/lsHVA4b0oGuGSVB3eW92zwAodoR0nVZ6lkSI4puVbhk2VgA6zgHt8AoYBh50+RR8xG1GP87mZxCelt79isbcTqLZ2e7l/z699O3PnE6MhW3puoY5A3fPsxfzIdYXJDq/7beWhpCJR9O8WNG6AoqjXjh+RrEGF5TBLiyGm/bLWlDmgllgR8PEpeywcDj0lD2TDqZOJ/gU0xjmFvL/8yBtAAX21u4Uadk1f1AcKW5QPemGfiBUeAgjy1XuSy6UpoCxzNBc3RGw0ltTpjSI3nElZPiuPbKZlufCD3rpPmNPaRN1qb58pwmP9IKSNvsx+dBNQr57lbmjJbPUEO5Mj1eYti8dAdCKGiHsEaP/ARpiCdbUzkqYjS3Lg7GLTMHaj4wxW3RvDUqd2gf8Ly/Zec+vBzpg8nenHJDEjhP/mVi2dSBcL2rgSFQ12mZT6zEca16l4nAJ2CebcuxcQRnbFub9L7qjDStpNyQlcmrVrqVqVCsI6uxZbLkyQHWt07GTcqz2Yaw/jjePIcH5xcLnGsfjwEGQx58WKjrUAsW/5d7hf/ogkuG4zH7DvhZbOM2Lm8QUUgY6xMD2Z3oZLhAxl5WU3Rsy4SnhmVNYtdi5F/NW4PId43qSCzTRldbx9MbduIHdUt9TZCusfC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zJ+zPgdEGrNydo4tV7PlsgaJplatclZqqNiwdsTrtLa4YV4zIH8gbs3dG+y7kS/Wcc40AL4eCjpQKxB0l7d91v8XPX1MU1e+tPF9raA==; 24:fe5IwepIUbKWHeWIxWBsZ6QrzgtDSAHc7urhVNlE8C8QJA4bbdBfJSoyYGwvCvqlGR6kcUKLKJHt1nPrupSo9tRvUjfC4KaXL4fR+zQTIQw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1746; 7:rgSXTORZ6nreI4wPCIbyx/Xc8AxfXwA8vQj+oPneCFP9HB6PtKfopGHfEIkDIkQckc2a0lcxfspyvglAk3GbbAv1n96H5P+MwbPagWWNfeeSCbG9pKVaSj7cTD+k9qrpK+1kk7VMNvBLljGWEVc5MrgKjifNatThVMBWxfXASWgl5mtX2JOGRGTaeWMWbtPWfTEgahdxf0E5D+PuZSkNiVHE1JFtv63vN9sch5iw1g+fIn+c4bPjKFqGOgNLaPWNKdlsKypjkHfyV4IdA9X92G/HTExw6I60vC/65wn3i45Mq4R81OHnDUViCgwUBj/RdpQm2v0rLfs4SmQavlCB9FMVp7KWcl95BmgvWesADAge84iVbLEOKIzdOL0oyYSMu0bU6WExWllGv6VxvjT3XU3Mjn+zWVFPQ4xIEgqE0vecP19XZztggeTcWCkv3zpY11WyzIcJIhIYWs6Hb5OzZA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2017 16:28:49.9543 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1746 Cc: nd@arm.com Subject: [lng-odp] [API-NEXT PATCH 0/5] power management api X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" This patch series introduces a power management API and provides a sample power governor implementation. The API provides a way to query abstract performance levels supported by the platform, and to associate a power "governor" to manage power/performance levels on a set of CPUs. The sample governor implementation lowers frequencies of governed CPUs over time, raising them to max if monitored queues' depths exceed a set threshold. This behavior is analogous to the "ondemand" cpufreq governor in the Linux kernel. In order to enable the implementation of the sample governor, queue API is extended to support depth tracking and blocking dequeues. Sergei Trofimov (5): power: added API for managing CPU DVFS odp_queue: added support for queue depth tracking queue: adding a notification queue type queue: adding depth threshold trigger power: Adding a power governor implementation doc/users-guide/users-guide.adoc | 7 + include/odp/api/spec/power.h | 153 +++++++++++ include/odp/api/spec/queue.h | 71 ++++- include/odp_api.h | 1 + platform/Makefile.inc | 1 + platform/linux-generic/Makefile.am | 3 + platform/linux-generic/include/odp/api/power.h | 1 + .../linux-generic/include/odp_config_internal.h | 5 + platform/linux-generic/include/odp_internal.h | 4 + .../linux-generic/include/odp_packet_io_queue.h | 4 +- .../linux-generic/include/odp_queue_internal.h | 16 +- platform/linux-generic/odp_init.c | 12 + platform/linux-generic/odp_packet_io.c | 6 +- platform/linux-generic/odp_power.c | 294 +++++++++++++++++++++ platform/linux-generic/odp_power_governor.c | 220 +++++++++++++++ platform/linux-generic/odp_queue.c | 196 +++++++++++++- test/common_plat/validation/api/queue/queue.c | 2 + 17 files changed, 984 insertions(+), 12 deletions(-) create mode 100644 include/odp/api/spec/power.h create mode 100644 platform/linux-generic/include/odp/api/power.h create mode 100644 platform/linux-generic/odp_power.c create mode 100644 platform/linux-generic/odp_power_governor.c -- 1.9.1