After mi_startup() finishes, thread0 becomes the "swapper", whose
responsibility is to swap threads back in on demand. Now that threads
can't be swapped out, there is no use for this thread. Just call
sched_throw() to exit.
Details
- Reviewers
jhb alc kib imp - Commits
- rG0dd7789512a1: vm: Remove kernel stack swapping support, part 2
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 58811 Build 55698: arc lint + arc unit
Event Timeline
sys/vm/vm_glue.c | ||
---|---|---|
840 | Do we need this at all? |
sys/vm/vm_glue.c | ||
---|---|---|
840 | No, but fixing up its callers will be a patch of its own. I didn't go that far yet. |
Does this mean that thread0 is no longer functional? If yes, can we re-purpose it for something/anything instead of throwing?
Right. Do you have any suggestions there? Hmm, after these changes there is still the vm_daemon(), to handle RACCT_RSS and RLIMIT_RSS. That is probably a good candidate.
This is only for RACCT I think. In the worst case I suggest to just park the thread by blocking it, or doing non-interruptible sleep on local var address.
sys/vm/vm_glue.c | ||
---|---|---|
840 | This is now done in parts 9 and 10. |
sys/kern/init_main.c | ||
---|---|---|
341 | I wouldn't be surprised to find that this results in last being placed on the stack instead of a register. Could __builtin_frame_address(0) be used instead? |
sys/kern/init_main.c | ||
---|---|---|
341 | There is pause() with the dedicated pause_wchan. Might be loop around pause()? |
sys/kern/init_main.c | ||
---|---|---|
341 | With pause(), we have to provide some arbitrary timeout, and a callout will be scheduled, so I slightly prefer the tsleep() call. I don't feel strongly about it and can change it if you prefer. |
sys/kern/init_main.c | ||
---|---|---|
341 | We can use pause_wchan at least. But either is fine. |