Alternative Mapping Methods

Besides vmalloc, there are other ways of creating virtually contiguous mappings. All are based on the _vmalloc function discussed above or make use of a very similar mechanism (not discussed here).

□ vmalloc_32 works in the same way as vmalloc but ensures that the physical memory used can always be addressed by means of regular 32-bit pointers. This is important if an architecture can address more memory than would normally be possible on the basis of its word length; this is the case, for example, on IA-32 systems with enabled PAE.

□ vmap uses a page array as its starting point to create a virtually contiguous memory area. In contrast to vmalloc, the physical memory location is not allocated implicitly but must be passed ready-made to the function. Mappings of this kind can be recognized by the VM_MAP flag in their vm_map instance.

□ Unlike all mapping methods described above, ioremap is a processor-specific function that must be implemented on all architectures. It enables a chunk taken from the physical address space used by the system buses for I/O operations to be mapped into the address space of the kernel.

This function is used predominantly in device drivers to make the address areas used for communication with the peripherals available to the rest of the kernel (and, of course, to itself).

Continue reading here: Freeing Memory

Was this article helpful?

0 0