* [uml-devel] Re: [uml-user] /dev/anon available
[not found] <200401130510.i0D5AlS4026784@ccure.user-mode-linux.org>
@ 2004-01-17 19:48 ` BlaisorBlade
2004-01-18 4:54 ` Jeff Dike
0 siblings, 1 reply; 5+ messages in thread
From: BlaisorBlade @ 2004-01-17 19:48 UTC (permalink / raw)
To: Jeff Dike; +Cc: user-mode-linux-devel
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [uml-devel] Re: [uml-user] /dev/anon available
2004-01-17 19:48 ` [uml-devel] Re: [uml-user] /dev/anon available BlaisorBlade
@ 2004-01-18 4:54 ` Jeff Dike
2004-01-18 16:13 ` BlaisorBlade
0 siblings, 1 reply; 5+ messages in thread
From: Jeff Dike @ 2004-01-18 4:54 UTC (permalink / raw)
To: BlaisorBlade; +Cc: user-mode-linux-devel
On Sat, Jan 17, 2004 at 08:48:47PM +0100, BlaisorBlade wrote:
> 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).
Because when you map a /dev/zero page, modify it, then map it (i.e. the same
offset and the same fd) again someplace else, you don't get the modifications.
You get a page full of zeros. This obviously breaks the UML VM system.
Jeff
-------------------------------------------------------
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [uml-devel] Re: [uml-user] /dev/anon available
2004-01-18 4:54 ` Jeff Dike
@ 2004-01-18 16:13 ` BlaisorBlade
2004-01-18 23:53 ` Jeff Dike
0 siblings, 1 reply; 5+ messages in thread
From: BlaisorBlade @ 2004-01-18 16:13 UTC (permalink / raw)
To: Jeff Dike; +Cc: user-mode-linux-devel
Alle 05:54, domenica 18 gennaio 2004, Jeff Dike ha scritto:
> On Sat, Jan 17, 2004 at 08:48:47PM +0100, BlaisorBlade wrote:
> > 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).
>
> Because when you map a /dev/zero page, modify it, then map it (i.e. the
> same offset and the same fd) again someplace else, you don't get the
> modifications. You get a page full of zeros. This obviously breaks the
> UML VM system.
Yes, that's obvious with MAP_PRIVATE (and using MAP_SHARED would be
meaningless, if at all worked). But I wasn't aware you needed to map the same
region twice; I guess this is done for pages shared (even with copy on write)
between different processes inside UML, right? Also, since with skas the
mm_struct's of the virtual processes have nothing in common, they cannot
However, have you asked to Linus if he likes /dev/anon? Maybe he'll suggest
another interface for the same need (like when you two discussed skas4).
--
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [uml-devel] Re: [uml-user] /dev/anon available
2004-01-18 16:13 ` BlaisorBlade
@ 2004-01-18 23:53 ` Jeff Dike
2004-01-20 19:32 ` BlaisorBlade
0 siblings, 1 reply; 5+ messages in thread
From: Jeff Dike @ 2004-01-18 23:53 UTC (permalink / raw)
To: BlaisorBlade; +Cc: user-mode-linux-devel
On Sun, Jan 18, 2004 at 05:13:38PM +0100, BlaisorBlade wrote:
> Yes, that's obvious with MAP_PRIVATE (and using MAP_SHARED would be
> meaningless, if at all worked). But I wasn't aware you needed to map the same
> region twice; I guess this is done for pages shared (even with copy on write)
> between different processes inside UML, right?
Pages are shared all over the place. Pages are mapped into
the UML physical memory region (the entire file as one chunk)
the UML virtual memory region (in response to vmalloc)
UML processes
They can be shared between processes
between a fork and exec
as shared memory
as shared readonly data (i.e. program text)
> Also, since with skas the
> mm_struct's of the virtual processes have nothing in common, they cannot
What do you mean by this?
> However, have you asked to Linus if he likes /dev/anon? Maybe he'll suggest
> another interface for the same need (like when you two discussed skas4).
No, I haven't. I did get a reaction from the tmpfs author. He wasn't too
fond of the interface, but didn't immediately have any better suggestions.
I'm not too fond of it either, but it's the best I could think of off the
top of my head.
Jeff
-------------------------------------------------------
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [uml-devel] Re: [uml-user] /dev/anon available
2004-01-18 23:53 ` Jeff Dike
@ 2004-01-20 19:32 ` BlaisorBlade
0 siblings, 0 replies; 5+ messages in thread
From: BlaisorBlade @ 2004-01-20 19:32 UTC (permalink / raw)
To: user-mode-linux-devel
Alle 00:53, lunedì 19 gennaio 2004, Jeff Dike ha scritto:
> On Sun, Jan 18, 2004 at 05:13:38PM +0100, BlaisorBlade wrote:
> Pages are shared all over the place.
> [...]
Thanks for the info.
> > Also, since with skas the
> > mm_struct's of the virtual processes have nothing in common, they cannot
>
> What do you mean by this?
Sorry, nothing (I was writing of an idea about MAP_ANON, but dropped almost
all the sentence).
--
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-01-20 19:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200401130510.i0D5AlS4026784@ccure.user-mode-linux.org>
2004-01-17 19:48 ` [uml-devel] Re: [uml-user] /dev/anon available BlaisorBlade
2004-01-18 4:54 ` Jeff Dike
2004-01-18 16:13 ` BlaisorBlade
2004-01-18 23:53 ` Jeff Dike
2004-01-20 19:32 ` BlaisorBlade
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox