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
F83602786: D28147.id82295.diff
Sun, May 12, 1:28 PM
F83602783: D28147.id82306.diff
Sun, May 12, 1:28 PM
F83602782: D28147.id82305.diff
Sun, May 12, 1:28 PM
F83602780: D28147.id82304.diff
Sun, May 12, 1:28 PM
F83602753: D28147.id.diff
Sun, May 12, 1:28 PM
F83602751: D28147.id82246.diff
Sun, May 12, 1:28 PM
F83602749: D28147.id82427.diff
Sun, May 12, 1:28 PM
Unknown Object (File)
Thu, May 9, 3:01 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.