Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hugepage detection is fragile and breaks when kernel doesn't support Hugepages #93

Open
scosol opened this issue Oct 3, 2018 · 1 comment

Comments

@scosol
Copy link

scosol commented Oct 3, 2018

If kernel/OS does not support Hugepages, init.d/ startup script fails (regardless of support requested or not) (Test sample is Ubuntu 16.04 lxbrand on SmartOS)

ENABLE_HUGE_PAGES="false"
HUGE_PAGE_SIZE_BYTES=`awk '/Hugepagesize:/{print $2*1024}' /proc/meminfo`

if [ -f $APPD_ROOT/HA/LARGE_PAGES_ENABLE -a -n "$HUGE_PAGE_SIZE_BYTES" ] ; then
        ENABLE_HUGE_PAGES="true"
fi

^^ HUGE_PAGE_SIZE_BYTES == null because value doesn't exist

Later: (line 1375) -> divide by zero:

  `  (( APPD_HUGE_PAGES = APPD_TOTAL_RESERVED_BYTES / HUGE_PAGE_SIZE_BYTES ))`

Output:

root@appd-node1:/# /etc/init.d/appdcontroller-db start
/etc/init.d/appdcontroller-db: line 1375: ((: APPD_HUGE_PAGES = APPD_TOTAL_RESERVED_BYTES / HUGE_PAGE_SIZE_BYTES : division by 0 (error token is "HUGE_PAGE_SIZE_BYTES ")
/etc/init.d/appdcontroller-db: line 1377: APPD_TOTAL_RESERVED_BYTES % HUGE_PAGE_SIZE_BYTES : division by 0 (error token is "HUGE_PAGE_SIZE_BYTES ")

@scosol
Copy link
Author

scosol commented Oct 4, 2018

I worked around this by hardcoding it to 2048, but that's obviously not "correct".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant