linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nitin Gupta <ngupta@vflare.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: tmem-devel@oss.oracle.com, linux-mm <linux-mm@kvack.org>
Subject: [RFC] vswap: virtio based swap device
Date: Sun, 03 Jan 2010 05:54:04 +0530	[thread overview]
Message-ID: <4B3FE3A4.6030401@vflare.org> (raw)

virtio_vswap driver[1] creates /dev/vswap device which can
be used (only) as a swap disk. Pages swapped to this device
are send directly to host/hypervisor. The host, depending on
various policies, can fail this request in which case the driver
writes the page to guest controlled swap partition (backing_swap
module parameter provides this partition). The size of this
device is set equal to that of backing_swap.

This driver provides an alternate approach for "preswap"
introduced as part of "tmem" patches posted earlier:
http://lwn.net/Articles/338098/
These patches used Xen specific interfaces and made some
intrusive changes to swap code. However, I found the concept
interesting, so developed this virtio based driver which does
not require any kernel changes.

It uses virtio to create a virtual PCI device and also creates
a virtual block device (/dev/vswap) whose only job is to send
pages to host and if that fails, forward request to backing_swap.
It also requires changes to qemu-kvm[2] to expose this virtual
PCI device to guest and is enabled with '-vswap virtio' option.

In current state, it does everything except actually storing
incoming guest pages in host memory :)  Also, it uses a single
virtqueue which sends each page to host synchronously.  Its just
a proof of concept code to show how virtio framework can be used
to drive such a device. Perhaps a more interesting application would
be an FS-cache backend that sends pages to host as clean pagecache
usually occupies a vast majority of memory and ballooning is too slow
to deal quickly with such large caches when the host is running into
memory pressure.

[1] vswap kernel driver:
http://code.google.com/p/compcache/source/browse/sub-projects/vswap/

[2] qemu-kvm patch to expose vswap PCI device:
http://code.google.com/p/compcache/source/browse/sub-projects/vswap/qemu_kvm_vswap_support.patch

[3] Transcendent Memory (tmem) project page:
http://oss.oracle.com/projects/tmem/

(I intend to merge vswap with ramzswap driver which is already
in mainline, so I did not integrate it with kernel build system.
So, provided just the link to code instead of diff against /dev/null)

Thanks,
Nitin

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

                 reply	other threads:[~2010-01-03  0:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4B3FE3A4.6030401@vflare.org \
    --to=ngupta@vflare.org \
    --cc=dan.magenheimer@oracle.com \
    --cc=linux-mm@kvack.org \
    --cc=tmem-devel@oss.oracle.com \
    /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