Page MenuHomeFreeBSD

Deprecate CALLOUT_MPSAFEE
ClosedPublic

Authored by jkim on May 22 2015, 12:51 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 2, 7:06 AM
Unknown Object (File)
Mon, Dec 2, 7:06 AM
Unknown Object (File)
Mon, Dec 2, 7:05 AM
Unknown Object (File)
Mon, Dec 2, 6:46 AM
Unknown Object (File)
Tue, Nov 26, 7:26 AM
Unknown Object (File)
Nov 17 2024, 5:44 AM
Unknown Object (File)
Nov 1 2024, 3:09 AM
Unknown Object (File)
Oct 7 2024, 8:54 AM

Details

Summary

CALLOUT_MPSAFE has lost its meaning since r141428, i.e., more than ten years for CURRENT. However, it is continuously misused as mpsafe argument for callout_init(9). This patch cleans up callout_init() calls and deprecate the flag.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

jkim retitled this revision from to Deprecate CALLOUT_MPSAFEE.
jkim updated this object.
jkim edited the test plan for this revision. (Show Details)
jkim set the repository for this revision to rS FreeBSD src repository - subversion.
sys/sys/callout.h
46

How about just remove this definition?

sys/sys/callout.h
46

I left it for third-party drivers but we can do that, of course. :-)

For me 1 looks less meaningful than CALLOUT_MPSAFE. If you want to do cleanup, my suggestion is to use Bool argument.

On second thought, may be it is possible to do the following:

  1. Remove the second agument, assuming all callouts are mpsafe.
  2. Convert non-mpsafe callouts to callout_init_mtx(..., &Giant);
  3. Remove special Giant handling from the kern_timeout.c

Some of this may be my fault as I had thought that CALLOUT_MPSAFE is what was supposed to be passed to this.

I think this is fine for now. I think longer term I prefer Gleb's suggestion of requiring non-safe callouts to use callout_init_mtx with &Giant. I'm not sure how many of these callouts still exist. There is one timeout() user left that I still need to get tested, but I hope to remove timeout() very soon.

In D2613#48666, @jhb wrote:

I think longer term I prefer Gleb's suggestion of requiring non-safe callouts to use callout_init_mtx with &Giant.

Yes, I like Gleb's idea, too. I'll commit this patch first and open another revision.

This revision was automatically updated to reflect the committed changes.