Subject: Per-thread user <-> kernel communication area
To: None <>
From: Andrew Doran <>
List: tech-kern
Date: 11/08/2007 22:41:37
Hi all,

The below diff provides a wired-down, per-LWP area that is shared between a
user process and the kernel. It's not implemented as a commpage, because I
want to be able to send information in both directions, meaning the user
part has to be mapped read/write. Also, one advantage to having the kernel
allocate single blocks on behalf of the user process is that we can add to
the block later without backward compatibility concerns.

I haven't gone through the interaction with fork() yet. Currently it only
tracks which CPU an LWP is running on, whether or not the LWP is running,
and provides a hint when the LWP exits. The last item can be used to reclaim
the LWP's user stack without using _lwp_kill() to check for its continued

In the future the block could be used for other interesting stuff, like
maintaining the signal mask in userspace, which would allow us to eliminate
most calls to sigprocmask().