[PATCH]: robust futexes

Alexander Kabaev kabaev at gmail.com
Wed Apr 30 16:43:55 UTC 2008


On Wed, 30 Apr 2008 10:18:06 +0200
Roman Divacky <rdivacky at freebsd.org> wrote:

> hi
> 
> I implemented robust futexes in linuxulator and I need to get it
> reviewed/tested. The best way to test it is (according to linux
> documnetation) to run yum and kill -9 it while it runs. 
> 
> The patch is here:
> http://www.vlakno.cz/~rdivacky/linux_robust_futex.patch
> 
> the patch should be ok as I followed linux code very closely (most of
> the code runs in userspace so kernel has very well defined work). I
> tested it lightly on i386.
> 
> I'd like to commit this quite soon so please help.
> 
> thnx!
> 
> roman
Hi,

some comments:

linux_emul.c:

@@ -86,6 +86,7 @@
 		em = malloc(sizeof *em, M_LINUX, M_WAITOK | M_ZERO);
 		em->pid = child;
 		em->pdeath_signal = 0;
+		em->robust_futexes = NULL;

M_ZERO is not quite zero enough? :)

linux_futex.c in release_futexes:

+	head = em->robust_futexes;
+
+	if (fetch_robust_entry(&entry, &head->list.next, &pi))
+		return;

Aren't you taking a fault in copyin unconditionally if
em->robust_mutexes happens to be NULL? Why not check is for NULL first?

Also, is sched_relinguish really necessary after each each futex
recovery _except_ from the 'pending' futex one?

i386/conf/GENERIC:

Does not belong in this patch, probably included in by mistake.



-- 
Alexander Kabaev	
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-emulation/attachments/20080430/428310f1/signature.pgp


More information about the freebsd-emulation mailing list