Follow us on Google+ Follow us on Facebook Follow us on Twitter

Opened 5 years ago

Last modified 3 years ago

#446 new defect

High memory corrodes memory reservations

Reported by: jermar Owned by:
Priority: major Milestone: 0.7.1
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 (1)

comment:1 Changed 3 years ago by jermar

  • Milestone changed from 0.6.0 to 0.7.1
Note: See TracTickets for help on using tickets.