Bug 269726 - kern.msgbufsize=4587520 in loader.conf, kernel never boots
Summary: kern.msgbufsize=4587520 in loader.conf, kernel never boots
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: CURRENT
Hardware: arm64 Any
: --- Affects Only Me
Assignee: freebsd-arm (Nobody)
URL: https://reviews.freebsd.org/D42734
Keywords:
: 285678 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-02-21 00:38 UTC by Bjoern A. Zeeb
Modified: 2025-11-18 22:05 UTC (History)
4 users (show)

See Also:
linimon: mfc-stable14?
linimon: mfc-stable13?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bjoern A. Zeeb freebsd_committer freebsd_triage 2023-02-21 00:38:51 UTC
Hi,

set kern.msgbufsize=4587520 in loader.conf on an arm64 system with 16G of RAM and after boot -v no kernel ever showed up.

This is loader.efi from a few weeks ago I assume.  I can dig into anything if needed.
Comment 1 Warner Losh freebsd_committer freebsd_triage 2023-02-21 06:59:11 UTC
just out of curiosity, does 1MB or 512k have this same issue?
Comment 2 Bjoern A. Zeeb freebsd_committer freebsd_triage 2023-02-21 10:01:28 UTC
1M does not.  That's my normal default :)  I was wondering if PAGE_SIZE had anything to do with it but haven't tried something just below that.  Should I?
Comment 3 Andrew Turner freebsd_committer freebsd_triage 2023-02-21 15:16:57 UTC
We only allocate a small virtual address range for early kernel use. The msgbuf is allocated from this so when larger is overflowing this allocation. We could probably use the new pmap bootstrap code to handle this, although it's not something I've planned on doing.
Comment 4 Bjoern A. Zeeb freebsd_committer freebsd_triage 2024-08-27 19:36:34 UTC
@andrew that Review went in and this problem got fixed or is this still all open?
Comment 5 Andrew Turner freebsd_committer freebsd_triage 2025-04-22 15:56:51 UTC
*** Bug 285678 has been marked as a duplicate of this bug. ***
Comment 6 commit-hook freebsd_committer freebsd_triage 2025-04-22 16:10:46 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=ccaf78c962e85630298f068931862a3595e9bbdf

commit ccaf78c962e85630298f068931862a3595e9bbdf
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2025-04-22 15:59:25 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2025-04-22 16:08:57 +0000

    arm64: Move cpu0 dpcpu and msgbuf to the DMAP

    When these are allocated we already have the DMAP region mapped. Search
    for the largest region and use this to hold these.

    Pr:             269726
    Reviewed by:    markj
    Sponsored by:   Arm Ltd
    Differential Revision:  https://reviews.freebsd.org/D42734

 sys/arm64/arm64/pmap.c | 40 ++++++++++++++++++++++++++++++----------
 1 file changed, 30 insertions(+), 10 deletions(-)
Comment 7 Bjoern A. Zeeb freebsd_committer freebsd_triage 2025-04-22 17:48:42 UTC
Thank you!  I'll start a build once other build breakage is gone.
Comment 8 Mark Linimon freebsd_committer freebsd_triage 2025-11-13 00:38:06 UTC
^Triage: it has been several months.  Is there anything further to do here?
Comment 9 Bjoern A. Zeeb freebsd_committer freebsd_triage 2025-11-13 01:27:41 UTC
(In reply to Mark Linimon from comment #8)

I cannot remember;  I'll re-check the next week.
Comment 10 Bjoern A. Zeeb freebsd_committer freebsd_triage 2025-11-18 22:05:55 UTC
(In reply to Bjoern A. Zeeb from comment #9)

Seems to work fine and probably has as I found a 4M buffer in another loader.conf for that machine.

Thanks Andy!