LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - Installation
User Name
Password
Slackware - Installation This forum is for the discussion of installation issues with Slackware.

Notices



Reply
 
Search this Thread
Old 03-22-2007, 09:53 AM   #16
mpyusko
Member
 
Registered: Oct 2003
Location: Rochester, NY, USA
Distribution: Salckware ver 10.1 - 14.1, Debian too.
Posts: 371
Blog Entries: 1

Original Poster
Rep: Reputation: 38

Quote:
Originally Posted by syg00
Stick it wherever you have room - minimum half a gig. Full gig is better.
I did half gig.

How much memory should you have before you don't need a swap partition?

Obviously @192MB I need one, but with 512? I heard the general rule, your swap should be double your RAM up to 1gig (swap size).
 
Old 03-22-2007, 11:19 AM   #17
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 65
I have 1Gb of ram and 1Gb of swap. Mine rarely uses more than a couple Mbs of swap though. A lot of it depends on amount of ram, what you are running and what you set swappiness too. For a laptop you should have that set low since the drive is slower.

: D
 
Old 03-24-2007, 01:32 AM   #18
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,487

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
Quote:
Originally Posted by mpyusko
How much memory should you have before you don't need a swap partition?
You always need swap space. You might never use it, but you still need it. Disk is cheap - even the small form-factor disks for laptops.
I allocate (at least) a Gig on every system - and add more as needed.

Yes, I know Linux will run without swapspace.
In 2.6, you can use either swap partition or file, without (performance) impact.
 
Old 03-24-2007, 08:50 AM   #19
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,446
Blog Entries: 4

Rep: Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505
Quote:
Originally Posted by syg00
You always need swap space. You might never use it, but you still need it. Disk is cheap - even the small form-factor disks for laptops.
I allocate (at least) a Gig on every system - and add more as needed.

Yes, I know Linux will run without swapspace.
In 2.6, you can use either swap partition or file, without (performance) impact.
Hi,

I disagree with your absolute statement! You don't need swap space, not a requirement. The system will function but at a sacrifice of time if the memory is fully utilized. A swap file could be used instead of a swap partition. This can get into a really big bag of worms. The debate is very active about the subject.

Some advantages of a swap file are that the size can be adjusted. The file system will be the bottle neck for the file. Where the swap partition will be limited to the pre-defined allocation. The speed advantage would be the swap daemon for the swap partition. The paging will be better handled here.

You could read Swapping Out and Discarding Pages for a good explanation.
 
Old 03-24-2007, 06:41 PM   #20
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,487

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
Quote:
Originally Posted by onebuck
Some advantages of a swap file are that the size can be adjusted. The file system will be the bottle neck for the file. Where the swap partition will be limited to the pre-defined allocation. The speed advantage would be the swap daemon for the swap partition. The paging will be better handled here.
This comes up in every swap related thread. In 2.6 Swap is its own filesystem - it doesn't use any of the normal filesystem block drivers. Have a look at the source for mkswap.
There is no difference in speed between using swap file or swap partition.
As for changing the size, I just add more extents as needed - they can also be swapoff'd later.
 
Old 03-26-2007, 11:31 AM   #21
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,446
Blog Entries: 4

Rep: Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505
Quote:
Originally Posted by syg00
This comes up in every swap related thread. In 2.6 Swap is its own filesystem - it doesn't use any of the normal filesystem block drivers. Have a look at the source for mkswap.
There is no difference in speed between using swap file or swap partition.
As for changing the size, I just add more extents as needed - they can also be swapoff'd later.
Hi,

When you are speaking about swapfile vs swap partition then there is differnce. And there is a time difference via the kernel swap daemon and a swapfile. You are dependent on the way the information is paged out.

I really don't want to get into a debate that has been going on for all to long a time. Just look at the data. When a file is used to move the page another layer is used. When a swap partition is used then the kernel swap daemon controls paging to the swap partition.

So I don't have to write the explanation, look at the LDP for virtual memory.

The 'man mkswap' doesn't reference timing.

You can have multiple swap files or multiple swap partitions. And yes you can switch them on or off.

Hope this helps!
 
Old 03-26-2007, 05:59 PM   #22
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,487

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
All 2.4 related - of no relevance to the modern world. Don't offer that as undeniable truth when you don't know.
I didn't mention the manpage - I said read the mkswap source. And while you're there have a look at kswapd.

You have a lot to learn.
 
Old 03-27-2007, 09:57 AM   #23
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,446
Blog Entries: 4

Rep: Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505
Quote:
Originally Posted by syg00
All 2.4 related - of no relevance to the modern world. Don't offer that as undeniable truth when you don't know.
I didn't mention the manpage - I said read the mkswap source. And while you're there have a look at kswapd.

You have a lot to learn.
Hi,

What has the source of mkswap got to do with the operation of the swap file or swap partition? You use the mkswap command to 'make swap area'.

Sure if the swap file is not contiguous then problems can appear even for the 2.6 kernel. That is one of the strengths of using a known good disk area as a partition for swap instead of a swap file.

The reference to the 'kswapd' source is valid. If you are speaking about the memory allocation of the main page allocator then we can still debate about the 2.4 or 2.6 kernel differences. Let us decide which kernel we will continue the discussion with. Your assumption and mine were different. The OP never stated he was using the 2.6 kernel. I assumed he was using the 2.4 with the 10.2 install.

As for personal attacks. I'll leave that to people like you!

You don't know what my experience is and I haven't made an attack on your abilities so don't defend yourself in that manner.

Maybe someone else has a lot too learn?
 
Old 03-27-2007, 10:39 AM   #24
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 231Reputation: 231Reputation: 231
Please tone the rhetoric down -- stick to facts & avoid the personalities & rudeness.

I would hate to ask the mods to close the thread.
 
Old 03-28-2007, 01:21 PM   #25
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,446
Blog Entries: 4

Rep: Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505
Hi,

Report if you wish! There was nothing wrong with my or syg00 comments. Sure personalities are involved. But when are they not? I am an adult that can communicate and I do not need someone else for defense.

Viewpoints and intelligent discussion are good about the subject as long as everyone agrees on the subject to discuss. I was speaking about the 2.4 kernel since the OP installed 10.2 and I assumed a basic install. We should have requested which kernel from the OP.

As to your statement;
Quote:
Originally Posted by archtoad6
Please tone the rhetoric down -- stick to facts & avoid the personalities & rudeness.
You have the right to discern as you wish.

Quote:
Originally Posted by archtoad6
I would hate to ask the mods to close the thread.
I believe the moderators do a good job of watching the LQ forums. Your threat of having to ask wasn't warranted!

My reason for response to you is that LQ is a good place for discussion. We don't need a rigid format but we do need good open discussion to help each other when problems arise.
 
Old 03-28-2007, 02:25 PM   #26
mpyusko
Member
 
Registered: Oct 2003
Location: Rochester, NY, USA
Distribution: Salckware ver 10.1 - 14.1, Debian too.
Posts: 371
Blog Entries: 1

Original Poster
Rep: Reputation: 38
Smile I have a 2.4 Kernel.

Yes, you are correct in assuming I am using 2.4 for a Kernel. So only 2.4 information is relevant for me. Sadly I have an abundance of "legacy" equipment so I've not moved to 2.6 as of yet. I appreciated your discussion about the swap differences between 2.4 and 2.6 though. I was not aware 2.6 had those capabilities. However, I would not feel comfortable using a swap file as opposed to a swap partition. As onebuck said:

Quote:
Originally Posted by onebuck
Sure if the swap file is not contiguous then problems can appear even for the 2.6 kernel. That is one of the strengths of using a known good disk area as a partition for swap instead of a swap file.
That is a concern of mine. The primary purpose of having separate partitions, is so filesystem do not get corrupted, and if they do, it is not a total loss. This step for the 2.6 Kernel looks to me like the classic Windows' "Put all you eggs in one basket, the chickens can always lay more." approach. But ah, I digress.

I don't want to turn this thread into a discussion of 2.4 vs. 2.6. So please, even though you both have excellent points, stick to the topic. I don't think outside intervention is necessary, no rules were broken.

Like I said I have 2.4.
 
Old 03-30-2007, 09:10 AM   #27
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,446
Blog Entries: 4

Rep: Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505
Hi,

Even for a swap partition you should do a bad block check when you create the partition. You should even test the 'swap file' for contiguous space for 2.4 or 2.6 kernels. There is nothing wrong with using a swap file vs a swap partition. There are times it will be easier to create a swap file. Especially if the swap file is to be used temporarily.

The 2.6 kernel will handle the swap much better that the 2.4 kernel. Since the page allocator has been re-written for the 2.6. Placing more than one swap on different drives will help in some cases. Here you will be dependent on the speed of the hardware I/O.

I too agree that we need to stay on subject. That was how the discussion developed between syg00 and myself. I was speaking on the 2.4 kernel and syg00 was referencing the 2.6. Apples and bananas! Resulting in each having bruises.

Last edited by onebuck; 03-30-2007 at 09:12 AM.
 
Old 03-30-2007, 11:03 AM   #28
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,775

Rep: Reputation: 481Reputation: 481Reputation: 481Reputation: 481Reputation: 481
There is little functional difference between the swap space in a file or a partition. Accessing swap space in a swap file is necessarily a little slower since the file system access time must be added in.
Swap space is not absolutely necessary, but having the smallest possible amount could someday save you from a system hangup. For a long time I ran without any swap at all and the only way I had a system hangup was by compiling the full mozilla with all tests and debug features turned on, which takes about 1.5GB of hard disk space when finished. This was on a MAC(512MB RAM) which may have had something to do with it.
Don't get me wrong, I'm not recommending that you run without swap. But do take note that the minimum size of swap is just 4K -that should tell us something.
Even if you are running KDE, I doubt that you'd see any improvement in system response times comparing betweeen running with 512MB or 1G of RAM.
On my systems which use only lightweight GUI components there is no improvement above 128MB of RAM. The point is that 128-256MB of RAM is usually plenty to run your system and GUI. The rest of the RAM will get used for page-caching when you start to work. If you have as much as 512MB of RAM, your swap will hardly ever be touched.
All that said, if you are editing videos, compressed sound files or ISO images, you may easily need 3-5GB of total RAM and swap.
Even though there is a slight time penalty with using swap files they make more sense for systems which don't really need any or much swap. It saves creating a separate partition -you can always change the size of your swap file.

Trying to optimize swap access times based on physical disk location is extremely difficult. Most of the points have been covered except this: the real hold back on disk access times is not the spin-rate but the time it takes to move the head across the disk. This doesn't necessarily mean that the start of the disk is faster -some manufacturers beat us to the punch and park the head in the middle of the disk radius since they don't know which direction will be needed next.
So, if you can really figure out how your disks park their heads and find out for sure that your swap partition begins close to the physical middle of a component disk, well I congratulate you.
 
Old 04-06-2011, 10:48 AM   #29
Himilhil
Member
 
Registered: Jun 2009
Posts: 52

Rep: Reputation: 15
First of all sorry for necroposting. I've got a question after reading this topic.

Quote:
Originally Posted by runlevel0 View Post
One HD swap in the middle
In the middle of what? I suppose travel time of head would be minimized only if swap partition was placed in the middle of plate. If swap partition was placed in the middle of whole HDD it might be placed at the outer border of plate, at the hub or even on different plates. Please correct me if I wrong.
But how could I know numbers of sectors which are placed in the middle of plates?
 
Old 04-06-2011, 12:15 PM   #30
mpyusko
Member
 
Registered: Oct 2003
Location: Rochester, NY, USA
Distribution: Salckware ver 10.1 - 14.1, Debian too.
Posts: 371
Blog Entries: 1

Original Poster
Rep: Reputation: 38
Careful reasearch and whitepapers?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DISCUSSION: From beginning to end: ProFTPD MasterC LinuxAnswers Discussion 5 09-25-2005 12:21 AM
Resizing a Partition blocked from both beginning and end apachedude Linux - Hardware 2 01-17-2005 04:02 AM
Where to put swap partition mikieboy Linux - Software 3 11-25-2004 01:01 AM
Is this the beginning of the end for Gnome? WSG Linux - General 8 02-03-2002 02:57 PM
Linux put the swap partition on my second HD. Don't want it there. rdaves@earthlink.net Linux - General 3 09-21-2001 09:42 AM


All times are GMT -5. The time now is 01:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration