Page MenuHomeFreeBSD

LinuxKPI: Allow kmem_cache_free() to be called from critical sections
ClosedPublic

Authored by wulf on Jun 13 2021, 10:53 PM.

Details

Summary

as it is required by i915kms driver from Linux kernel v 5.5.
This is done with asynchronous freeing of requested memory areas from
taskqueue thread. As memory to be freed is reused to store linked list
entry, backing UMA zone item size is rounded up to pointer size.

While here, make struct linux_kmem_cache private to LKPI to reduce amount
of BSD headers included by linux/slab.h and switch RCU code to usage of
LKPI's linux_irq_work_tq taskqueue to avoid injection of current into
system-wide taskqueue_fast thread context.

Submitted by: nc (initial version for drm-kmod)

Diff Detail

Repository
rG 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

wulf requested review of this revision.Jun 13 2021, 10:53 PM

LGTM.

However since I'm technically a "Ports" committer (and far from a kernel expert, though hopefully getting there), I'd recommend waiting for approval from @hselasky and/or @manu.

This revision is now accepted and ready to land.Jun 14 2021, 12:20 AM

Not tested but looks good to me.

sys/compat/linuxkpi/common/include/linux/slab.h
208

This function must be prefixed lkpi_xxx() and a wrapper macro is needed.

This revision now requires review to proceed.Jun 14 2021, 11:25 PM
wulf added inline comments.
sys/compat/linuxkpi/common/include/linux/slab.h
208

This function must be prefixed lkpi_xxx() and a wrapper macro is needed.

Done

This revision was not accepted when it landed; it landed in state Needs Review.Jul 5 2021, 12:24 AM
This revision was automatically updated to reflect the committed changes.
wulf marked an inline comment as done.