Re: Swapping to a large sparse file

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

 




On 01/16/2015 01:57 PM, Chris Murphy wrote:
On Fri, Jan 16, 2015 at 1:08 PM, jd1008 <jd1008@xxxxxxxxx> wrote:
Can it be done?

So far, swapon says:
swapon: /var/swapfile: skipping - it appears to have holes.

I was hoping that the kernel's swapper would allow the filesystem to
allocate
real blocks to the sparse file when they are needed rather than check
up front to see if they already exist.

Maybe the devs can have a look and see if they can modify the swapper to
allow sparse swap files??
No the issue is that the swap code doesn't actually write through the
file system. Essentially it gets the LBA range of the file from the
file system, and then asserts direct control to write to those blocks.
And in this case the sparse file has no real blocks so swapon fails.

It's similar problem to swapfiles on NFS and Btrfs. There are patches
floating around to get this working on NFS that Btrfs was also going
to leverage. I don't know the status of that work,  it seems a bit
stalled to me.

You could probably create a sparsefile to back a loop device, and then
specify the loop device as swap. But reports are this will be slower
than a swapfile.



Thank you Chris.
Yes, it works if I losetup /dev/loop? as the device.

Reason I asked, is that I just upgraded my laptop to 8GB ram
and I really do not want to have to repartition the drive to have a
larger swap space and restore everything from backup.

In older "traditional" practices, swap space was normally
about twice the ram size. Today, with some systems having
64 and even 128GB and even larger RAM, it becomes interesting
how big swap space should be. Where is the cutoff for performance?
Paging in and out 128GB memory space could prove to be itself a
performance bottleneck on very busy or memory bound servers.

Cheers,

JD

--
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux