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.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
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:
- Remove the second agument, assuming all callouts are mpsafe.
- Convert non-mpsafe callouts to callout_init_mtx(..., &Giant);
- 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.
Yes, I like Gleb's idea, too. I'll commit this patch first and open another revision.