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 2, 1:58 PM
Unknown Object (File)
Wed, Oct 2, 4:43 AM
Unknown Object (File)
Tue, Oct 1, 5:44 AM
Unknown Object (File)
Mon, Sep 30, 11:22 PM
Unknown Object (File)
Fri, Sep 27, 11:25 PM
Unknown Object (File)
Thu, Sep 19, 9:43 AM
Unknown Object (File)
Tue, Sep 17, 6:55 PM
Unknown Object (File)
Tue, Sep 17, 6:08 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.