Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/41549/?format=api
http://patchwork.dpdk.org/api/patches/41549/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20180626092317.11031-10-david.hunt@intel.com/", "project": { "id": 1, "url": "http://patchwork.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20180626092317.11031-10-david.hunt@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20180626092317.11031-10-david.hunt@intel.com", "date": "2018-06-26T09:23:17", "name": "[v3,9/9] examples/vm_power: make branch ratio configurable", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "a7e1f078aecc68edad5dad6b5d2881514ec34f87", "submitter": { "id": 342, "url": "http://patchwork.dpdk.org/api/people/342/?format=api", "name": "Hunt, David", "email": "david.hunt@intel.com" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20180626092317.11031-10-david.hunt@intel.com/mbox/", "series": [ { "id": 235, "url": "http://patchwork.dpdk.org/api/series/235/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=235", "date": "2018-06-26T09:23:08", "name": "examples/vm_power: 100% Busy Polling", "version": 1, "mbox": "http://patchwork.dpdk.org/series/235/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/41549/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/41549/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C61C21B4FC;\n\tTue, 26 Jun 2018 11:23:56 +0200 (CEST)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id A99F81B4BE\n\tfor <dev@dpdk.org>; Tue, 26 Jun 2018 11:23:38 +0200 (CEST)", "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t26 Jun 2018 02:23:38 -0700", "from silpixa00399952.ir.intel.com (HELO\n\tsilpixa00399952.ger.corp.intel.com) ([10.237.223.64])\n\tby orsmga001.jf.intel.com with ESMTP; 26 Jun 2018 02:23:37 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.51,274,1526367600\"; d=\"scan'208\";a=\"67785398\"", "From": "David Hunt <david.hunt@intel.com>", "To": "dev@dpdk.org", "Cc": "david.hunt@intel.com", "Date": "Tue, 26 Jun 2018 10:23:17 +0100", "Message-Id": "<20180626092317.11031-10-david.hunt@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20180626092317.11031-1-david.hunt@intel.com>", "References": "<20180621132414.39047-2-david.hunt@intel.com>\n\t<20180626092317.11031-1-david.hunt@intel.com>", "Subject": "[dpdk-dev] [PATCH v3 9/9] examples/vm_power: make branch ratio\n\tconfigurable", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "For different workloads and poll loops, the theshold\nmay be different for when you want to scale up and down.\n\nThis patch allows changing of the default branch ratio\nby using the -b command line argument (or --branch-ratio=)\n\nSigned-off-by: David Hunt <david.hunt@intel.com>\nAcked-by: Radu Nicolau <radu.nicolau@intel.com>\n---\n examples/vm_power_manager/main.c | 16 +++++++++++++++-\n examples/vm_power_manager/oob_monitor_x86.c | 3 +--\n examples/vm_power_manager/power_manager.c | 1 +\n examples/vm_power_manager/power_manager.h | 3 +++\n 4 files changed, 20 insertions(+), 3 deletions(-)", "diff": "diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c\nindex 4088861f1..784d928bd 100644\n--- a/examples/vm_power_manager/main.c\n+++ b/examples/vm_power_manager/main.c\n@@ -143,17 +143,19 @@ parse_args(int argc, char **argv)\n \tint option_index;\n \tchar *prgname = argv[0];\n \tstruct core_info *ci;\n+\tfloat branch_ratio;\n \tstatic struct option lgopts[] = {\n \t\t{ \"mac-updating\", no_argument, 0, 1},\n \t\t{ \"no-mac-updating\", no_argument, 0, 0},\n \t\t{ \"core-list\", optional_argument, 0, 'l'},\n \t\t{ \"port-list\", optional_argument, 0, 'p'},\n+\t\t{ \"branch-ratio\", optional_argument, 0, 'b'},\n \t\t{NULL, 0, 0, 0}\n \t};\n \targvopt = argv;\n \tci = get_core_info();\n \n-\twhile ((opt = getopt_long(argc, argvopt, \"l:p:q:T:\",\n+\twhile ((opt = getopt_long(argc, argvopt, \"l:p:q:T:b:\",\n \t\t\t\t lgopts, &option_index)) != EOF) {\n \n \t\tswitch (opt) {\n@@ -186,6 +188,18 @@ parse_args(int argc, char **argv)\n \t\t\t}\n \t\t\tfree(oob_enable);\n \t\t\tbreak;\n+\t\tcase 'b':\n+\t\t\tbranch_ratio = 0.0;\n+\t\t\tif (strlen(optarg))\n+\t\t\t\tbranch_ratio = atof(optarg);\n+\t\t\tif (branch_ratio <= 0.0) {\n+\t\t\t\tprintf(\"invalid branch ratio specified\\n\");\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\tci->branch_ratio_threshold = branch_ratio;\n+\t\t\tprintf(\"***Setting branch ratio to %f\\n\",\n+\t\t\t\t\tbranch_ratio);\n+\t\t\tbreak;\n \t\t/* long options */\n \t\tcase 0:\n \t\t\tbreak;\ndiff --git a/examples/vm_power_manager/oob_monitor_x86.c b/examples/vm_power_manager/oob_monitor_x86.c\nindex 485ec5e3f..ea327b819 100644\n--- a/examples/vm_power_manager/oob_monitor_x86.c\n+++ b/examples/vm_power_manager/oob_monitor_x86.c\n@@ -45,7 +45,6 @@ void branch_monitor_exit(void)\n /* Number of microseconds between each poll */\n #define INTERVAL 100\n #define PRINT_LOOP_COUNT (1000000/INTERVAL)\n-#define RATIO_THRESHOLD 0.03\n #define IA32_PERFEVTSEL0 0x186\n #define IA32_PERFEVTSEL1 0x187\n #define IA32_PERFCTR0 0xc1\n@@ -112,7 +111,7 @@ apply_policy(int core)\n \n \tratio = (float)miss_diff * (float)100 / (float)hits_diff;\n \n-\tif (ratio < RATIO_THRESHOLD)\n+\tif (ratio < ci->branch_ratio_threshold)\n \t\tpower_manager_scale_core_min(core);\n \telse\n \t\tpower_manager_scale_core_max(core);\ndiff --git a/examples/vm_power_manager/power_manager.c b/examples/vm_power_manager/power_manager.c\nindex 4bdde23da..b7769c3c3 100644\n--- a/examples/vm_power_manager/power_manager.c\n+++ b/examples/vm_power_manager/power_manager.c\n@@ -74,6 +74,7 @@ core_info_init(void)\n \tci = get_core_info();\n \n \tci->core_count = get_nprocs_conf();\n+\tci->branch_ratio_threshold = BRANCH_RATIO_THRESHOLD;\n \tci->cd = malloc(ci->core_count * sizeof(struct core_details));\n \tif (!ci->cd) {\n \t\tRTE_LOG(ERR, POWER_MANAGER, \"Failed to allocate memory for core info.\");\ndiff --git a/examples/vm_power_manager/power_manager.h b/examples/vm_power_manager/power_manager.h\nindex 45385de37..605b3c8f6 100644\n--- a/examples/vm_power_manager/power_manager.h\n+++ b/examples/vm_power_manager/power_manager.h\n@@ -19,8 +19,11 @@ struct core_details {\n struct core_info {\n \tuint16_t core_count;\n \tstruct core_details *cd;\n+\tfloat branch_ratio_threshold;\n };\n \n+#define BRANCH_RATIO_THRESHOLD 0.1\n+\n struct core_info *\n get_core_info(void);\n \n", "prefixes": [ "v3", "9/9" ] }{ "id": 41549, "url": "