Page MenuHomeFreeBSD

Deprecate CALLOUT_MPSAFEE
ClosedPublic

Authored by jkim on May 22 2015, 12:51 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jun 9, 10:45 AM
Unknown Object (File)
Sun, Jun 9, 8:21 AM
Unknown Object (File)
May 19 2024, 9:15 PM
Unknown Object (File)
May 10 2024, 9:07 AM
Unknown Object (File)
May 8 2024, 2:48 PM
Unknown Object (File)
Apr 29 2024, 1:13 PM
Unknown Object (File)
Mar 19 2024, 9:44 PM
Unknown Object (File)
Mar 19 2024, 5:23 PM

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 Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #5539)

How about just remove this definition?

sys/sys/callout.h
46 ↗(On Diff #5539)

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.