On Friday 24 March 2006 23:45, Andrew Morton wrote:
> Jeff Dike <[EMAIL PROTECTED]> wrote:
> > Unplugged pages are allocated and then madvise(MADV_REMOVE),
> > This patch also removes checking for /dev/anon on the host, which is
> > obsoleted by MADVISE_REMOVE.
> * NOTE: Currently, only shmfs/tmpfs is supported for this operation.
> * Other filesystems return -ENOSYS.
> Are you expecting that this memory is backed by tmpfs?
Yes, that's the recommended configuration, and we're going to move the default
position for the backing file to /dev/shm.
However, it's bogus to miss any error handling - possibly not returning err is
wanted (dunno) because Jeff wants to pretend it succeeded anyway, but at
least a printk() to inform the user that memory must lay on tmpfs is
required.
> +int os_drop_memory(void *addr, int length)
> +{
> + int err;
> +
> + err = madvise(addr, length, MADV_REMOVE);
> + if(err < 0)
> + err = -errno;
Jeff, did you mean the "return _0_" rather than "return err" below? It's
incoherent with the existance of the "err" local.
> + return 0;
> +}
--
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade
___________________________________
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB
http://mail.yahoo.it
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel