Page MenuHomeFreeBSD

loader: Simplify build a little
ClosedPublic

Authored by imp on Feb 15 2024, 12:07 AM.
Tags
None
Referenced Files
F81335187: D43914.id.diff
Sun, Apr 14, 5:40 PM
Unknown Object (File)
Mon, Apr 8, 10:37 PM
Unknown Object (File)
Thu, Mar 21, 3:45 AM
Unknown Object (File)
Feb 16 2024, 10:43 PM
Unknown Object (File)
Feb 16 2024, 7:40 AM
Subscribers

Details

Summary

Confine -DDISK_DEBUG to biosdisc.c, the only file it affects.
Use modern variable arrays instead of alloca and add a sanity
size minimum for biospnp nodes. These nodes are tiny enough that
we needn't do a malloc/free pair: the stack is fine.

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

alloca or local variable does allocate from stack (which may be in collision with bss), the opther option there to get low memory allocation is to use bio_alloc() and bio_free().

This revision is now accepted and ready to land.Feb 15 2024, 8:21 AM

alloca or local variable does allocate from stack (which may be in collision with bss), the opther option there to get low memory allocation is to use bio_alloc() and bio_free().

Pnp nodes are like 32 bytes... and must be in the lower MB.

In D43914#1001826, @imp wrote:

alloca or local variable does allocate from stack (which may be in collision with bss), the opther option there to get low memory allocation is to use bio_alloc() and bio_free().

Pnp nodes are like 32 bytes... and must be in the lower MB.

Yep, same for bio_alloc - we currently do use it for disk io bounce buffer allocations.

This revision was automatically updated to reflect the committed changes.