mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: mouschi@wi.rr.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: Interesting VM feature?
Date: Fri, 15 Aug 2003 13:57:35 +0100	[thread overview]
Message-ID: <20030815125735.GE15911@mail.jlokier.co.uk> (raw)
In-Reply-To: <13dedd139cb9.139cb913dedd@rdc-kc.rr.com>

mouschi@wi.rr.com wrote:
> 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. 

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

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.

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.

Unfortunately, though much discussed a long time ago, the kernel
offers no service like this.

-- Jamie

  parent reply	other threads:[~2003-08-15 12:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-15  2:17 mouschi
2003-08-15 12:37 ` jlnance
2003-08-15 12:57 ` Jamie Lokier [this message]
2003-08-15 19:56 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030815125735.GE15911@mail.jlokier.co.uk \
    --to=jamie@shareable.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mouschi@wi.rr.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®