[v2,6/6] linux-gen: sched: optimize local variable layout

Message ID 1520002815-30682-7-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • [v2,1/6] linux-gen: sched: optimize packet input polling
Related show

Commit Message

Github ODP bot March 2, 2018, 3 p.m.
From: Petri Savolainen <petri.savolainen@linaro.org>


Pack local variables struct and bring commonly used
variables into the head of the struct.

Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>

---
/** 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(-)

Patch

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 */