This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, master has been updated via 45cd0923809b2b4b972c9e9843ca7323183380c7 (commit) via 8de012860878e3cb70aab7b6151223b201a8d9a1 (commit) via 52d54fae53f5e65f232cb21b116e51ea36b4eb0b (commit) from eab91f7101cdf47c59b14b5a511a82c701e66ff4 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 45cd0923809b2b4b972c9e9843ca7323183380c7 Author: Petri Savolainen petri.savolainen@linaro.org Date: Wed Oct 24 15:54:53 2018 +0300
linux-gen: sched: increase max spread weight
Increase max spread weight. The default value is kept the same.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/odp_schedule_basic.c b/platform/linux-generic/odp_schedule_basic.c index 456704a08..7208200aa 100644 --- a/platform/linux-generic/odp_schedule_basic.c +++ b/platform/linux-generic/odp_schedule_basic.c @@ -58,7 +58,7 @@ ODP_STATIC_ASSERT((ODP_SCHED_PRIO_NORMAL > 0) &&
/* A thread polls a non preferred sched queue every this many polls * of the prefer queue. */ -#define MAX_PREFER_WEIGHT 63 +#define MAX_PREFER_WEIGHT 127 #define MIN_PREFER_WEIGHT 1 #define MAX_PREFER_RATIO (MAX_PREFER_WEIGHT + 1)
commit 8de012860878e3cb70aab7b6151223b201a8d9a1 Author: Petri Savolainen petri.savolainen@linaro.org Date: Wed Oct 24 15:45:38 2018 +0300
linux-gen: sched: use spread weight from config file
Use the new config file option instead of fixed prefer ratio.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/odp_schedule_basic.c b/platform/linux-generic/odp_schedule_basic.c index 214d42c8b..456704a08 100644 --- a/platform/linux-generic/odp_schedule_basic.c +++ b/platform/linux-generic/odp_schedule_basic.c @@ -333,7 +333,7 @@ static inline uint8_t prio_spread_index(uint32_t index) static void sched_local_init(void) { int i; - uint8_t spread; + uint8_t spread, prefer_ratio; uint8_t num_spread = sched->config.num_spread; uint8_t offset = 1;
@@ -344,11 +344,12 @@ static void sched_local_init(void) sched_local.stash.queue = ODP_QUEUE_INVALID;
spread = prio_spread_index(sched_local.thr); + prefer_ratio = sched->config.prefer_ratio;
for (i = 0; i < SPREAD_TBL_SIZE; i++) { sched_local.spread_tbl[i] = spread;
- if (num_spread > 1 && (i % MAX_PREFER_RATIO) == 0) { + if (num_spread > 1 && (i % prefer_ratio) == 0) { sched_local.spread_tbl[i] = prio_spread_index(spread + offset); offset++; @@ -362,6 +363,7 @@ static int schedule_init_global(void) { odp_shm_t shm; int i, j, grp; + int prefer_ratio;
ODP_DBG("Schedule init ... ");
@@ -382,8 +384,10 @@ static int schedule_init_global(void) return -1; }
+ prefer_ratio = sched->config.prefer_ratio; + /* When num_spread == 1, only spread_tbl[0] is used. */ - sched->max_spread = (sched->config.num_spread - 1) * MAX_PREFER_RATIO; + sched->max_spread = (sched->config.num_spread - 1) * prefer_ratio; sched->shm = shm; odp_spinlock_init(&sched->mask_lock);
commit 52d54fae53f5e65f232cb21b116e51ea36b4eb0b Author: Petri Savolainen petri.savolainen@linaro.org Date: Wed Oct 24 15:20:21 2018 +0300
linux-gen: sched: add spread weight config file option
Add new config file option to control scheduler internal queue preference ratio.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/config/odp-linux-generic.conf b/config/odp-linux-generic.conf index af651d7f6..2417d23f2 100644 --- a/config/odp-linux-generic.conf +++ b/config/odp-linux-generic.conf @@ -16,7 +16,7 @@
# Mandatory fields odp_implementation = "linux-generic" -config_file_version = "0.1.1" +config_file_version = "0.1.2"
# Shared memory options shm: { @@ -80,13 +80,27 @@ queue_basic: { }
sched_basic: { - # Priority level spread. Each priority level is spread into multiple - # scheduler internal queues. A higher spread value typically improves - # parallelism and thus is better for high thread counts, but causes - # uneven service level for low thread counts. Typically, optimal - # value is the number of threads using the scheduler. + # Priority level spread + # + # Each priority level is spread into multiple scheduler internal queues. + # This value defines the number of those queues. Minimum value is 1. + # Each thread prefers one of the queues over other queues. A higher + # spread value typically improves parallelism and thus is better for + # high thread counts, but causes uneven service level for low thread + # counts. Typically, optimal value is the number of threads using + # the scheduler. prio_spread = 4
+ # Weight of the preferred scheduler internal queue + # + # Each thread prefers one of the internal queues over other queues. + # This value controls how many times the preferred queue is polled + # between a poll to another internal queue. Minimum value is 1. A higher + # value typically improves parallelism as threads work mostly on their + # preferred queues, but causes uneven service level for low thread + # counts as non-preferred queues are served less often + prio_spread_weight = 63 + # Burst size configuration per priority. The first array element # represents the highest queue priority. The scheduler tries to get # burst_size_default[prio] events from a queue and stashes those that diff --git a/platform/linux-generic/odp_schedule_basic.c b/platform/linux-generic/odp_schedule_basic.c index 58396293b..214d42c8b 100644 --- a/platform/linux-generic/odp_schedule_basic.c +++ b/platform/linux-generic/odp_schedule_basic.c @@ -58,10 +58,12 @@ ODP_STATIC_ASSERT((ODP_SCHED_PRIO_NORMAL > 0) &&
/* A thread polls a non preferred sched queue every this many polls * of the prefer queue. */ -#define PREFER_RATIO 64 +#define MAX_PREFER_WEIGHT 63 +#define MIN_PREFER_WEIGHT 1 +#define MAX_PREFER_RATIO (MAX_PREFER_WEIGHT + 1)
/* Spread weight table */ -#define SPREAD_TBL_SIZE ((MAX_SPREAD - 1) * PREFER_RATIO) +#define SPREAD_TBL_SIZE ((MAX_SPREAD - 1) * MAX_PREFER_RATIO)
/* Maximum number of packet IO interfaces */ #define NUM_PKTIO ODP_CONFIG_PKTIO_ENTRIES @@ -182,6 +184,7 @@ typedef struct { uint8_t burst_default[NUM_PRIO]; uint8_t burst_max[NUM_PRIO]; uint8_t num_spread; + uint8_t prefer_ratio; } config;
uint16_t max_spread; @@ -256,13 +259,29 @@ static int read_config_file(sched_global_t *sched) }
if (val > MAX_SPREAD || val < MIN_SPREAD) { - ODP_ERR("Bad value %s = %u\n", str, val); + ODP_ERR("Bad value %s = %u [min: %u, max: %u]\n", str, val, + MIN_SPREAD, MAX_SPREAD); return -1; }
sched->config.num_spread = val; ODP_PRINT(" %s: %i\n", str, val);
+ str = "sched_basic.prio_spread_weight"; + if (!_odp_libconfig_lookup_int(str, &val)) { + ODP_ERR("Config option '%s' not found.\n", str); + return -1; + } + + if (val > MAX_PREFER_WEIGHT || val < MIN_PREFER_WEIGHT) { + ODP_ERR("Bad value %s = %u [min: %u, max: %u]\n", str, val, + MIN_PREFER_WEIGHT, MAX_PREFER_WEIGHT); + return -1; + } + + sched->config.prefer_ratio = val + 1; + ODP_PRINT(" %s: %i\n", str, val); + str = "sched_basic.burst_size_default"; if (_odp_libconfig_lookup_array(str, burst_val, NUM_PRIO) != NUM_PRIO) { @@ -329,7 +348,7 @@ static void sched_local_init(void) for (i = 0; i < SPREAD_TBL_SIZE; i++) { sched_local.spread_tbl[i] = spread;
- if (num_spread > 1 && (i % PREFER_RATIO) == 0) { + if (num_spread > 1 && (i % MAX_PREFER_RATIO) == 0) { sched_local.spread_tbl[i] = prio_spread_index(spread + offset); offset++; @@ -364,7 +383,7 @@ static int schedule_init_global(void) }
/* When num_spread == 1, only spread_tbl[0] is used. */ - sched->max_spread = (sched->config.num_spread - 1) * PREFER_RATIO; + sched->max_spread = (sched->config.num_spread - 1) * MAX_PREFER_RATIO; sched->shm = shm; odp_spinlock_init(&sched->mask_lock);
diff --git a/platform/linux-generic/test/process-mode.conf b/platform/linux-generic/test/process-mode.conf index d80df25c4..7a06544ab 100644 --- a/platform/linux-generic/test/process-mode.conf +++ b/platform/linux-generic/test/process-mode.conf @@ -1,6 +1,6 @@ # Mandatory fields odp_implementation = "linux-generic" -config_file_version = "0.1.1" +config_file_version = "0.1.2"
# Shared memory options shm: {
-----------------------------------------------------------------------
Summary of changes: config/odp-linux-generic.conf | 26 +++++++++++++++----- platform/linux-generic/odp_schedule_basic.c | 35 ++++++++++++++++++++++----- platform/linux-generic/test/process-mode.conf | 2 +- 3 files changed, 50 insertions(+), 13 deletions(-)
hooks/post-receive