Re: How does swap work address spacewise?

2002-07-06 Thread Matthew Dillon
:If RAM + swap can be more than 4GB, how does FreeBSD address swap on a :32-bit machine? Does the kernel internally use a wider address space :with some kind of translation to 32-bit space for programs and hardware :that can't handle 64-bit addresses or does it not map swap into the :address

Re: How does swap work address spacewise?

2002-07-06 Thread Darren Pilgrim
Bernd Walter wrote: On Fri, Jul 05, 2002 at 05:58:15PM -0700, Darren Pilgrim wrote: If RAM + swap can be more than 4GB, how does FreeBSD address swap on a 32-bit machine? Does the kernel internally use a wider address space The same way it does on every partitition: using block numbers.

Re: How does swap work address spacewise?

2002-07-06 Thread Matthew D. Fuller
On Sat, Jul 06, 2002 at 02:37:02PM -0700 I heard the voice of Darren Pilgrim, and lo! it spake thus: And you can have more than a single swap partition. Up to four, so then the theoretical limit for swap is 8TB? I hope not, since I have 6 of 'em. 4's just the default. Do these

Re: How does swap work address spacewise?

2002-07-06 Thread Bernd Walter
On Sat, Jul 06, 2002 at 02:37:02PM -0700, Darren Pilgrim wrote: Bernd Walter wrote: On Fri, Jul 05, 2002 at 05:58:15PM -0700, Darren Pilgrim wrote: If RAM + swap can be more than 4GB, how does FreeBSD address swap on a 32-bit machine? Does the kernel internally use a wider address space

Re: How does swap work address spacewise?

2002-07-06 Thread Darren Pilgrim
Bernd Walter wrote: On Sat, Jul 06, 2002 at 02:37:02PM -0700, Darren Pilgrim wrote: Bernd Walter wrote: On Fri, Jul 05, 2002 at 05:58:15PM -0700, Darren Pilgrim wrote: If RAM + swap can be more than 4GB, how does FreeBSD address swap on a 32-bit machine? Does the kernel internally

Re: How does swap work address spacewise?

2002-07-06 Thread Terry Lambert
Darren Pilgrim wrote: I thought the limit for filesystems was 2TB? The Blocknumber is signed that gives: 2^31 * 512Bytes Why sign the blocknumber? LBA uses an unsigned 32-bit integer, allowing 2TB, and IIRC SCSI uses an unsigned integer as well (though I can't remember if that one

Re: How does swap work address spacewise?

2002-07-06 Thread Bernd Walter
On Sat, Jul 06, 2002 at 03:43:00PM -0700, Darren Pilgrim wrote: Bernd Walter wrote: On Sat, Jul 06, 2002 at 02:37:02PM -0700, Darren Pilgrim wrote: Bernd Walter wrote: On Fri, Jul 05, 2002 at 05:58:15PM -0700, Darren Pilgrim wrote: If RAM + swap can be more than 4GB, how does

Re: How does swap work address spacewise?

2002-07-06 Thread Bernd Walter
On Sat, Jul 06, 2002 at 04:01:18PM -0700, Terry Lambert wrote: Darren Pilgrim wrote: I thought the limit for filesystems was 2TB? The Blocknumber is signed that gives: 2^31 * 512Bytes Why sign the blocknumber? LBA uses an unsigned 32-bit integer, allowing 2TB, and IIRC SCSI

Re: How does swap work address spacewise?

2002-07-06 Thread Matthew Dillon
:... : : Up to four, so then the theoretical limit for swap is 8TB? : :I hope not, since I have 6 of 'em. 4's just the default. : : : Do these management structures grow as swap grows, or do they only : change as the utilization increases? : :I believe they're pre-allocated, so it's the size

Re: How does swap work address spacewise?

2002-07-06 Thread Matthew Dillon
Negative block numbers are used by UFS to represent the indirect blocks associated with a file, while positive block numbers represent the contents of the file. These are logical block numbers, which are fragment-sized (1K typically). So, 2^31 x 1K = 2TB. Physical block

Re: How does swap work address spacewise?

2002-07-06 Thread Bernd Walter
On Sat, Jul 06, 2002 at 04:42:22PM -0700, Matthew Dillon wrote: Negative block numbers are used by UFS to represent the indirect blocks associated with a file, while positive block numbers represent the contents of the file. I never saw any negative block numbers in on-disc

Re: How does swap work address spacewise?

2002-07-06 Thread Matthew Dillon
: :On Sat, Jul 06, 2002 at 04:42:22PM -0700, Matthew Dillon wrote: : Negative block numbers are used by UFS to represent the indirect blocks : associated with a file, while positive block numbers represent the : contents of the file. : :I never saw any negative block numbers in

Re: How does swap work address spacewise?

2002-07-06 Thread Bernd Walter
On Sun, Jul 07, 2002 at 02:10:19AM +0200, Bernd Walter wrote: On Sat, Jul 06, 2002 at 04:42:22PM -0700, Matthew Dillon wrote: Negative block numbers are used by UFS to represent the indirect blocks associated with a file, while positive block numbers represent the contents of

Re: How does swap work address spacewise?

2002-07-06 Thread Matthew Dillon
: : Physical block numbers are 512-byte sized, with a range of 2^32 : in -stable. This also winds up being 2TB. So increasing the fragment : size does not help in -stable. : : It's a proven fact that there is a 1T limit somewhere which was : explained with physical block

Re: How does swap work address spacewise?

2002-07-06 Thread Ian Dowse
In message [EMAIL PROTECTED], Bernd Walter writes: I never saw any negative block numbers in on-disc structures. Now I wonder if it was just hidden behind macros. What is the reason to handle it that way? Do you have some code reference for homework? These logical block numbers are not stored on

Re: How does swap work address spacewise?

2002-07-06 Thread Bernd Walter
On Sat, Jul 06, 2002 at 05:33:50PM -0700, Matthew Dillon wrote: : :On Sat, Jul 06, 2002 at 04:42:22PM -0700, Matthew Dillon wrote: : Negative block numbers are used by UFS to represent the indirect blocks : associated with a file, while positive block numbers represent the :

Re: How does swap work address spacewise?

2002-07-06 Thread Darren Pilgrim
Matthew Dillon wrote: The nominal limit for swap space is around 14 GB due to limitations in available KVM. There are three major limiting factors in the kernel: * The swap bitmap eats 2 bits per page of swap. The bitmap is sized to handle NSWAP (default 4) x

Re: How does swap work address spacewise?

2002-07-06 Thread Matthew Dillon
:Is NSWAP tied to the NSWAPDEV kernel option, or is it the actual number :of active swap devices? If the prior, is setting NSWAPDEV to the :actual number of swap devices a useful for improving memory usage? Is :NSWAPDEV just a compile-time tunable, or is there a sysctl to do the :same thing?

Re: How does swap work address spacewise?

2002-07-06 Thread Darren Pilgrim
Thanks guys, for explaining the swap system to me. I have a good understanding of how the system works now. I want to particularly thank Matthew Dillon for taking the time to lay down the technical details as he did. Being able to ask a question like this and get it answered so well is what

How does swap work address spacewise?

2002-07-05 Thread Darren Pilgrim
If RAM + swap can be more than 4GB, how does FreeBSD address swap on a 32-bit machine? Does the kernel internally use a wider address space with some kind of translation to 32-bit space for programs and hardware that can't handle 64-bit addresses or does it not map swap into the address space at

Re: How does swap work address spacewise?

2002-07-05 Thread Bernd Walter
On Fri, Jul 05, 2002 at 05:58:15PM -0700, Darren Pilgrim wrote: If RAM + swap can be more than 4GB, how does FreeBSD address swap on a 32-bit machine? Does the kernel internally use a wider address space The same way it does on every partitition: using block numbers. That way you can address

Re: How does swap work address spacewise?

2002-07-05 Thread Terry Lambert
Darren Pilgrim wrote: If RAM + swap can be more than 4GB, how does FreeBSD address swap on a 32-bit machine? Does the kernel internally use a wider address space with some kind of translation to 32-bit space for programs and hardware that can't handle 64-bit addresses or does it not map swap