[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: madvise (MADV_FREE)



Christoph Rohland wrote:
> > ok, so you're asking for a lite(TM) version of DONTNEED that
> > provides the following hint to the kernel: "i may be finished with
> > this page, but i may also want to reuse it immediately."
> 
> I would say "... reuse this address space immediately and you can give
> me _any_ data the next time". "Any data" means probably either the old
> or a zero page.

For maximum performance that's right.  But Linux normally has to provide
some minimal security, so an application should only see its own data or
zeros, not an arbitrary page.

Zeroing has another advantage: you can efficiently detect it.  So you
can use it for cached memory objects too in a number of cases, not just
free memory.  (A bit from mincore would also allow detection, but not
nearly as efficiently).

> That's the optimal strategy for the memory management modules of SAP R/3.

Excellent!  A hard core recommendation :-)

-- Jamie
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/