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)
Sat, Nov 2, 4:39 PM
Unknown Object (File)
Oct 22 2024, 7:15 AM
Unknown Object (File)
Oct 22 2024, 6:23 AM
Unknown Object (File)
Oct 2 2024, 1:56 PM
Unknown Object (File)
Oct 1 2024, 5:09 PM
Unknown Object (File)
Sep 29 2024, 1:24 AM
Unknown Object (File)
Sep 23 2024, 8:20 PM
Unknown Object (File)
Sep 22 2024, 6:50 AM
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.