Re: Swap device vs Swap file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

On 08:17 Sat 25 Oct     , Vimal wrote:
> Is there a fundamental difference between a swap device and a swap
> file? A swap file can exist on a NFS, can a swap *device* exist over
> NFS? Or, is the distinction blurred?

A file is believed to be a bit slower due to fragmentation and some other
issues. People often create swap partitions without any thought. I have not
seen any benchmarks though.

A swap device cannot exist over NFS. You can only have a swap device file
which points to a local block device. But there is a thing called "network
block device" which can to such a thing.

There is another pitfall: swapping is usually done when there is not enough
memory. The kernel has some emergency reserve pools which make sure that
operations which can free memory succeed even if they require allocating some
memory. But I have not seen them in the network code anywhere. So in extreme
cases the system might not be able to swap out memory and trigger the oom
killer...

> In general, can one have devices over NFS? i.e., have a device node
> (say) /dev/console on my local machine, but any operation to
> /dev/console (like read(), say) would be routed by the VFS to NFS,
> which in turn, sends the request to another computer over the network?
> 
> Though there doesn't seem to be logical reason why the above shouldn't
> exist; if it didn't, is there a reason why?

In Linux, device files always point to local devices, even if the file system,
which stores them is on NFS.

You are probably interested in the "plan 9 file system". Plan 9 is a free
(GPL) operating system which was designed to integrate networking as much
as possible. Everything (network stack, display, ...) is a device. You can
share this file system with other pcs via a network. See e.g.:

http://ftp.belnet.be/mirror/FOSDEM/2006/FOSDEM2006-plan9.avi

There is a thing "plan 9 file system" in the Linux kernel, too, but I have
never used it.
	-Michi
-- 
programing a layer 3+4 network protocol for mesh networks
see http://michaelblizek.twilightparadox.com


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux