This is the mail archive of the
mailing list for the glibc project.
Re: [RFC PATCH] Add ix86 support for REQUEUE PI
- From: Darren Hart <dvhltc at us dot ibm dot com>
- To: dino at in dot ibm dot com
- Cc: libc-alpha at sources dot redhat dot com, Ulrich Drepper <drepper at redhat dot com>, Thomas Gleixner <tglx at linutronix dot de>
- Date: Fri, 14 Aug 2009 09:24:58 -0700
- Subject: Re: [RFC PATCH] Add ix86 support for REQUEUE PI
- References: <20090814134632.GA10212@in.ibm.com>
Dinakar Guniguntala wrote:
Just one minor minor comment nit below.
The following patch adds requeue pi support for i386 arch. It closely follows
the x86_64 implementation in current git. This is an RFC as it has atleast one
bug that is yet to be resolved, details below. Appreciate the review !
One important change (it needs to be changed in x86_64 as well) though,
specifically check the return code from the futex requeue pi call for
ENOSYS and only then use the non requeue pi functionality. For other
errors (such as EAGAIN etc), just return back to the application.
This is required as the kernel now treats mixing requeue pi and non requeue
pi APIs as an EINVAL (and rightly so). I'll be sending a separate patch
to modify the x86_64 implementation
The patch is against latest glibc git (13 Aug 2009)
Testing: prio-wake testcase (Part of the LTP realtime testcases) passes
with this patch. However some long running java tests randomly hang.
Attaching and detaching gdb to the hung process results in the process
continuing. I'm suspecting that the internal counters are getting
messed up in an error path somewhere and we are missing a wake,
still debugging this
diff -X ignore -Nurp glibc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S glibc.mod/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
--- glibc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S 2009-08-13 04:13:10.000000000 -0700
+++ glibc.mod/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S 2009-08-13 23:47:08.000000000 -0700
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2004, 2006, 2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <firstname.lastname@example.org>, 2002.
@@ -90,12 +90,14 @@ __pthread_cond_broadcast:
8: cmpl $-1, %edi
- /* XXX: The kernel so far doesn't support requeue to PI futex. */
- /* XXX: The kernel only supports FUTEX_CMP_REQUEUE to the same
- type of futex (private resp. shared). */
This second XXX comment is still true. We still don't mix private and
IBM Linux Technology Center
Real-Time Linux Team