Opened 13 years ago
Last modified 7 years ago
#446 new defect
High memory corrodes memory reservations
Reported by: | Jakub Jermář | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | helenos/unspecified | Version: | mainline |
Keywords: | Cc: | ||
Blocker for: | Depends on: | ||
See also: |
Description
Memory reservations were introduced before the physical memory was split into low memory and high memory. In order to make use of the high memory, we started to see the following pattern in the kernel:
frame = (uintptr_t) frame_alloc(ONE_FRAME, FRAME_HIGHMEM | FRAME_ATOMIC); if (frame) { page = km_map(frame, PAGE_SIZE, PAGE_READ | PAGE_WRITE); } else { frame = (uintptr_t) frame_alloc(ONE_FRAME, FRAME_LOWMEM); page = PA2KA(frame); }
Now, the problem with this is that the first non-blocking allocation request for high memory may fail, so that the caller will default to allocating from low memory. Because reservations do not differentiate between low and high memory, the caller may sleep in the second blocking allocation request. It can happen that the reserved memory will become soon available in high memory, but since the caller now only waits for low memory, it will never wake up.
We need to be able to merge the allocation request into a single, atomic allocation. This may require making memory reservations aware of the two kinds of memory and will likely change the mechanism of waiting for physical memory.
Change History (2)
comment:1 by , 10 years ago
Milestone: | 0.6.0 → 0.7.1 |
---|
comment:2 by , 7 years ago
Milestone: | 0.7.1 |
---|