linux-um archives
 help / color / mirror / Atom feed
From: BlaisorBlade <blaisorblade_spam@yahoo.it>
To: Jeff Dike <jdike@addtoit.com>
Cc: user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] Re: [uml-user] /dev/anon available
Date: Sat, 17 Jan 2004 20:48:47 +0100	[thread overview]
Message-ID: <200401172048.47847.blaisorblade_spam@yahoo.it> (raw)
In-Reply-To: <200401130510.i0D5AlS4026784@ccure.user-mode-linux.org>

Alle 06:10, martedì 13 gennaio 2004, Jeff Dike ha scritto:
> I released two /dev/anon patches today - one for stock 2.4.23 and one for
> RH8 2.4.8-14.
>
> In short, /dev/anon is a device which UML can map its physical memory from
> and which can free dirty pages back to the host.  In conjunction with
> 'ubd=mmap', this can noticably reduce the memory consumption of UMLs on
> the host.  See http://user-mode-linux.sourceforge.net/devanon.html for more
> details.
>
> This requires the next version of UML, which will be released shortly.

I've given a look to the page, but yet I cannot see (this can be for my fault, 
but I'd really like an explaination of this) why you couldn't just mmap 
/dev/zero with MAP_PRIVATE to get the behaviour you want to get from 
/dev/anon (or maybe using MAP_ANONYMOUS). When you munmap a page, that goes 
out of your address space, so it cannot be dirty any more dirty. Also, with 
mmap you cannot modify /dev/zero, as it's a special case (mmap'ing that gives 
you a COW reference to the zero-filled page).

Beyond, I've checked that munmap works even for partial unmapping of files. So 
you could even mmap it as a single chunk (or better two chunks, read-only and 
read-write memory on i386; it would be harder on other arch's), at the end 
and munmap to free any page (that splits the old mapping into two new ones 
that map the pages around the unmapped ones). The problem is that using this 
means you cannot do mremap to enlarge mapped space, since in that case you 
don't know which mapping to remap (if you don't track it by hand, which would 
be actually hard).

Bye
-- 
cat <<EOSIGN
Paolo Giarrusso, aka Blaisorblade
Linux Kernel 2.4.23/2.6.0 on an i686; Linux registered user n. 292729
EOSIGN



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

       reply	other threads:[~2004-01-17 19:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200401130510.i0D5AlS4026784@ccure.user-mode-linux.org>
2004-01-17 19:48 ` BlaisorBlade [this message]
2004-01-18  4:54   ` [uml-devel] Re: [uml-user] /dev/anon available Jeff Dike
2004-01-18 16:13     ` BlaisorBlade
2004-01-18 23:53       ` Jeff Dike
2004-01-20 19:32         ` BlaisorBlade

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=200401172048.47847.blaisorblade_spam@yahoo.it \
    --to=blaisorblade_spam@yahoo.it \
    --cc=jdike@addtoit.com \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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