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)
Fri, Nov 7, 3:08 AM
Unknown Object (File)
Fri, Oct 17, 7:41 AM
Unknown Object (File)
Sep 30 2025, 1:48 AM
Unknown Object (File)
Sep 17 2025, 3:36 PM
Unknown Object (File)
Jul 29 2025, 7:47 AM
Unknown Object (File)
Jul 23 2025, 8:47 AM
Unknown Object (File)
Jun 27 2025, 4:12 AM
Unknown Object (File)
Jun 25 2025, 4:54 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.