All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] Using madvise()/ioctl() instead of /dev/anon?
@ 2004-07-06 11:20 BlaisorBlade
  2004-07-13 19:29 ` Jeff Dike
  0 siblings, 1 reply; 2+ messages in thread
From: BlaisorBlade @ 2004-07-06 11:20 UTC (permalink / raw)
  To: Jeff Dike; +Cc: user-mode-linux-devel

Well, you have started implementing /dev/anon, but you where also looking for 
a better interface.

I saw the description of madvise(MADV_DONTNEED), and it seemed to be what we 
needed, but it was not, sadly (it would discard data only from anonymous 
memory); but that gave me an idea of how to go.
What you need is to discard a dirty page from a mmap'ed tmpfs file (it is not 
worth implementing it for any other case: who wants performance needs tmpfs 
anyway); that could become a new ioctl on the file.

There are two ways:
1) A ioctl meaning "discard this page", to call onto a munmap()ed page: this 
separates the munmap() and the discard, but also increases the number of 
syscalls a little. I don't know if this increase is at all harmful: I 
consider this of low importance, since this is not performance critical IMHO.
2) A ioctl meaning "discard pages on munmap from this file": this requires 
adding file_operations-> munmap, but actually seems better for us.

The problem, in both cases, is about implementing them: it's harder than 
/dev/anon, since you need to hack tmpfs, but it will be probably more stable.

By the way: have you made sure that /dev/anon memory is swappable?

I also saw one bug: shmem_file_setup is called always with "dev/anon" as 
parameter: am I overlooking something or that will break when there are 
multiple UMLs running?
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729




-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
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] 2+ messages in thread

end of thread, other threads:[~2004-07-13 18:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-06 11:20 [uml-devel] Using madvise()/ioctl() instead of /dev/anon? BlaisorBlade
2004-07-13 19:29 ` Jeff Dike

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.