From patchwork Fri Mar 2 15:00:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 130556 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1381591lja; Fri, 2 Mar 2018 07:14:00 -0800 (PST) X-Google-Smtp-Source: AG47ELtg16iB2ibEuCROkmDyeH1okdy/5iXhOPglgDXbpvxuLxgkA+is7d+R1r3SZ023FC33ksfF X-Received: by 10.237.47.69 with SMTP id l63mr9022506qtd.68.1520003640413; Fri, 02 Mar 2018 07:14:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520003640; cv=none; d=google.com; s=arc-20160816; b=MtV9/yTe23x7qy0zXtBJi2AMLPOKb9cWQa6NcgS8qeumtrfqLi1nWJ7EsDQlsfkkpT PQEdYiOuWf3Y5pHCCHQGVfE5EgGJda9+gG3ffVqwgCh4ku1kbXKf7iNJ+vaGwKDRVPiw 4mQaI+d4s0m7YCBC9jSoLkWXpUf9hFTI1dC3eCqGroqG3HSmHNxAEHIjklgyb3gax0Vv 5w8iUsM/hFmR/GethjIIi/6WcSZLDcB1xqqeokxF00/gEzTZaKfGn8u1/1zz+UuYS7XT WZZk5NDVC5yg8YbOeB2CClLZgsLcS4HuMYsOwEoJhpmu3ywGmEnlpgL6hBdleIPdAbgq +wJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=zotSvdeDIAkK/lrAOQd8uTTuQ6ivuiCO92gLA365R60=; b=JsE09ro5UkIAgOLNXme+lvJ2fSAhTdnFksMUJQN6yYU3GBmixoWKhgYVboWufJis7u t0V/izVp8uL+mWtMuzU4tv0nbhyDl/RQ3My+Ro3+gC2VpAzJV5tQNqXcTBG6MCKn25JI h+M8VQmtu2kgndpy6nn3yuU5YGvajBL03+8ISHEQXmEQQAWnJ32XuM8f8CWkwjgBuNz1 9geKZqFd5u+D4F4ZXShiQ1SwcV6EhC6AuJVEGpoQfBjmN9lGTsY2daa6xWzMMKnLufsv oOaKwubVF9rOdd6VLAEdlQWiNF5Ci9zzbUl0mZdbvzUopMJHbN4DqXe9YIBBTeprJGOW fT1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id h126si6541526qkf.282.2018.03.02.07.14.00; Fri, 02 Mar 2018 07:14:00 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 0AA0C627AD; Fri, 2 Mar 2018 15:14:00 +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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL 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 9F3D0617B1; Fri, 2 Mar 2018 15:01:37 +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 03F6B607E0; Fri, 2 Mar 2018 15:00:35 +0000 (UTC) Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [77.88.28.109]) by lists.linaro.org (Postfix) with ESMTPS id 0AD146177D for ; Fri, 2 Mar 2018 15:00:24 +0000 (UTC) Received: from mxback3o.mail.yandex.net (mxback3o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1d]) by forward106p.mail.yandex.net (Yandex) with ESMTP id E1C3C2D82EB0 for ; Fri, 2 Mar 2018 18:00:21 +0300 (MSK) Received: from smtp2j.mail.yandex.net (smtp2j.mail.yandex.net [2a02:6b8:0:801::ac]) by mxback3o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 3j7gwLfIjP-0Lw8ef0m; Fri, 02 Mar 2018 18:00:21 +0300 Received: by smtp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ChbgkO0UiZ-0L2mhvoS; Fri, 02 Mar 2018 18:00:21 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Fri, 2 Mar 2018 18:00:15 +0300 Message-Id: <1520002815-30682-7-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520002815-30682-1-git-send-email-odpbot@yandex.ru> References: <1520002815-30682-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 504 Subject: [lng-odp] [PATCH v2 6/6] linux-gen: sched: optimize local variable layout 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" From: Petri Savolainen Pack local variables struct and bring commonly used variables into the head of the struct. Signed-off-by: Petri Savolainen --- /** Email created from pull request 504 (psavol:master-sched-optim-2) ** https://github.com/Linaro/odp/pull/504 ** Patch: https://github.com/Linaro/odp/pull/504.patch ** Base sha: e1c0e4570a45d05dd9f2e8e052ce71164209d112 ** Merge commit sha: 964132736e0785222be184065d6ac73121cd46ac **/ platform/linux-generic/odp_schedule_basic.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/platform/linux-generic/odp_schedule_basic.c b/platform/linux-generic/odp_schedule_basic.c index b3c913bb6..cd20b39dd 100644 --- a/platform/linux-generic/odp_schedule_basic.c +++ b/platform/linux-generic/odp_schedule_basic.c @@ -114,14 +114,20 @@ ODP_STATIC_ASSERT(sizeof(lock_called_t) == sizeof(uint32_t), /* Scheduler local data */ typedef struct { int thr; - int stash_num; - int stash_index; - int pause; + uint16_t stash_num; + uint16_t stash_index; + uint16_t pause; uint16_t round; uint32_t stash_qi; odp_queue_t stash_queue; odp_event_t stash_ev[MAX_DEQ]; + uint32_t grp_epoch; + int num_grp; + uint8_t grp[NUM_SCHED_GRPS]; + uint8_t weight_tbl[WEIGHT_TBL_SIZE]; + uint8_t grp_weight[WEIGHT_TBL_SIZE]; + struct { /* Source queue index */ uint32_t src_queue; @@ -133,12 +139,6 @@ typedef struct { ordered_stash_t stash[MAX_ORDERED_STASH]; } ordered; - uint32_t grp_epoch; - int num_grp; - uint8_t grp[NUM_SCHED_GRPS]; - uint8_t weight_tbl[WEIGHT_TBL_SIZE]; - uint8_t grp_weight[WEIGHT_TBL_SIZE]; - } sched_local_t; /* Priority queue */