Re: __get_free_pages(): is the MEM really mine?

Ingo Molnar
2001-09-27T13:02:45Z

On Thu, 27 Sep 2001, Bernd Harries wrote:

> > have you perpahs freed that page?
>
> Yes, as expected.

well - what did you expect to happen? A freed page is going to be reused
for other purposes. A big 2MB allocation can be reused in part, once
memory usage grows. So you should not expect the device to be able to DMA
into a page that got freed, unpunished. Perhaps i'm misunderstanding the
problem.

> But I tend to conclude from getting the same phys address again after
> some time that noone else uses much memory inbetween. Plus, the first
> page of the area stays Zero all the time while the higher pages seem
> to be used by someone. [...]

the buddy allocator allocates top down. Plus, if you allocate a 2MB
physically continuous chunk then the likelyhood is high that there were
fragmented pages skipped during the initial search for a 2MB block - so
you still have a fair likelyhood to reallocate it after some time, if
memory usage is light. But this likelyhood nears zero once RAM usage gets
near 100%.

Ingo