Page MenuHomeFreeBSD

Remove extra PROC_UNLOCK() from itimer_fire()
AbandonedPublic

Authored by aly_aaronly.me on Sun, Mar 30, 12:36 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 14, 8:28 AM
Unknown Object (File)
Mon, Apr 14, 4:04 AM
Unknown Object (File)
Sun, Apr 13, 9:11 PM
Unknown Object (File)
Mon, Apr 7, 6:40 AM
Unknown Object (File)
Mon, Apr 7, 6:40 AM
Unknown Object (File)
Sat, Apr 5, 9:54 AM
Unknown Object (File)
Fri, Apr 4, 9:36 AM
Unknown Object (File)
Fri, Apr 4, 6:41 AM
Subscribers

Details

Reviewers
kib
Summary

The itimer_fire() function is only used in realtimer_expire_l() and the proc locking has been already dealt there, so the PROC_UNLOCK() in itimer_fire() is wrong and should be removed.

See also: https://reviews.freebsd.org/D29746

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Did you observed the double unlock on the real system? I am asking because I suspect that the patch is based on local code reading only.
If you look at the sigev_findtd() in details, you would see that it returns with the process lock owned if the result is zero. The process lock is required for the tdsendsignal() call, and then the lock is dropped.

In D49576#1130271, @kib wrote:

Did you observed the double unlock on the real system? I am asking because I suspect that the patch is based on local code reading only.

No. I'm implementing the POSIX timers in DragonFly BSD based on the FreeBSD code.

If you look at the sigev_findtd() in details, you would see that it returns with the process lock owned if the result is zero. The process lock is required for the tdsendsignal() call, and then the lock is dropped.

Yah, I haven't yet dived into sigev_findtd() and was missing this detail. Thank you for the explanation.