Page MenuHomeFreeBSD

Add epoch_call_drain() function to wait until scheduled epoch_call() requests will be finished.
AbandonedPublic

Authored by ae on Apr 16 2019, 4:09 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 27 2025, 1:29 AM
Unknown Object (File)
Nov 20 2025, 3:20 PM
Unknown Object (File)
Nov 20 2025, 3:20 PM
Unknown Object (File)
Nov 20 2025, 3:10 PM
Unknown Object (File)
Nov 15 2025, 6:57 PM
Unknown Object (File)
Nov 12 2025, 8:52 AM
Unknown Object (File)
Nov 7 2025, 3:08 AM
Unknown Object (File)
Oct 17 2025, 7:41 AM
Subscribers

Details

Reviewers
mmacy
glebius
Summary

I faced with two problems while use epoch(4) KPI with kernel modules:

  1. The module creates new epoch with epoch_alloc(). It uses epoch_call() to make deferred free(). When module is unloaded, all scheduled free() do leak.
  2. The module uses existing epoch and uses epoch_call() to make deferred free(). When module is unloaded, there is highly likely chance to get memory leak and then page fault, when epoch_cb_task will call method that should make free().

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 23696

Event Timeline

It seems this is not enough to prevent panics. Simple kernel module to reproduce the panic.