atom feed60 messages in org.freebsd.freebsd-archRe: using mem above 4Gb was: swapon s...
FromSent OnAttachments
Mikhail TeterinOct 7, 2002 1:30 pm 
Peter WemmOct 7, 2002 2:25 pm 
Mikhail TeterinOct 7, 2002 2:34 pm 
Terry LambertOct 7, 2002 2:54 pm 
Peter WemmOct 7, 2002 2:58 pm 
Terry LambertOct 7, 2002 3:02 pm 
Wilko BulteOct 7, 2002 3:06 pm 
Terry LambertOct 7, 2002 3:07 pm 
Terry LambertOct 7, 2002 3:12 pm 
Terry LambertOct 7, 2002 3:48 pm 
Matthew DillonOct 7, 2002 5:16 pm 
"Vladimir B. " GrebenschikovOct 8, 2002 4:00 am 
Terry LambertOct 8, 2002 8:17 am 
Terry LambertOct 8, 2002 8:40 am 
Terry LambertOct 8, 2002 8:46 am 
Mikhail TeterinOct 8, 2002 8:50 am 
"Vladimir B. " GrebenschikovOct 8, 2002 9:23 am 
Nate LawsonOct 8, 2002 12:10 pm 
"Vladimir B. " GrebenschikovOct 8, 2002 12:39 pm 
Matthew DillonOct 8, 2002 1:14 pm 
"Vladimir B. " GrebenschikovOct 8, 2002 1:30 pm 
Matthew DillonOct 8, 2002 1:51 pm 
Terry LambertOct 8, 2002 3:33 pm 
Wes PetersOct 9, 2002 4:57 pm 
Wes PetersOct 9, 2002 4:59 pm 
Terry LambertOct 9, 2002 5:13 pm 
Terry LambertOct 9, 2002 5:20 pm 
Cy Schubert - CITS Open Systems GroupOct 11, 2002 12:07 pm 
Wes PetersOct 12, 2002 12:04 am 
Wes PetersOct 12, 2002 12:25 am 
Christoph HellwigOct 12, 2002 5:52 am 
Nathan HawkinsOct 12, 2002 7:20 am 
M. Warner LoshOct 12, 2002 2:05 pm 
Bernd WalterOct 13, 2002 3:35 am 
Terry LambertOct 13, 2002 4:10 am 
M. Warner LoshOct 13, 2002 5:06 am 
M. Warner LoshOct 13, 2002 5:08 am 
Christoph HellwigOct 13, 2002 5:30 am 
Terry LambertOct 13, 2002 10:59 am 
Terry LambertOct 13, 2002 11:00 am 
M. Warner LoshOct 13, 2002 11:08 am 
Bernd WalterOct 13, 2002 11:16 am 
Terry LambertOct 13, 2002 11:54 am 
Matthew DillonOct 13, 2002 12:00 pm 
Terry LambertOct 13, 2002 12:04 pm 
Bernd WalterOct 13, 2002 12:35 pm 
Martin NilssonOct 13, 2002 3:04 pm 
Wes PetersOct 13, 2002 7:11 pm 
M. Warner LoshOct 13, 2002 7:14 pm 
Wes PetersOct 13, 2002 7:24 pm 
Wes PetersOct 13, 2002 7:25 pm 
Wes PetersOct 13, 2002 7:30 pm 
Terry LambertOct 13, 2002 8:09 pm 
Peter WemmOct 13, 2002 11:34 pm 
Terry LambertOct 13, 2002 11:50 pm 
Christoph HellwigOct 14, 2002 7:29 am 
Christoph HellwigOct 14, 2002 8:37 am 
Terry LambertOct 14, 2002 11:28 am 
Peter WemmOct 14, 2002 6:14 pm 
Andrew GallatinOct 15, 2002 8:51 am 
Subject:Re: using mem above 4Gb was: swapon some regular file
From:Terry Lambert (tlam@mindspring.com)
Date:Oct 8, 2002 8:17:20 am
List:org.freebsd.freebsd-arch

"Vladimir B. Grebenschikov" wrote:

May be we need add new type to md device, like "highmem", to access memory above 4G as memory disk, and as consequence use it as swap-device or as fast /tmp/ partition or whatever ?

In this case we will be able to use more than 3Gb of RAM.

We can use 4G now. But:

KVA + UVA + window <= 4G

...so by adding a window in which to access the extra memory above 4G, you actually *reduce* the amount of RAM available to either each process, or the kernel, or both.

A RAM-disk is probably not worth doing this; the place most people are bumping their head is the UVA (data space for the process itself) or KVA (data space for mbufs, mappings for pages, etc.).

For example, if you have 4G of RAM, to support a large number of network connections, you have to spend ~2G on mbufs, which means spending 1G on mappings and other kernel structures, leaving only 1G for UVA.

That means that, in order to get your RAM disk, you have to either firther reduce the size of your server processes, or you have to reduce the number of connections you will be able to support simultaneously.

Example:

64k simultaneous connections * 32k window per connection = 2G of mbufs

...say you overcommit this memory by a factor of 4; you are still only talking a quarter of a million connections.

If you hack all your kernel allocations to use the minimum amount possible, and pare down your structures to get rid of kevent pointers that you don't use, and other things you don't use, you can steal some of the 1G KVA for more mbufs.

Then, if you hack the TCP stack window management code rather signficantly (e.g. drop the average window to 4k), then you can push 1,000,000 connections.

That leaves you about 512b of context per connection in the user space applicaition.

The best I've ever done is 1.6 million simultaneous connections; to do that, I had to drop space out of a lot of structures (64 bytes for 1,000,000 connections is 64M of RAM -- not insignificant).

So whatever connections you are getting now... halve that, or less, to get a window for your RAM disk (you will need KVA for mappings for all the memory that *can* be in the window, etc.).

It's not really worth using it directly.

On the other hand, if you could allocate pools of memory for per processor use, you basically gain most of that overhead back -- though, without TCP/IP stack changes and interrupt processing changes, you can't use the regained memory for, e.g., mbufs, because the way things stand now, mbufs have to be visible at:

o DMA o IRQ o NETISR o Application

...and you can't guarantee a nice clean division, because you don't route interrupts to a particular CPU, or have connections to sockets in a particular CPU's address space, or have your applications running on a particular CPU, so that the CPU can have a seperate address space, so you don't have to worry about migration, etc..

So for an extremely high capacity box, you will have to do tricks, like logically splitting the box into seperate virtual machines, and seperating out the code path from the network card, all the way to the application.

Just like we were discussing earlier.

-- Terry

To Unsubscribe: send mail to majo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message