LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Is swap a file system? (https://www.linuxquestions.org/questions/linux-general-1/is-swap-a-file-system-528652/)

FSoftware Lover 02-13-2007 09:07 AM

Is swap a file system?
 
Is swap itself a file system at all?

wpn146 02-13-2007 09:51 AM

Normally, no.

The exception would be if you were using a regular file for swap. (Uncommon.)

trickykid 02-13-2007 01:41 PM

Treat swap as a raw partition or format.

apolinsky 02-13-2007 03:08 PM

Though your answer is correct as far as Linux and freebsd goes, it is INCORRECT when examining Solaris. Under Solaris 8, and I assume later revisions also, /tmp is also used as swap space. There is no separate /swap partition. We've been burned more than once at work with people putting large files in /tmp for 'temporary' storage, and having our large E15K slow down significantly.

I've never quite understood the reasoning behind Sun's choice.

pixellany 02-13-2007 03:18 PM

I would assume that the kernel is doing low-level writes to swap--using the equivalent of dd. Thus it only needs to know what zone on the disk it is allowed to use.

syg00 02-13-2007 04:43 PM

Quote:

Originally Posted by apolinsky
Though your answer is correct as far as Linux and freebsd goes, it is INCORRECT when examining Solaris. Under Solaris 8, and I assume later revisions also, /tmp is also used as swap space. There is no separate /swap partition. We've been burned more than once at work with people putting large files in /tmp for 'temporary' storage, and having our large E15K slow down significantly.

Well, given that this is "Linux - General" who cares about Solaris ... ??? :p
All jokes aside, that does sound *interesting*. I did install Solaris 10 when it first went public, but it didn't appeal, so I haven't bothered looking at it since.
Quote:

I've never quite understood the reasoning behind Sun's choice.
Where's jilliagre when needed ???.

jlliagre 02-14-2007 02:19 AM

Quote:

Originally Posted by syg00
Where's jlliagre when needed ???.

I'm here ;)
Quote:

Originally Posted by apolinsky
Though your answer is correct as far as Linux and freebsd goes, it is INCORRECT when examining Solaris.

Nope, swap partitions are very similars whatever the Unix variant.
With Linux, while not a real filesystem the swap partition must have a structure which is created with the "mkswap" command. Solaris and probably *BSD have no such requirement.
Quote:

Under Solaris 8, and I assume later revisions also, /tmp is also used as swap space. There is no separate /swap partition.
That's the way around. It isn't /tmp that is used as swap space, but swap space that may be used to store temporary files. This is happening only if no more RAM is available.
Quote:

We've been burned more than once at work with people putting large files in /tmp for 'temporary' storage, and having our large E15K slow down significantly.
It's curious to hear of such a poor configuration on that class of server. /tmp VM usage can simply be capped to avoid RAM exhaustion with the size=xxx mount option.
Quote:

I've never quite understood the reasoning behind Sun's choice.
The reasoning is to have very fast read/write performance for temporary files, by storing them in virtual memory, which is RAM in nominal case, and not on disk.
By the way, this Solaris feature has been implemented later by linux http://wiki.linuxquestions.org/wiki/Tmpfs , so it mustn't be that bad ;)

syg00 02-14-2007 03:10 AM

Allow me to disagree - recent thread here.
It may be proposed regularly, but I don't like the concept.

jlliagre 02-14-2007 03:56 AM

Quote:

Originally Posted by syg00
Allow me to disagree

About what ?
Quote:

- recent thread here.
Sure, a machine with so little RAM available will not take advantage of tmpfs. Just the opposite actually.
tmpfs is a feature you can use on linux or Solaris, but it is not mandatory in either. It can easily be disabled on Solaris if RAM is sparse.
Quote:

It may be proposed regularly, but I don't like the concept.
The concept is to enhance performance, and it saves energy.
Why don't you like it ?

syg00 02-14-2007 04:23 AM

Polluting the page cache cannot be a good thing.
Linux has aweful (non-existant) performance/tuning metrics. The effects can't be measured. Hence I don't like the concept of using (real) storage for temporary file systems.

Every so often I get the feeling that things like Dtrace might just convince me to go back and look at Solaris again.

jlliagre 02-14-2007 04:39 AM

Quote:

Originally Posted by syg00
Polluting the page cache cannot be a good thing.

I'm missing how application temporary data relates to pollution.
Quote:

Linux has aweful (non-existant) performance/tuning metrics. The effects can't be measured. Hence I don't like the concept of using (real) storage for temporary file systems.
Then you support tmpfs, which does its best to avoid using real storage for temporary files, or am I missing something ?
Quote:

Every so often I get the feeling that things like Dtrace might just convince me to go back and look at Solaris again.
Add ZFS and zones to the list :)

FSoftware Lover 02-14-2007 10:19 AM

PLease answer my question exactly! :scratch:
I expected that you focus only on it :mad:
Is swap a File System eventually or not?

pixellany 02-14-2007 11:22 AM

Quote:

Originally Posted by FSoftware Lover
PLease answer my question exactly! :scratch:
I expected that you focus only on it :mad:
Is swap a File System eventually or not?

You will not get much help here with this kind of belligerent behavior.
Suggestions:
  1. Read what has already been posted and ask questions
  2. Say "please" and "thank you"

jlliagre 02-14-2007 11:34 AM

Quote:

Originally Posted by FSoftware Lover
PLease answer my question exactly! :scratch:

Hasn't it been answered ?
Quote:

I expected that you focus only on it :mad:
You expected wrong. Your question was less interesting (at least to me) than the debate it triggered.
Quote:

Is swap a File System eventually or not?
No, it has never been, and likely never will.
Swap is meant to store pages of memory that can't stay in RAM for some reason. Pages aren't files. Using a filesystem to store them would be overkill.

Gethyn 02-14-2007 11:35 AM

I thought FSoftware Lover was making a bit of a joke with that last post, and to be fair to him/her this thread does seem to have wandered a little off topic. FSoftware Lover, why do you ask? As someone already mentioned, as far as I am aware a Linux swap partition has some kind of structure, and in that sense is a filesystem. By contrast, an OpenBSD (and presumably some other BSDs) swap partition is just raw data.


All times are GMT -5. The time now is 06:04 AM.