linux-um archives
 help / color / mirror / Atom feed
From: Jeff Dike <jdike@addtoit.com>
To: BlaisorBlade <blaisorblade_spam@yahoo.it>
Cc: user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] Using madvise()/ioctl() instead of /dev/anon?
Date: Tue, 13 Jul 2004 15:29:01 -0400	[thread overview]
Message-ID: <200407131929.i6DJT2Gu003407@ccure.user-mode-linux.org> (raw)
In-Reply-To: Your message of "Tue, 06 Jul 2004 13:20:17 +0200." <200407061320.17815.blaisorblade_spam@yahoo.it>

blaisorblade_spam@yahoo.it said:
> 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. 

ioctls are frowned upon since they are inherently unstructured.  If you need
special semantics for something, a new driver/filesystem is generally preferred.

I'm not saying that hacking on tmpfs is the right way to go necessarily, but
I think it's better than adding ioctls to something.

A new madvise option might be a possibility, but I still like a special driver
better.

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

Yeah, tmpfs is swappable, and devanon does nothing to change that.

> 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? 

Every new open will give you a new devanon instance.  The name is just there
to give /proc/<pid>/maps and /proc/<pid>/fd something to print.

				Jeff



-------------------------------------------------------
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-13 18:33 UTC|newest]

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

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=200407131929.i6DJT2Gu003407@ccure.user-mode-linux.org \
    --to=jdike@addtoit.com \
    --cc=blaisorblade_spam@yahoo.it \
    --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