lkml.org 
[lkml]   [2010]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V2 0/6][RFC] futex: FUTEX_LOCK with optional adaptive spinning
> The non-swappable part will be tricky.  One doesn't know how many
> threads will be created in a process. This mechanism shouldn't put an
> arbitrary limit in place. So where to allocate the memory? Perhaps
> it's better to implicitly mark the memory page pointed to by the new
> syscall as non-swappable? This could mean one page per thread...

You only need one page per 4096 threads or so if you make it create the
page on the first request, tied to say the signals and the like in
threaded tasks, and you then allocate 'slots' in the page for future
calls until you've got 4096 live.

ie you'd see something like

addr = set_tid_notifier_addr();

[1st call
map page at x to x + 4095, probably R/O]
[returns x]

next thread
addr = set_tid_notifier_addr()

[returns x + 1]

Alan


\
 
 \ /
  Last update: 2010-04-11 01:35    [W:0.248 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site