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.

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

sys/x86/x86/busdma_bounce.c
450 ↗(On Diff #82246)

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

sys/x86/x86/busdma_bounce.c
450 ↗(On Diff #82246)

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
775

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 ↗(On Diff #82246)

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.