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
F175955187: D19925.diff
Wed, Oct 14, 6:36 PM
Unknown Object (File)
Mon, Oct 12, 10:03 AM
Unknown Object (File)
Thu, Oct 8, 8:35 PM
Unknown Object (File)
Mon, Oct 5, 1:26 PM
Unknown Object (File)
Wed, Sep 23, 2:16 PM
Unknown Object (File)
Wed, Sep 23, 12:33 PM
Unknown Object (File)
Sun, Sep 20, 3:44 AM
Unknown Object (File)
Sep 4 2026, 2:57 PM
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.