Message ID | 1479975872-4945-2-git-send-email-christophe.milard@linaro.org |
---|---|
State | Superseded |
Headers | show |
On 11/24/16 11:24, Christophe Milard wrote: > There is no reason to toggle the _ODP_ISHM_SINGLE_VA flag > when the alignment exactely exactly > matches the page size. > This just results in wasting the odp-common virtual space > > Signed-off-by: Christophe Milard <christophe.milard@linaro.org> > --- > platform/linux-generic/_ishm.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/platform/linux-generic/_ishm.c b/platform/linux-generic/_ishm.c > index f4aa6d3..3371d94 100644 > --- a/platform/linux-generic/_ishm.c > +++ b/platform/linux-generic/_ishm.c > @@ -756,7 +756,7 @@ int _odp_ishm_reserve(const char *name, uint64_t size, int fd, > * the same address every where, otherwise alignment may be > * be wrong for some process */ > hp_align = align; > - if (hp_align < odp_sys_huge_page_size()) > + if (hp_align <= odp_sys_huge_page_size()) > hp_align = odp_sys_huge_page_size(); > else > flags |= _ODP_ISHM_SINGLE_VA; > @@ -777,7 +777,7 @@ int _odp_ishm_reserve(const char *name, uint64_t size, int fd, > * size then we have to make sure the block will be mapped at > * the same address every where, otherwise alignment may be > * be wrong for some process */ > - if (align < odp_sys_page_size()) > + if (align <= odp_sys_page_size()) > align = odp_sys_page_size(); > else > flags |= _ODP_ISHM_SINGLE_VA;
diff --git a/platform/linux-generic/_ishm.c b/platform/linux-generic/_ishm.c index f4aa6d3..3371d94 100644 --- a/platform/linux-generic/_ishm.c +++ b/platform/linux-generic/_ishm.c @@ -756,7 +756,7 @@ int _odp_ishm_reserve(const char *name, uint64_t size, int fd, * the same address every where, otherwise alignment may be * be wrong for some process */ hp_align = align; - if (hp_align < odp_sys_huge_page_size()) + if (hp_align <= odp_sys_huge_page_size()) hp_align = odp_sys_huge_page_size(); else flags |= _ODP_ISHM_SINGLE_VA; @@ -777,7 +777,7 @@ int _odp_ishm_reserve(const char *name, uint64_t size, int fd, * size then we have to make sure the block will be mapped at * the same address every where, otherwise alignment may be * be wrong for some process */ - if (align < odp_sys_page_size()) + if (align <= odp_sys_page_size()) align = odp_sys_page_size(); else flags |= _ODP_ISHM_SINGLE_VA;
There is no reason to toggle the _ODP_ISHM_SINGLE_VA flag when the alignment exactely matches the page size. This just results in wasting the odp-common virtual space Signed-off-by: Christophe Milard <christophe.milard@linaro.org> --- platform/linux-generic/_ishm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4