public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Interesting VM feature?
@ 2003-08-15 19:56 mouschi
  2003-08-15 20:00 ` Mike Fedyk
  0 siblings, 1 reply; 8+ messages in thread
From: mouschi @ 2003-08-15 19:56 UTC (permalink / raw)
  To: Jamie Lokier; +Cc: linux-kernel

Jamie Lokier wrote:
> You can call madvise(start, length, MADV_DONTNEED),
> or you can mmap() fresh empty pages into the region.

madvise appears to be exactly what I'm looking for.
(almost...)

> I have no idea if either of these methods is
efficient enough to be
> useful.  Also, I don't know whether mmap() would
create multiple VMAs,
> or if it is clever enough to merge adjacent vmas
of anonymous private
> mappings regardles of offset.

Enough possible pitfalls that madvise becomes the
better solution.

> The ideal implementation would give the kernel the
_option_ of
> discarding pages until they are next touched, so
that they are
> discarded when there is memory pressure but
retained if not, avoiding
> the unnecessary zero-fill and cache flush.

Is madvise required to result in zero filled pages
by a standard, or is this just the commonly accepted
behavior?

> -- Jamie

Thanks a bunch,
Ted


^ permalink raw reply	[flat|nested] 8+ messages in thread
* Interesting VM feature?
@ 2003-08-15  2:17 mouschi
  2003-08-15 12:37 ` jlnance
  2003-08-15 12:57 ` Jamie Lokier
  0 siblings, 2 replies; 8+ messages in thread
From: mouschi @ 2003-08-15  2:17 UTC (permalink / raw)
  To: linux-kernel

(Please CC: me,)

Hi,

I've recently come across someone porting some code
from windows that trys to implement an efficient
memory pool using some VM tricks. I have no idea if
linux has an equivalent to this feature (described
below), and wouldn't know what to even search for to
find out.

What this mempool wants to do is to be able to
allocate a block of memory and tell the kernel which
pages from it can be outright discarded, instead of
swapped out when memory starts to get crowded. 

Now, from looking at mel's docs, it looks to me like
this would mean letting the application directly
mark pages clean. But it would also mean finding any
swapped out versions of this page and deallocating
them, otherwise if the page is discarded and then
used again, time would be wasted swapping in garbage.

I'm going to keep reading. If this is already
implemented, or if the efficiency gains would be
nil, somebody yell at me before I start crashing my
kernel with attempts at doing this myself. :-) It
seems so trivial after all...

Thanks,
Ted Kaminski


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-08-21 11:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-15 19:56 Interesting VM feature? mouschi
2003-08-15 20:00 ` Mike Fedyk
2003-08-15 21:19   ` Jamie Lokier
2003-08-21  2:24     ` H. Peter Anvin
2003-08-21 11:59       ` Jeff Dike
  -- strict thread matches above, loose matches on Subject: below --
2003-08-15  2:17 mouschi
2003-08-15 12:37 ` jlnance
2003-08-15 12:57 ` Jamie Lokier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox