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

l4lx: allocate memory in chunks #695

Closed
cproc opened this Issue Mar 18, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@cproc
Member

cproc commented Mar 18, 2013

When L4Linux tries to allocate a dataspace of the size of its physical memory, this allocation can fail, because the 'l4re_ma_alloc()' function in the 'l4lx' library always tries to allocate a contiguous dataspace of the given size and there might be no contiguous free area left. Since it is currently not really necessary that the dataspace is contiguous in physical memory, using a managed dataspace built from smaller memory chunks could help in this case.

@ghost ghost assigned cproc Mar 18, 2013

@chelmuth

This comment has been minimized.

Show comment
Hide comment
@chelmuth

chelmuth Mar 19, 2013

Member

Doesn't this void the kernels assumption about physical memory? At least @astarasikov has work-in-progress to use L4Linux as kind of device-driver donator.

Member

chelmuth commented Mar 19, 2013

Doesn't this void the kernels assumption about physical memory? At least @astarasikov has work-in-progress to use L4Linux as kind of device-driver donator.

cproc added a commit to cproc/genode that referenced this issue Mar 19, 2013

l4lx: allocate memory in chunks
When L4Linux tries to allocate a dataspace of the size of its physical
memory, this allocation can fail, because the 'l4re_ma_alloc()' function
in the 'l4lx' library always tries to allocate a contiguous dataspace of
the given size and there might be no contiguous free area left.

With this patch, memory gets allocated in chunks: if the size to be
allocated exceeds the configured chunk size, a managed dataspace gets
created and filled with multiple memory chunks of at most the chunk size.

The chunk size is 16M by default and can be configured in an l4linux
config node:

<config args="...">
	<ram chunk_size="16M"/>
</config>

Fixes genodelabs#695.
@cproc

This comment has been minimized.

Show comment
Hide comment
@cproc

cproc Mar 19, 2013

Member

4e716a8 makes the chunk size configurable from the run script. Allocations of a size smaller than or equal to the chunk size will get allocated as contiguous dataspace.

Member

cproc commented Mar 19, 2013

4e716a8 makes the chunk size configurable from the run script. Allocations of a size smaller than or equal to the chunk size will get allocated as contiguous dataspace.

@cproc cproc closed this in 570156b Mar 21, 2013

cproc added a commit to cproc/genode that referenced this issue May 12, 2014

l4lx: allocate memory in chunks
When L4Linux tries to allocate a dataspace of the size of its physical
memory, this allocation can fail, because the 'l4re_ma_alloc()' function
in the 'l4lx' library always tries to allocate a contiguous dataspace of
the given size and there might be no contiguous free area left.

With this patch, memory gets allocated in chunks: if the size to be
allocated exceeds the configured chunk size, a managed dataspace gets
created and filled with multiple memory chunks of at most the chunk size.

The chunk size is 16M by default and can be configured in an l4linux
config node:

<config args="...">
	<ram chunk_size="16M"/>
</config>

Fixes genodelabs#695.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment