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

future_overhead #609

Closed
maeneas opened this issue Nov 19, 2012 · 6 comments
Closed

future_overhead #609

maeneas opened this issue Nov 19, 2012 · 6 comments
Assignees
Milestone

Comments

@maeneas
Copy link
Contributor

maeneas commented Nov 19, 2012

Getting a segfault with ./future_overhead -t 12 on a 12 core machine:

[manderson@156-56-14-84 bin]$ ./future_overhead -t 2
invoked 500000 futures in 2.16299 seconds
[manderson@156-56-14-84 bin]$ ./future_overhead -t 4
invoked 500000 futures in 2.42442 seconds
[manderson@156-56-14-84 bin]$ ./future_overhead -t 6
invoked 500000 futures in 3.21879 seconds
[manderson@156-56-14-84 bin]$ ./future_overhead -t 12

{what}: mmap() failed to allocate thread stack due to insufficient resources, /proc/sys/vm/max_map_count may be too low: HPX(unhandled_exception)
{version}: V0.9.5-trunk (AGAS: V2.1), Git: 64fc1da
{boost}: V1.51.0
{build-type}: release
{date}: Nov 14 2012 10:34:43
{platform}: linux
{compiler}: GNU C++ version 4.6.3 20120306 (Red Hat 4.6.3-2)
{stdlib}: GNU libstdc++ version 20120306

{what}: mmap() failed to allocate thread stack due to insufficient resources, /proc/sys/vm/max_map_count may be too low: HPX(unhandled_exception)
{version}: V0.9.5-trunk (AGAS: V2.1), Git: 64fc1da
{boost}: V1.51.0
{build-type}: release
{date}: Nov 14 2012 10:34:43
{platform}: linux
{compiler}: GNU C++ version 4.6.3 20120306 (Red Hat 4.6.3-2)
{stdlib}: GNU libstdc++ version 20120306

^CAborted (core dumped)

@ghost ghost assigned hkaiser Nov 19, 2012
@hkaiser
Copy link
Member

hkaiser commented Nov 19, 2012

That's exactly what the error message says - a silly system limitation in Linux. The only way to circumvent this is to compile HPX such that no guard pages for stack segments are allocated. The way to do this is to pass -DHPX_THREAD_GUARD_PAGE=OFF on the cmake command line when configuring HPX. Please delete all you binary and build directories before changing this setting and rebuild everything afterwards.

Alternatively, if you have root accesss to the machine or if you can convince a sysadmin to change it for you, you could change the value for /proc/sys/vm/max_map_count to increase the available number of mmap'ed segments in your system (IIRC, this is done either using something like echo 1000000 > /proc/sys/vm/max_map_count or by setting vm.max_map_count in the file /etc/sysctl.conf. You can then activate the new parameter using sysctl -p - it might be different on your system, though).

Please note that by disabling guard pages for stack segments you disable the capability to detect stack overflows, which might lead to other, more subtle errors.

@hkaiser
Copy link
Member

hkaiser commented Nov 19, 2012

I'm going to close this as there isn't anything we can do except for the outlined changes to either the compilaton of HPX or the system settings.

@hkaiser hkaiser closed this as completed Nov 19, 2012
@maeneas
Copy link
Contributor Author

maeneas commented Nov 19, 2012

Something is strange about this since 50% of the time, this error message does not show up (i.e. the code works as expected).

@maeneas maeneas reopened this Nov 19, 2012
@maeneas
Copy link
Contributor Author

maeneas commented Nov 19, 2012

If the random nature of this problem is expected, please feel free to close.

@brycelelbach
Copy link
Member

The randomness is just due to the nature of the hardware. Sometimes all the OS-threads are fast enough to eat all the work before too many threads are queued and that limit is hit.

@hkaiser
Copy link
Member

hkaiser commented Nov 22, 2012

Guard pages will be runtime configurable, see #611.

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

3 participants