All of lore.kernel.org
 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] Using madvise()/ioctl() instead of /dev/anon?
Date: Tue, 6 Jul 2004 13:20:17 +0200	[thread overview]
Message-ID: <200407061320.17815.blaisorblade_spam@yahoo.it> (raw)

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

             reply	other threads:[~2004-07-06 16:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-06 11:20 BlaisorBlade [this message]
2004-07-13 19:29 ` [uml-devel] Using madvise()/ioctl() instead of /dev/anon? 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=200407061320.17815.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 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.