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 0ce0f29c5cc10320eb7f0741788f551cdf2c6903 (commit) via 1ec853bed11476eac8b8bde9f3f1d1e480049816 (commit) via 635d7206969ac9167383c6e8e27fa45ec4d3f137 (commit) from 901de0794779a6f419f5229de045bf610ec2adc2 (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 0ce0f29c5cc10320eb7f0741788f551cdf2c6903 Author: Petri Savolainen petri.savolainen@linaro.org Date: Fri Nov 9 15:05:56 2018 +0200
linux-gen: cls: simplify shm usage
Combine three shm reservations into one reservation. This simplifies shm usage and results less ODP internally allocated SHM blocks. Also one combined block is more memory efficient than multiple (saves memory and page mappings).
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_classification.c b/platform/linux-generic/odp_classification.c index 0d3545b6..c7007fb7 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -35,6 +35,16 @@ static cos_tbl_t *cos_tbl; static pmr_tbl_t *pmr_tbl; static _cls_queue_grp_tbl_t *queue_grp_tbl;
+typedef struct cls_global_t { + cos_tbl_t cos_tbl; + pmr_tbl_t pmr_tbl; + _cls_queue_grp_tbl_t queue_grp_tbl; + odp_shm_t shm; + +} cls_global_t; + +static cls_global_t *cls_global; + static const rss_key default_rss = { .u8 = { 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2, @@ -79,102 +89,45 @@ pmr_t *get_pmr_entry_internal(odp_pmr_t pmr)
int odp_classification_init_global(void) { - odp_shm_t cos_shm; - odp_shm_t pmr_shm; - odp_shm_t queue_grp_shm; + odp_shm_t shm; int i;
- cos_shm = odp_shm_reserve("_odp_shm_odp_cos_tbl", - sizeof(cos_tbl_t), - sizeof(cos_t), - 0); + shm = odp_shm_reserve("_odp_cls_global", sizeof(cls_global_t), + ODP_CACHE_LINE_SIZE, 0); + if (shm == ODP_SHM_INVALID) + return -1;
- if (cos_shm == ODP_SHM_INVALID) { - ODP_ERR("shm allocation failed for shm_odp_cos_tbl"); - goto error; - } + cls_global = odp_shm_addr(shm); + memset(cls_global, 0, sizeof(cls_global_t));
- cos_tbl = odp_shm_addr(cos_shm); - if (cos_tbl == NULL) - goto error_cos; + cls_global->shm = shm; + cos_tbl = &cls_global->cos_tbl; + pmr_tbl = &cls_global->pmr_tbl; + queue_grp_tbl = &cls_global->queue_grp_tbl;
- memset(cos_tbl, 0, sizeof(cos_tbl_t)); for (i = 0; i < CLS_COS_MAX_ENTRY; i++) { /* init locks */ cos_t *cos = get_cos_entry_internal(_odp_cos_from_ndx(i)); LOCK_INIT(&cos->s.lock); }
- pmr_shm = odp_shm_reserve("_odp_shm_odp_pmr_tbl", - sizeof(pmr_tbl_t), - sizeof(pmr_t), - 0); - - if (pmr_shm == ODP_SHM_INVALID) { - ODP_ERR("shm allocation failed for shm_odp_pmr_tbl"); - goto error_cos; - } - - pmr_tbl = odp_shm_addr(pmr_shm); - if (pmr_tbl == NULL) - goto error_pmr; - - memset(pmr_tbl, 0, sizeof(pmr_tbl_t)); for (i = 0; i < CLS_PMR_MAX_ENTRY; i++) { /* init locks */ pmr_t *pmr = get_pmr_entry_internal(_odp_pmr_from_ndx(i)); LOCK_INIT(&pmr->s.lock); }
- queue_grp_shm = odp_shm_reserve("_odp_shm_cls_queue_grp_tbl", - sizeof(_cls_queue_grp_tbl_t), - sizeof(queue_entry_t *), - 0); - - if (queue_grp_shm == ODP_SHM_INVALID) { - ODP_ERR("shm allocation failed for queue_grp_tbl"); - goto error_queue_grp; - } - - queue_grp_tbl = odp_shm_addr(queue_grp_shm); - memset(queue_grp_tbl, 0, sizeof(_cls_queue_grp_tbl_t)); - return 0; - -error_queue_grp: - odp_shm_free(queue_grp_shm); -error_pmr: - odp_shm_free(pmr_shm); -error_cos: - odp_shm_free(cos_shm); -error: - return -1; }
int odp_classification_term_global(void) { - int ret = 0; - int rc = 0; - - ret = odp_shm_free(odp_shm_lookup("_odp_shm_odp_cos_tbl")); - if (ret < 0) { - ODP_ERR("shm free failed for shm_odp_cos_tbl"); - rc = -1; - } - - ret = odp_shm_free(odp_shm_lookup("_odp_shm_odp_pmr_tbl")); - if (ret < 0) { - ODP_ERR("shm free failed for shm_odp_pmr_tbl"); - rc = -1; - } - - ret = odp_shm_free(odp_shm_lookup("_odp_shm_cls_queue_grp_tbl")); - if (ret < 0) { - ODP_ERR("shm free failed for shm_odp_cls_queue_grp_tbl"); - rc = -1; + if (cls_global && odp_shm_free(cls_global->shm)) { + ODP_ERR("shm free failed"); + return -1; }
- return rc; + return 0; }
void odp_cls_cos_param_init(odp_cls_cos_param_t *param)
commit 1ec853bed11476eac8b8bde9f3f1d1e480049816 Author: Petri Savolainen petri.savolainen@linaro.org Date: Fri Nov 9 14:35:53 2018 +0200
linux-gen: shm: modify shm print header string
Highlight that printed values are from ODP SHM only, i.e. it's not generic memory allocation status of the entire system.
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_shared_memory.c b/platform/linux-generic/odp_shared_memory.c index d2f31458..4e92c9f2 100644 --- a/platform/linux-generic/odp_shared_memory.c +++ b/platform/linux-generic/odp_shared_memory.c @@ -122,7 +122,7 @@ int odp_shm_info(odp_shm_t shm, odp_shm_info_t *info)
void odp_shm_print_all(void) { - _odp_ishm_status("Memory allocation status:"); + _odp_ishm_status("ODP shared memory allocation status:"); }
void odp_shm_print(odp_shm_t shm)
commit 635d7206969ac9167383c6e8e27fa45ec4d3f137 Author: Petri Savolainen petri.savolainen@linaro.org Date: Fri Nov 9 14:31:14 2018 +0200
example: sysinfo: print shm blocks
It's useful to see how many shm blocks and which kind of memory (huge or normal pages, etc) ODP implementation itself allocates.
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/example/sysinfo/odp_sysinfo.c b/example/sysinfo/odp_sysinfo.c index 120910b6..ff79d893 100644 --- a/example/sysinfo/odp_sysinfo.c +++ b/example/sysinfo/odp_sysinfo.c @@ -430,6 +430,10 @@ int main(void) print_auth_algos(crypto_capa.auths); printf("\n"); print_auth_caps(crypto_capa.auths); + printf("\n"); + + printf(" SHM MEMORY BLOCKS:\n"); + odp_shm_print_all();
printf("\n"); printf("***********************************************************\n");
-----------------------------------------------------------------------
Summary of changes: example/sysinfo/odp_sysinfo.c | 4 ++ platform/linux-generic/odp_classification.c | 97 ++++++++--------------------- platform/linux-generic/odp_shared_memory.c | 2 +- 3 files changed, 30 insertions(+), 73 deletions(-)
hooks/post-receive