[lkml]   [2002]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [patch] user-vm-unlock-2.5.31-A2
Ingo Molnar wrote:
> > I wonder if it makes more sense for the release word to be a futex --
> > then various ways of actually waiting for the stack are available.
> the window for locking is really small (and will always be small), so it's
> cheaper for the fastpath to implement this as a spinlock, with the
> stack-user being the lock holder.

I'm thinking that any _clean_ threading library (pthreads or not)
should do these two things:

- intercept all the system calls that might call mmput(); that is,
exit() and execve()), just so it can move the thread-specific data
(including the stack) onto the "potentially free list".

- free the stack memory as soon as possible after a thread has died,
_without_ depending on garbage collection. What if all the other
threads are compute-bound? There's a lump of unnecessary stack
taking up memory for an indefinite time.

It seems that you're using a futex anyway -- so why not eliminate that
pesky system call _and_ make sure pthread_join() work if some library
you're linked to exits without calling pthread_exit()..

-- Jamie
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:28    [W:0.567 / U:1.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site