2006-09-16 11:34:10

by yogeshwar sonawane

[permalink] [raw]
Subject: How much kernel memory is in 64-bit OS ?

Hi all,

We all know that in 32-bit OS, total 4GB memory space is divided in
3(user) + 1(kernel) space.

Similarly, what is the division/scenario in case of 64-bit OS ?

Any reference/explanation will be helpful.

thanks in advance.


Yogeshwar


2006-09-18 00:10:11

by Rik van Riel

[permalink] [raw]
Subject: Re: How much kernel memory is in 64-bit OS ?

yogeshwar sonawane wrote:
> Hi all,
>
> We all know that in 32-bit OS, total 4GB memory space is divided in
> 3(user) + 1(kernel) space.
>
> Similarly, what is the division/scenario in case of 64-bit OS ?

It depends on the architecture.

However, all 64 bit architectures have one thing in common.
There is so much address space available for both kernel and
userspace that we won't have to worry about a shortage for a
very long time.

Sure, people said that too when going from 16 bits to 32 bits,
but that was only a factor 2^16 difference. This time it's the
square of the previous difference.

--
What is important? What you want to be true, or what is true?

2006-09-18 08:31:24

by Andi Kleen

[permalink] [raw]
Subject: Re: How much kernel memory is in 64-bit OS ?

Rik van Riel <[email protected]> writes:
>
> However, all 64 bit architectures have one thing in common.
> There is so much address space available for both kernel and
> userspace that we won't have to worry about a shortage for a
> very long time.

Nearly.

The x86-64 port started off with a 512GB user space VM limit, and then
that later was extended with 4 level page tables because it wasn't
quite enough for everybody.

-Andi

2006-09-18 08:35:56

by Jan Engelhardt

[permalink] [raw]
Subject: Re: How much kernel memory is in 64-bit OS ?

>
> It depends on the architecture.
>
> However, all 64 bit architectures have one thing in common.
> There is so much address space available for both kernel and
> userspace that we won't have to worry about a shortage for a
> very long time.
>
> Sure, people said that too when going from 16 bits to 32 bits,
> but that was only a factor 2^16 difference. This time it's the
> square of the previous difference.

Not quite the square :)


Jan Engelhardt
--

2006-09-18 09:51:58

by yogeshwar sonawane

[permalink] [raw]
Subject: Re: How much kernel memory is in 64-bit OS ?

On 9/16/06, yogeshwar sonawane <[email protected]> wrote:
> Hi all,
>
> We all know that in 32-bit OS, total 4GB memory space is divided in
> 3(user) + 1(kernel) space.
>
> Similarly, what is the division/scenario in case of 64-bit OS ?
>
> Any reference/explanation will be helpful.
>
> thanks in advance.
>
>
> Yogeshwar
>

On similar lines, some time back, i read that, to accomodate large
physical memory ,
the 3G/1G layout is modified to have 4G/4G partition. But if somebody
can focus the light on following things, it will be helpful.
1) what was the requirement of 4G/4G layout ?
2) how it is managed ?
3) how HIGH_MEMORY concept is related here.

Thanks in advance,
Yogeshwar

2006-09-18 12:30:14

by Rik van Riel

[permalink] [raw]
Subject: Re: How much kernel memory is in 64-bit OS ?

Jan Engelhardt wrote:
>> It depends on the architecture.
>>
>> However, all 64 bit architectures have one thing in common.
>> There is so much address space available for both kernel and
>> userspace that we won't have to worry about a shortage for a
>> very long time.
>>
>> Sure, people said that too when going from 16 bits to 32 bits,
>> but that was only a factor 2^16 difference. This time it's the
>> square of the previous difference.
>
> Not quite the square :)

2^32 is the square of 2^16 :)

--
What is important? What you want to be true, or what is true?

2006-09-18 12:35:26

by Jan Engelhardt

[permalink] [raw]
Subject: Re: How much kernel memory is in 64-bit OS ?


>> > Sure, people said that too when going from 16 bits to 32 bits,
>> > but that was only a factor 2^16 difference. This time it's the
>> > square of the previous difference.
>>
>> Not quite the square :)
>
> 2^32 is the square of 2^16 :)

Going from 32 to 64: (2^64 - 2^32)
Going from 16 to 32: (2^32 - 2^16)

As mentioned above, "the square of the previos" [16 to 32] "difference".
Call me nitpicky, but:

(2^32 - 2^16)^2 != (2^64 - 2^32)

>--
> What is important? What you want to be true, or what is true?


Jan Engelhardt
--

2006-09-18 13:31:06

by Kyle Moffett

[permalink] [raw]
Subject: Re: How much kernel memory is in 64-bit OS ?

On Sep 18, 2006, at 08:34:25, Jan Engelhardt wrote:
>>>> Sure, people said that too when going from 16 bits to 32 bits,
>>>> but that was only a factor 2^16 difference. This time it's the
>>>> square of the previous difference.
>>>
>>> Not quite the square :)
>>
>> 2^32 is the square of 2^16 :)
>
> As mentioned above, "the square of the previos" [16 to 32]
> "difference". Call me nitpicky, but:
>
> (2^32 - 2^16)^2 != (2^64 - 2^32)

Well into the nitpicking territory... I think you missed where he
said "factor 2^16 difference". So these:

> Going from 32 to 64: (2^64 - 2^32)
> Going from 16 to 32: (2^32 - 2^16)

Should actually be these:

Going from 32 to 64: (2^64 / 2^32)
Going from 16 to 32: (2^32 / 2^16)

And:

(2^32 / 2^16)^2 = (2^64 / 2^32) => (2^16)^2 = (2^32)

Cheers,
Kyle Moffett

2006-09-18 13:43:01

by Helge Hafting

[permalink] [raw]
Subject: Re: How much kernel memory is in 64-bit OS ?

yogeshwar sonawane wrote:
> On 9/16/06, yogeshwar sonawane <[email protected]> wrote:
>> Hi all,
>>
>> We all know that in 32-bit OS, total 4GB memory space is divided in
>> 3(user) + 1(kernel) space.
>>
>> Similarly, what is the division/scenario in case of 64-bit OS ?
>>
>> Any reference/explanation will be helpful.
>>
>> thanks in advance.
>>
>>
>> Yogeshwar
>>
>
> On similar lines, some time back, i read that, to accomodate large
> physical memory ,
> the 3G/1G layout is modified to have 4G/4G partition. But if somebody
> can focus the light on following things, it will be helpful.
> 1) what was the requirement of 4G/4G layout ?
It offers more memory than 3G/1G. This is an improvement, so of
course it is the chosen way. It was not required - you sure can use
a 3G/1G split on a 64-bit processor - but why introduce an artifical
limitation?

The requirement for using a 4G/4G split is to have a processor
that support 64-bit adressing as well as 32-bit backward compatibility.
> 2) how it is managed ?
The kernel runs in 64-bit mode, offering the 4G/4G stuff for 32-bit
processes.

> 3) how HIGH_MEMORY concept is related here.
high memory is a quirky way of supporting more than 4G on a 32-bit
processor. A 64-bit processor support much more than 4G, so no need
for tricks that work around the limitations of 32-bit processors.


Helge Hafting

2006-09-18 17:22:55

by Andi Kleen

[permalink] [raw]
Subject: Re: How much kernel memory is in 64-bit OS ?

Helge Hafting <[email protected]> writes:

> The requirement for using a 4G/4G split is to have a processor
> that support 64-bit adressing as well as 32-bit backward compatibility.

s/64/36/. But it's actually not true: 4/4 works on 32bit phys non PAE
system too (iirc Fedora forced it for some time even on unsuspecting
P-M/VIA C3/586 users who only do 32bit).

> > 2) how it is managed ?
> The kernel runs in 64-bit mode, offering the 4G/4G stuff for 32-bit
> processes.

No.

>
> > 3) how HIGH_MEMORY concept is related here.
> high memory is a quirky way of supporting more than 4G on a 32-bit

More than ~900MB with a default split.

-Andi