On 24.04.2020 05:22, Jason R Thorpe wrote:
> Module Name:  src
> Committed By: thorpej
> Date:         Fri Apr 24 03:22:06 UTC 2020
> 
> Modified Files:
>       src/sys/compat/linux/common: linux_exec.c linux_sched.c
>       src/sys/kern: kern_exec.c kern_exit.c kern_fork.c kern_lwp.c
>           kern_proc.c sys_lwp.c
>       src/sys/sys: lwp.h proc.h
> 
> Log Message:
> Overhaul the way LWP IDs are allocated.  Instead of each LWP having it's
> own LWP ID space, LWP IDs came from the same number space as PIDs.  The
> lead LWP of a process gets the PID as its LID.  If a multi-LWP process's
> lead LWP exits, the PID persists for the process.
> 
> In addition to providing system-wide unique thread IDs, this also lets us
> eliminate the per-process LWP radix tree, and some associated locks.
> 
> Remove the separate "global thread ID" map added previously; it is no longer
> needed to provide this functionality.
> 
> Nudged in this direction by ad@ and chs@.
> 

This is a good idea (and preexisting in other kernels), unfortunately we
had locking issues in rust. If a multithreaded process is forked, we
shall create a replica of a calling thread and keep mutexes functional.
We tried to preserve the caller's LWP to guarantee this.

This problem can be back. I don't ask to revert or revisit this change,
but if it will be back, we shall find a solution for it.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to