Placement Allocation within the kernel
Kenneth Adam Miller
kennethadammiller at gmail.com
Thu Aug 20 11:49:17 EDT 2015
Suppose I want to do something analogous to C++'s new in userspace. But
instead, I want an entirely new page table to be constructed at the
location of my choosing. In addition, I want a specific region for that
page table to manage, and this requires that this region no longer be
available to the rest of kernel code in order that it cannot be served for
allocation elsewhere.
To illustrate what I want to do, I think it would be ok to imagine that I
allocate a very large contiguous region of memory within which to do this.
Once that region of memory is allocated, it can't be served elsewhere, so
that serves my purpose. Then what I want to do is have an equivalent of
kmalloc and free that not only takes size and a pointer respectively, but
also the table which to reference in order to do the allocation from. To
begin with, before I do work allocation with this table, I need a function
that will construct such a table correctly at the location of my choosing
within the large block that I mentioned that I've allocated before.
The end result is what I need, and from which I've derived the above
requirements: I can have the default memory management facilities within
the kernel reused to suit my needs. Kmalloc and kfree will coalesce the
table behind the scenes for me, which is what I want to avoid.
Is the above possible? I'm pretty sure that it is.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150820/98c50736/attachment.html
More information about the Kernelnewbies
mailing list