garryb Posted September 24, 2009 Share Posted September 24, 2009 well as im studying linux at my institute so in theory class today we had a question why does ext4 not use swap? well i thought all ext used swap so whats the difference between swap in ext3 and swap if any in ext4 , i tried googling in but no luck so im asking all the linux masters down here to please try and help me with this.Thank you for reading and sorry for my bad engkish its not my mother tongue. Link to comment https://www.neowin.net/forum/topic/826664-no-swap-on-ext4/ Share on other sites More sharing options...
ViperAFK Posted September 24, 2009 Share Posted September 24, 2009 ext4 uses swap... your teacher is on crack. There's not really any difference between how they use swap AFAIK. Link to comment https://www.neowin.net/forum/topic/826664-no-swap-on-ext4/#findComment-591616568 Share on other sites More sharing options...
garryb Posted September 24, 2009 Author Share Posted September 24, 2009 but can you please giveme a easy to understand explination of what swap is and how is it used in ext4 and what it does? Link to comment https://www.neowin.net/forum/topic/826664-no-swap-on-ext4/#findComment-591616592 Share on other sites More sharing options...
Growled Member Posted September 24, 2009 Member Share Posted September 24, 2009 I am not a master but I do use and enjoy Linux. Using ext 4 or any other file system should have no affect on swap at all, as the swap is used by the operating system and not the file system it sits upon. At least that is the way I understand it. Link to comment https://www.neowin.net/forum/topic/826664-no-swap-on-ext4/#findComment-591616604 Share on other sites More sharing options...
Lechio Posted September 24, 2009 Share Posted September 24, 2009 http://www.linux.com/news/software/applica...inux-swap-space google Link to comment https://www.neowin.net/forum/topic/826664-no-swap-on-ext4/#findComment-591616624 Share on other sites More sharing options...
Elv13 Posted September 24, 2009 Share Posted September 24, 2009 Swap is direct equivalent of windows pagefiles virtual memory, but in a separated and dedicated partition. You can use pagefiles too, but nobody seem to do it (swap is faster because it does not rely on the underling filesystem on every write operation. Hibernation also work better). Your teacher should have teached the principal behind operating system memory management before talking about those things. Thats the physical application of that theory, the page handler of Linux. Link to comment https://www.neowin.net/forum/topic/826664-no-swap-on-ext4/#findComment-591617100 Share on other sites More sharing options...
TokiToki Posted September 24, 2009 Share Posted September 24, 2009 Elv13 said: Swap is direct equivalent of windows pagefiles virtual memory, but in a separated and dedicated partition. You can use pagefiles too, but nobody seem to do it (swap is faster because it does not rely on the underling filesystem on every write operation. Hibernation also work better). Since the 2.6 kernel, the swapfile isn't any slower/less efficient than the swap partition (Andrew Morton explains why). I've also found hibernation with a swapfile to work just as well on my particular laptop, although it does take a little bit more work to get it working. Link to comment https://www.neowin.net/forum/topic/826664-no-swap-on-ext4/#findComment-591617168 Share on other sites More sharing options...
Wessg Posted September 26, 2009 Share Posted September 26, 2009 You can use swap on ext4 wtf is wrong with your teacher? :? Link to comment https://www.neowin.net/forum/topic/826664-no-swap-on-ext4/#findComment-591625458 Share on other sites More sharing options...
Volatile Posted October 2, 2009 Share Posted October 2, 2009 Elv13 provided the exact purpose for swap. You can use a swap with ext4 as well. I however do not use swap because I have more than applicable memory. Link to comment https://www.neowin.net/forum/topic/826664-no-swap-on-ext4/#findComment-591650914 Share on other sites More sharing options...
Zapadlo Posted October 3, 2009 Share Posted October 3, 2009 I was under an impression swap is not "on" any file system but an equivalence of a type of a file system itself. Link to comment https://www.neowin.net/forum/topic/826664-no-swap-on-ext4/#findComment-591657604 Share on other sites More sharing options...
Elv13 Posted October 3, 2009 Share Posted October 3, 2009 Volatile said: Elv13 provided the exact purpose for swap. You can use a swap with ext4 as well. I however do not use swap because I have more than applicable memory. You should consider adding a small swap to your system. Linux use two page managing different algorithm if a swap is present or not. The first one is more efficient and will increase performances, even if the swap is not used. Link to comment https://www.neowin.net/forum/topic/826664-no-swap-on-ext4/#findComment-591657660 Share on other sites More sharing options...
Volatile Posted October 4, 2009 Share Posted October 4, 2009 Elv13 said: You should consider adding a small swap to your system. Linux use two page managing different algorithm if a swap is present or not. The first one is more efficient and will increase performances, even if the swap is not used. Which may be true, but I've run two separate installs with and without a swap and haven't noticed a difference. Link to comment https://www.neowin.net/forum/topic/826664-no-swap-on-ext4/#findComment-591658328 Share on other sites More sharing options...
ehlo Posted October 4, 2009 Share Posted October 4, 2009 Linux can either use swap as a partition or as a file like in Windows. A swap file can be created on ext4 and most filesystems. As already stated, If the swap file is created when the filesystem is new (so there is no fragmentation) it will be just as fast as if it were a partition. http://lkml.org/lkml/2005/7/7/326 Quote > 3. Does creating the swapfile on a journaled filesystem (e.g. ext3 or> reiser) incur a significant performance hit? None at all. The kernel generates a map of swap offset -> disk blocks at swapon time and from then on uses that map to perform swap I/O directly against the underlying disk queue, bypassing all caching, metadata and filesystem code. Link to comment https://www.neowin.net/forum/topic/826664-no-swap-on-ext4/#findComment-591659726 Share on other sites More sharing options...
javagreen Posted October 5, 2009 Share Posted October 5, 2009 I installed Ubuntu 9.04 just today and I did create a swap partition to go with my ext4 / partition. Link to comment https://www.neowin.net/forum/topic/826664-no-swap-on-ext4/#findComment-591666252 Share on other sites More sharing options...
dwntwn Posted October 9, 2009 Share Posted October 9, 2009 Zapadlo said: I was under an impression swap is not "on" any file system but an equivalence of a type of a file system itself. You are correct, Linux Swap is in fact a different file system. If you look at any distro's "automatic" drive set up you will see they create a separate partition for the swap space. This is mainly due (but not limited) to the fact that it does not need to be journalized (as the regular file system is) thus keeping I/O speed as fast as possible. Link to comment https://www.neowin.net/forum/topic/826664-no-swap-on-ext4/#findComment-591683630 Share on other sites More sharing options...
MR_Candyman Posted October 9, 2009 Share Posted October 9, 2009 Your teacher is right...EXT4 doesn't use swap because swap is a completely separate file system. no filesystem is dependent on another one Link to comment https://www.neowin.net/forum/topic/826664-no-swap-on-ext4/#findComment-591683648 Share on other sites More sharing options...
Recommended Posts