Kernel size beyond 16 MB on amd64

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Kernel size beyond 16 MB on amd64

Franco Fichtner-2
Hi,

With regard to a commit[1] by Theo in 2013, several questions
in the years before and a partial lift of the limitation on
i386 a while back (2015?) I'd like to ask what the future plans
are for OpenBSD.

Peeking at NetBSD, where the amd64 was bootstrapped, they are at
48 MB kernel size at the moment.

Will a future OpenBSD release increase it?

What can we do to help?


Cheers,
Franco

--
[1] https://github.com/openbsd/src/commit/453010f2034

Reply | Threaded
Open this post in threaded view
|

Re: Kernel size beyond 16 MB on amd64

Mike Larkin
On Mon, Mar 12, 2018 at 05:50:42PM +0100, Franco Fichtner wrote:

> Hi,
>
> With regard to a commit[1] by Theo in 2013, several questions
> in the years before and a partial lift of the limitation on
> i386 a while back (2015?) I'd like to ask what the future plans
> are for OpenBSD.
>
> Peeking at NetBSD, where the amd64 was bootstrapped, they are at
> 48 MB kernel size at the moment.
>
> Will a future OpenBSD release increase it?
>
> What can we do to help?
>
>
> Cheers,
> Franco
>
> --
> [1] https://github.com/openbsd/src/commit/453010f2034
>

That commit was only to move the kernel phys load address to 16MB.

If the kernel should grow to a point where we run past some limit, we'll fix
it. Right now, bsd.gdb kernels are > 50MB and load fine.

-ml

Reply | Threaded
Open this post in threaded view
|

Re: Kernel size beyond 16 MB on amd64

Ted Unangst-6
In reply to this post by Franco Fichtner-2
Franco Fichtner wrote:
> What can we do to help?

Write smaller code...

Reply | Threaded
Open this post in threaded view
|

Re: Kernel size beyond 16 MB on amd64

Franco Fichtner-2

> On 13. Mar 2018, at 4:04 PM, Ted Unangst <[hidden email]> wrote:
>
> Franco Fichtner wrote:
>> What can we do to help?
>
> Write smaller code...

Fair enough.  ;)

On a more serious note, I'm referring to:

https://marc.info/?l=openbsd-tech&m=112152576800634&w=2

"Immediate reboots" is what can still be reproduced
much under the size that bsd.gdb may offer.

i386 copes better with this since 2015.  It's odd, so
I thought I'd ask.


Cheers,
Franco

Reply | Threaded
Open this post in threaded view
|

Re: Kernel size beyond 16 MB on amd64

Mike Larkin
On Tue, Mar 13, 2018 at 04:15:23PM +0100, Franco Fichtner wrote:

>
> > On 13. Mar 2018, at 4:04 PM, Ted Unangst <[hidden email]> wrote:
> >
> > Franco Fichtner wrote:
> >> What can we do to help?
> >
> > Write smaller code...
>
> Fair enough.  ;)
>
> On a more serious note, I'm referring to:
>
> https://marc.info/?l=openbsd-tech&m=112152576800634&w=2
>
> "Immediate reboots" is what can still be reproduced
> much under the size that bsd.gdb may offer.
>
> i386 copes better with this since 2015.  It's odd, so
> I thought I'd ask.
>
>
> Cheers,
> Franco
>

I don't know what you're asking. The thread you linked to is more than 12 years
old and concerns OpenBSD 3.7.

-ml

Reply | Threaded
Open this post in threaded view
|

Re: Kernel size beyond 16 MB on amd64

Stuart Henderson
In reply to this post by Franco Fichtner-2
On 2018/03/12 17:50, Franco Fichtner wrote:

> Hi,
>
> With regard to a commit[1] by Theo in 2013, several questions
> in the years before and a partial lift of the limitation on
> i386 a while back (2015?) I'd like to ask what the future plans
> are for OpenBSD.
>
> Peeking at NetBSD, where the amd64 was bootstrapped, they are at
> 48 MB kernel size at the moment.
>
> Will a future OpenBSD release increase it?
>
> What can we do to help?
>
>
> Cheers,
> Franco
>
> --
> [1] https://github.com/openbsd/src/commit/453010f2034
>

I guess you'd be looking at this for ramdisks, if so, see the vnconfig
method used by flashrd instead.

https://github.com/yellowman/flashrd

Reply | Threaded
Open this post in threaded view
|

Re: Kernel size beyond 16 MB on amd64

Franco Fichtner-2
Hi Stuart et al.,

Sorry for the delay.  Meanwhile, I've been reproducing the
issue on 6.3 by adding device rd and increasing MINIROOTSIZE
to grow the non-gdb amd64 kernel beyond 16 MB.  The kernel
simply fails to boot.

> If the kernel should grow to a point where we run past some limit, we'll fix
> it. Right now, bsd.gdb kernels are > 50MB and load fine.

While it's all true that there are no problems with bsd.gdb,
the fact of the matter is also that even if such a bloated
kernel as mentioned in the first paragraph is stripped below
the 16 MB point it fails to boot.  It even fails to boot if
it is compressed down to a few MB, which means it has nothing
to do with the actual size, but rather how its internal objects
are addressed.

The kicker is that during a 5.8 -> 5.9 transition i386 stopped
behaving as bad as amd64 in this regard so that there is a i386
kernel that performs better than amd64 one is hardly growing as
fast as the other.

To make a long story short, the answer actually was in the
commit mentioned in the original message[1] as NKL2_KIMG_ENTRIES
is the limiting factor here killing kernel boot when embedded
total object size grows beyond a certain 16 MB point.  Changing
this to e.g. 32 allows kernels to boot as long as they in turn
are not too big to hit the next barrier.

> That commit was only to move the kernel phys load address to 16MB.

That's not true, Mike, and I assume you already knew it.  ;)

Feel free to ignore this or take it as a friendly reminder that
not everything is "write smaller code" or "[kernels] load fine".


Cheers,
Franco

[1] https://github.com/openbsd/src/commit/453010f2034