Page MenuHomeFreeBSD

Comments fixes after reading the thread creation and suspension paths.
ClosedPublic

Authored by kib on Jun 5 2016, 11:21 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 6 2024, 5:34 AM
Unknown Object (File)
Mar 5 2024, 6:08 PM
Unknown Object (File)
Feb 22 2024, 9:13 AM
Unknown Object (File)
Feb 18 2024, 3:22 PM
Unknown Object (File)
Jan 15 2024, 2:17 AM
Unknown Object (File)
Dec 20 2023, 12:09 AM
Unknown Object (File)
Oct 12 2023, 7:59 AM
Unknown Object (File)
Oct 1 2023, 11:38 PM
Subscribers

Details

Summary

KSE terminology in the comments for cpu_set_upcall_kse() confuses much more than explains.

Remove two XXX in kern_thread.c. One is probably rotten as is, another one required better formulation.

Remove code duplication in weed_inhib().

The question: does it make sense to rename cpu_set_upcall_kse() ? I stopped there. Good name could be e.g. cpu_set_userret().

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib retitled this revision from to Comments fixes after reading the thread creation and suspension paths..
kib updated this object.
kib edited the test plan for this revision. (Show Details)
kib added a reviewer: jhb.
kib set the repository for this revision to rS FreeBSD src repository - subversion.

Let's please rename the function, but I think cpu_set_upcall() is a better name for it. :(

For fork() we have cpu_fork() and cpu_set_fork_handler(). Perhaps cpu_set_upcall() should be something like 'cpu_thread_create()' and 'cpu_set_upcall_kse()' should be 'cpu_user_upcall()' (named similar to cpu_user_tls()).

The only thing that is somewhat unfortunate is that kthread_add() uses cpu_set_fork_handler(). If we called it 'cpu_set_kthread_handler()' perhaps that would be less bad.

sys/i386/i386/vm_machdep.c
465 ↗(On Diff #17325)

This comment has some typos and confusing language as well. :-/

sys/kern/kern_thread.c
673 ↗(On Diff #17325)

Perhaps commit this separately?

sys/kern/kern_thread.c
673 ↗(On Diff #17325)

Sure.

kib edited edge metadata.

Rename:
cpu_set_upcall()->cpu_copy_thread()
cpu_set_upcall_kse()->cpu_set_upcall()
cpu_set_fork_handler()->cpu_fork_krthread_handler()

Update comments.

If you have other preferences, I am willing to change this.

jhb edited edge metadata.
This revision is now accepted and ready to land.Jun 15 2016, 4:50 PM
This revision was automatically updated to reflect the committed changes.