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)
Wed, Oct 30, 1:18 AM
Unknown Object (File)
Sat, Oct 26, 10:03 PM
Unknown Object (File)
Fri, Oct 25, 1:56 PM
Unknown Object (File)
Tue, Oct 22, 6:58 PM
Unknown Object (File)
Oct 20 2024, 11:28 AM
Unknown Object (File)
Oct 20 2024, 2:35 AM
Unknown Object (File)
Oct 14 2024, 8:02 AM
Unknown Object (File)
Oct 4 2024, 8:36 PM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
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
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 ↗(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.