Kernel/Userland Mem-Space Tuning (1/3 on IA32)

Ask a Question related to FreeBSD, Design and Development.

  1. #1

    Default Kernel/Userland Mem-Space Tuning (1/3 on IA32)

    Hello.
    I read about address space division of recent operating systems like
    Linux and Windows XP.
    In both cases, the whole address space of the 32 or 64 Bit system is
    divided into halfes, 2GB for
    kernel, 2 GB for process(es) (speaking in 32Bit words). The same in
    64bit systems like AMD64.
    Those who happily utilize an AMD64 based machine are not (yet) involved
    by this problem,
    but on recent 32 Bit architectures someone can run out of process space,
    like me! Some
    geophysical modelling software needs more than the allowed 2GB address
    space and therefore
    I would like to ask whether FreeBSD (my preferred OS) has a 'knob' to
    change the kernel/userland parity
    of the address space like it is done in Windows with a special knob at
    boot time (/W3GB I think, but I'm not
    sure about the exakt syntax but I know someone can change the half by
    half parity towards 1 to 3 in
    XP). I'm not sure whether FreeBSD divides kernel/userland address space
    this way, I know Linux and
    Windows does and on Windows we changed this (not yet on Linux and not
    yet on our FreeBSD machines
    (OS version >5.0, mostly FreeBSD 5.3-R or 5.4-PRERELEASE).

    Any help is appreciated.

    Thanks, Oliver

    O. Hartmann Guest

  2. Similar Questions and Discussions

    1. Userland Frontier Interoperability
      Newbie question here, so please bear with me as I'm sure this has cropped up before. I'm trying to develop a Proxy Client than connects to a...
    2. [PHP-DEV] userland macros
      Is possible to implement userland macros in a PHP extension or it can only be implemented in the core? I know that macros is a preprocessor task...
    3. kernel-source versus kernel-patch
      Hi, The description of the kernel-source-2.4.21 package says "Linux kernel source for version 2.4.21 with Debian patches". But, there is another...
    4. Access kernel mem from user space
      Hello all: Hang in there, I am a EE first and a Linux guy second, but I've had to do some Solaris driver development and would like a hand. I...
    5. IA32 *NIX ABI reference?
      Is there a place one could find the ABIs for the various UNIX and UNIX-like operating systems like *BSD and Linux respectively? I tried Googling...
  3. #2

    Default Re: Kernel/Userland Mem-Space Tuning (1/3 on IA32)

    > Hello.
    > I read about address space division of recent operating systems like
    > Linux and Windows XP.
    > In both cases, the whole address space of the 32 or 64 Bit system is
    > divided into halfes, 2GB for
    > kernel, 2 GB for process(es) (speaking in 32Bit words). The same in
    > 64bit systems like AMD64.
    > Those who happily utilize an AMD64 based machine are not (yet) involved
    > by this problem,
    > but on recent 32 Bit architectures someone can run out of process space,
    > like me! Some
    > geophysical modelling software needs more than the allowed 2GB address
    > space and therefore
    > I would like to ask whether FreeBSD (my preferred OS) has a 'knob' to
    > change the kernel/userland parity
    > of the address space like it is done in Windows with a special knob at
    > boot time (/W3GB I think, but I'm not
    > sure about the exakt syntax but I know someone can change the half by
    > half parity towards 1 to 3 in
    > XP). I'm not sure whether FreeBSD divides kernel/userland address space
    > this way, I know Linux and
    > Windows does and on Windows we changed this (not yet on Linux and not
    > yet on our FreeBSD machines
    > (OS version >5.0, mostly FreeBSD 5.3-R or 5.4-PRERELEASE).
    >
    > Any help is appreciated.
    FreeBSD divides the 32bit virtual address space with 1GB for the kernel
    and 3GB for user processes. This can be changed with some kernel compile-
    time constants (primarily KVA_PAGES, however NKPT may also need to be
    increased if the kernel address space is increased).

    -DG

    David G. Lawrence
    President
    Download Technologies, Inc. - [url]http://www.downloadtech.com[/url] - (866) 399 8500
    TeraSolutions, Inc. - [url]http://www.terasolutions.com[/url] - (888) 346 7175
    The FreeBSD Project - [url]http://www.freebsd.org[/url]
    Pave the road of life with opportunities.
    David G. Lawrence Guest

  4. #3

    Default Re: Kernel/Userland Mem-Space Tuning (1/3 on IA32)

    David G. Lawrence wrote:
    >>Hello.
    >>I read about address space division of recent operating systems like
    >>Linux and Windows XP.
    >>In both cases, the whole address space of the 32 or 64 Bit system is
    >>divided into halfes, 2GB for
    >>kernel, 2 GB for process(es) (speaking in 32Bit words). The same in
    >>64bit systems like AMD64.
    >>Those who happily utilize an AMD64 based machine are not (yet) involved
    >>by this problem,
    >>but on recent 32 Bit architectures someone can run out of process space,
    >>like me! Some
    >>geophysical modelling software needs more than the allowed 2GB address
    >>space and therefore
    >>I would like to ask whether FreeBSD (my preferred OS) has a 'knob' to
    >>change the kernel/userland parity
    >>of the address space like it is done in Windows with a special knob at
    >>boot time (/W3GB I think, but I'm not
    >>sure about the exakt syntax but I know someone can change the half by
    >>half parity towards 1 to 3 in
    >>XP). I'm not sure whether FreeBSD divides kernel/userland address space
    >>this way, I know Linux and
    >>Windows does and on Windows we changed this (not yet on Linux and not
    >>yet on our FreeBSD machines
    >>(OS version >5.0, mostly FreeBSD 5.3-R or 5.4-PRERELEASE).
    >>
    >>Any help is appreciated.
    >>
    >>
    >
    > FreeBSD divides the 32bit virtual address space with 1GB for the kernel
    >and 3GB for user processes. This can be changed with some kernel compile-
    >time constants (primarily KVA_PAGES, however NKPT may also need to be
    >increased if the kernel address space is increased).
    >
    >-DG
    >
    >David G. Lawrence
    >President
    >Download Technologies, Inc. - [url]http://www.downloadtech.com[/url] - (866) 399 8500
    >TeraSolutions, Inc. - [url]http://www.terasolutions.com[/url] - (888) 346 7175
    >The FreeBSD Project - [url]http://www.freebsd.org[/url]
    >Pave the road of life with opportunities.
    >
    >
    Dear David.
    Thank you very much.
    I assumed FreeBSD do the same like Linux, but don't obviously.

    I found a lot of tweaking kernel parameters,
    KVA_PAGES
    VM_KMEM_SIZE_SCALE
    VM_KMEM_SIZE_MAX
    VM_KMEM_SIZE

    Reading some comments in sys/kern/kern_malloc.c make be a bit confused,
    I do not know much about kernel's interna.

    It is nice to hear that FreeBSD do a 1/3 division, I expected a 2/2
    division like Linux does. So no need for anything changing.

    Can someone please explain NKPT? I'm simply curious, didn't found a
    satisfying answer via google, but a lot of source code with this in ...

    Thanks

    Oliver

    O. Hartmann Guest

  5. #4

    Default Re: Kernel/Userland Mem-Space Tuning (1/3 on IA32)

    > >>sure about the exakt syntax but I know someone can change the half by
    > >>half parity towards 1 to 3 in
    > >>XP). I'm not sure whether FreeBSD divides kernel/userland address space
    > >>this way, I know Linux and
    > >>Windows does and on Windows we changed this (not yet on Linux and not
    > >>yet on our FreeBSD machines
    > >>(OS version >5.0, mostly FreeBSD 5.3-R or 5.4-PRERELEASE).
    > >>
    > >>Any help is appreciated.
    > >>
    > >>
    > >
    > > FreeBSD divides the 32bit virtual address space with 1GB for the kernel
    > >and 3GB for user processes. This can be changed with some kernel compile-
    > >time constants (primarily KVA_PAGES, however NKPT may also need to be
    > >increased if the kernel address space is increased).
    ....
    > Dear David.
    > Thank you very much.
    > I assumed FreeBSD do the same like Linux, but don't obviously.
    >
    > I found a lot of tweaking kernel parameters,
    > KVA_PAGES
    > VM_KMEM_SIZE_SCALE
    > VM_KMEM_SIZE_MAX
    > VM_KMEM_SIZE
    The last three are not related to the address space division and you
    should not change those under normal circumstance.
    > Reading some comments in sys/kern/kern_malloc.c make be a bit confused,
    > I do not know much about kernel's interna.
    >
    > It is nice to hear that FreeBSD do a 1/3 division, I expected a 2/2
    > division like Linux does. So no need for anything changing.
    It's a 1:4 ratio.
    > Can someone please explain NKPT? I'm simply curious, didn't found a
    > satisfying answer via google, but a lot of source code with this in ...
    It's the number of page table pages that are assigned to the kernel
    address space. Each page maps 4MB, so 256 (the default) provides for
    1GB of kernel virtual address space, leaving 3GB for user space.

    -DG

    David G. Lawrence
    President
    Download Technologies, Inc. - [url]http://www.downloadtech.com[/url] - (866) 399 8500
    TeraSolutions, Inc. - [url]http://www.terasolutions.com[/url] - (888) 346 7175
    The FreeBSD Project - [url]http://www.freebsd.org[/url]
    Pave the road of life with opportunities.
    David G. Lawrence Guest

  6. #5

    Default Re: Kernel/Userland Mem-Space Tuning (1/3 on IA32)

    David G. Lawrence wrote:
    >>>>sure about the exakt syntax but I know someone can change the half by
    >>>>half parity towards 1 to 3 in
    >>>>XP). I'm not sure whether FreeBSD divides kernel/userland address space
    >>>>this way, I know Linux and
    >>>>Windows does and on Windows we changed this (not yet on Linux and not
    >>>>yet on our FreeBSD machines
    >>>>(OS version >5.0, mostly FreeBSD 5.3-R or 5.4-PRERELEASE).
    >>>>
    >>>>Any help is appreciated.
    >>>>
    >>>>
    >>>>
    >>>>
    >>> FreeBSD divides the 32bit virtual address space with 1GB for the kernel
    >>>and 3GB for user processes. This can be changed with some kernel compile-
    >>>time constants (primarily KVA_PAGES, however NKPT may also need to be
    >>>increased if the kernel address space is increased).
    >>>
    >>>
    >...
    >
    >
    >>Dear David.
    >>Thank you very much.
    >>I assumed FreeBSD do the same like Linux, but don't obviously.
    >>
    >>I found a lot of tweaking kernel parameters,
    >>KVA_PAGES
    >>VM_KMEM_SIZE_SCALE
    >>VM_KMEM_SIZE_MAX
    >>VM_KMEM_SIZE
    >>
    >>
    >
    > The last three are not related to the address space division and you
    >should not change those under normal circumstance.
    >
    >
    >
    >>Reading some comments in sys/kern/kern_malloc.c make be a bit confused,
    >>I do not know much about kernel's interna.
    >>
    >>It is nice to hear that FreeBSD do a 1/3 division, I expected a 2/2
    >>division like Linux does. So no need for anything changing.
    >>
    >>
    >
    > It's a 1:4 ratio.
    >
    >
    Sorry, I meant 1GB kernel, 3GB userland or 2GB kernel, 2GB userland, not
    the divisor or
    mathematical ratio, sorry for this unprecise.
    >
    >
    >
    >>Can someone please explain NKPT? I'm simply curious, didn't found a
    >>satisfying answer via google, but a lot of source code with this in ...
    >>
    >>
    >
    > It's the number of page table pages that are assigned to the kernel
    >address space. Each page maps 4MB, so 256 (the default) provides for
    >1GB of kernel virtual address space, leaving 3GB for user space.
    >
    >
    Many thanks, that helped a lot!

    Oliver

    O. Hartmann Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139