Page MenuHomeFreeBSD

Add malloc_domainset_aligned(9) and use it in x86 busdma bounce.
ClosedPublic

Authored by kib on Jan 14 2021, 4:21 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 19 2024, 1:47 PM
Unknown Object (File)
Feb 19 2024, 1:47 PM
Unknown Object (File)
Feb 19 2024, 1:47 PM
Unknown Object (File)
Feb 19 2024, 1:47 PM
Unknown Object (File)
Sep 19 2023, 11:22 AM
Unknown Object (File)
Aug 5 2023, 7:00 AM
Unknown Object (File)
Jun 30 2023, 1:12 AM
Unknown Object (File)
May 27 2023, 7:58 AM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

sys/x86/x86/busdma_bounce.c
450โ€“451

We'll need a check that the alignment isn't too large for malloc_domainset_aligned.

sys/x86/x86/busdma_bounce.c
450โ€“451

There is KASSERT() in malloc_aligned, and I really do not expect small allocations (less than page size) to request large alignment.

Another issue is that there is no way to report the alignment limits, except perhaps adding a function to return just the limit.

markj added inline comments.
sys/kern/kern_malloc.c
776

I would add an assertion that the result really is correctly aligned.

This revision is now accepted and ready to land.Jan 14 2021, 3:44 PM
kib marked an inline comment as done.

Improve asserts.

This revision now requires review to proceed.Jan 14 2021, 10:12 PM
This revision is now accepted and ready to land.Jan 15 2021, 6:31 AM

Assert that malloc result is single-page. Otherwise it cannot be loaded.

This revision now requires review to proceed.Jan 15 2021, 8:47 AM
sys/x86/x86/busdma_bounce.c
437

This comment needs to be updated.

kib marked an inline comment as done.

Update comment.

This revision is now accepted and ready to land.Jan 15 2021, 9:48 AM

I tested D28147.82306.diff on i386 for 8 hours and on amd64 for 47 hours. No problems seen.