Skip to contentSkip to conversation

add EOWNERDEAD and ENOTRECOVERABLE

PATCH In review Joe Korty 2 participants 3 messages Apr 12, 2005 – Apr 13, 2005 Generic include/asm header files

lore
Share & tools
lore

Joe Korty

author
#0 lore raw

PATCH 1/1 add EOWNERDEAD and ENOTRECOVERABLE

Hi Andrew,
This patch adds EOWNERDEAD and ENOTRECOVERABLE to all
architectures. Though there is nothing in the kernel that uses them yet, I know of two patches in development, one by Intel and the other by Bull, that adds robust mutex support to pthread_mutex*.

Robust mutexes, by de-facto industry convention, return EOWNERDEAD when the owner of a mutex dies, and returns ENOTRECOVERABLE if the new owner decides that it is not able to recover from the dead state, and so wants to mark the mutex unrecoverable.

There is interest in robust mutexes in Linux, as they are a well established tool when writing high availability applications on non-Linux platforms.

Even though there are kernel components to the robust mutex patches, the exact kernel ABI can be easily changed or even completely replaced, without affecting applications, while the patches are still in development. To achieve this immunity, the applications need only to access robust services through the pthreads library and they must link only with the dynamic version of the library. This works only because pthread robust mutexes are a de-facto standard, enforced by standard usage by long established applications, which any implementation of robust mutexes is required to match if it is to be accepted.

However, one piece of the ABI that does leak through is the value of EOWNERDEAD and ENOTRECOVERABLE. If these values could be fixed then application writers would feel more comfortable using these patches while they are still in development. In addition, if the patches are never accepted into the standard kernel, but live forever in various high availability vendor kernels as a specialty item, then it gives their users an unchanging ABI that they can live with -- even when they migrate their application binaries to a competing high availability Linux kernel.

I know that it is rare for an unused patch to be accepted; however it has happened at least once before when there was need -- eg, the security hooks patch, so this patch request may not be completely out of line.

Regards,
Joe

i386 compile tested.

 2.6.12-rc2-jak/include/asm-alpha/errno.h   |    3 +++
 2.6.12-rc2-jak/include/asm-generic/errno.h |    3 +++
 2.6.12-rc2-jak/include/asm-mips/errno.h    |    3 +++
 2.6.12-rc2-jak/include/asm-parisc/errno.h  |    3 +++
 2.6.12-rc2-jak/include/asm-sparc/errno.h   |    3 +++
 2.6.12-rc2-jak/include/asm-sparc64/errno.h |    3 +++
 6 files changed, 18 insertions(+)
include/asm-generic/errno.h renamed from include/asm-generic/errno.h~owner.notrecoverable.errnos +3 -0
diff -puNa include/asm-generic/errno.h~owner.notrecoverable.errnos include/asm-generic/errno.h
@@ -102,4 +102,7 @@
 #define	EKEYREVOKED	128	/* Key has been revoked */
 #define	EKEYREJECTED	129	/* Key was rejected by service */
 
+#define	EOWNERDEAD	130	/* Owner died */
+#define	ENOTRECOVERABLE	131	/* State not recoverable */
+
 #endif
include/asm-alpha/errno.h renamed from include/asm-alpha/errno.h~owner.notrecoverable.errnos +3 -0
diff -puNa include/asm-alpha/errno.h~owner.notrecoverable.errnos include/asm-alpha/errno.h
@@ -116,4 +116,7 @@
 #define	EKEYREVOKED	134	/* Key has been revoked */
 #define	EKEYREJECTED	135	/* Key was rejected by service */
 
+#define	EOWNERDEAD	136	/* Owner died */
+#define	ENOTRECOVERABLE	137	/* State not recoverable */
+
 #endif
include/asm-mips/errno.h renamed from include/asm-mips/errno.h~owner.notrecoverable.errnos +3 -0
diff -puNa include/asm-mips/errno.h~owner.notrecoverable.errnos include/asm-mips/errno.h
@@ -115,6 +115,9 @@
 #define	EKEYREVOKED	163	/* Key has been revoked */
 #define	EKEYREJECTED	164	/* Key was rejected by service */
 
+#define	EOWNERDEAD	165	/* Owner died */
+#define	ENOTRECOVERABLE	166	/* State not recoverable */
+
 #define EDQUOT		1133	/* Quota exceeded */
 
 #ifdef __KERNEL__
include/asm-parisc/errno.h renamed from include/asm-parisc/errno.h~owner.notrecoverable.errnos +3 -0
diff -puNa include/asm-parisc/errno.h~owner.notrecoverable.errnos include/asm-parisc/errno.h
@@ -115,5 +115,8 @@
 #define ENOTSUP		252	/* Function not implemented (POSIX.4 / HPUX) */
 #define ECANCELLED	253	/* aio request was canceled before complete (POSIX.4 / HPUX) */
 
+#define EOWNERDEAD	254	/* Owner died */
+#define ENOTRECOVERABLE	255	/* State not recoverable */
+
 
 #endif
include/asm-sparc/errno.h renamed from include/asm-sparc/errno.h~owner.notrecoverable.errnos +3 -0
diff -puNa include/asm-sparc/errno.h~owner.notrecoverable.errnos include/asm-sparc/errno.h
@@ -107,4 +107,7 @@
 #define	EKEYREVOKED	130	/* Key has been revoked */
 #define	EKEYREJECTED	131	/* Key was rejected by service */
 
+#define	EOWNERDEAD	132	/* Owner died */
+#define	ENOTRECOVERABLE	133	/* State not recoverable */
+
 #endif
include/asm-sparc64/errno.h renamed from include/asm-sparc64/errno.h~owner.notrecoverable.errnos +3 -0
diff -puNa include/asm-sparc64/errno.h~owner.notrecoverable.errnos include/asm-sparc64/errno.h
@@ -107,4 +107,7 @@
 #define	EKEYREVOKED	130	/* Key has been revoked */
 #define	EKEYREJECTED	131	/* Key was rejected by service */
 
+#define	EOWNERDEAD	132	/* Owner died */
+#define	ENOTRECOVERABLE	133	/* State not recoverable */
+
 #endif /* !(_SPARC64_ERRNO_H) */

_

#1 lore raw
Quoted 6 lines · Joe Korty

This patch adds EOWNERDEAD and ENOTRECOVERABLE to all
architectures. Though there is nothing in the kernel that uses them yet, I know of two patches in development, one by Intel and the other by Bull, that adds robust mutex support to pthread_mutex*.

We normally have objections to reserving parts of the name/number space for external patches, but I think robust mutexes are sufficiently popular and important to justify us making your lives easier.

Could you please reissue the patch, only add

/* For robust mutexes */

in the appropriate places? Otherwise someone will come in and try to clean it up again.

author
#2 lore raw

PATCH 1/1 add EOWNERDEAD and ENOTRECOVERABLE version 2

Add EOWNERDEAD and ENOTRECOVERABLE to all architectures. This is to support the upcoming patches for robust mutexes.

We normally don't reserve parts of the name/number space for external patches, but robust mutexes are sufficiently popular and important to justify it in this case.

 2.6.12-rc2-jak/include/asm-alpha/errno.h   |    4 ++++
 2.6.12-rc2-jak/include/asm-generic/errno.h |    4 ++++
 2.6.12-rc2-jak/include/asm-mips/errno.h    |    4 ++++
 2.6.12-rc2-jak/include/asm-parisc/errno.h  |    4 ++++
 2.6.12-rc2-jak/include/asm-sparc/errno.h   |    4 ++++
 2.6.12-rc2-jak/include/asm-sparc64/errno.h |    4 ++++
 6 files changed, 24 insertions(+)
include/asm-generic/errno.h renamed from include/asm-generic/errno.h~owner.notrecoverable.errnos +4 -0
diff -puNa include/asm-generic/errno.h~owner.notrecoverable.errnos include/asm-generic/errno.h
@@ -102,4 +102,8 @@
 #define	EKEYREVOKED	128	/* Key has been revoked */
 #define	EKEYREJECTED	129	/* Key was rejected by service */
 
+/* for robust mutexes */
+#define	EOWNERDEAD	130	/* Owner died */
+#define	ENOTRECOVERABLE	131	/* State not recoverable */
+
 #endif
include/asm-alpha/errno.h renamed from include/asm-alpha/errno.h~owner.notrecoverable.errnos +4 -0
diff -puNa include/asm-alpha/errno.h~owner.notrecoverable.errnos include/asm-alpha/errno.h
@@ -116,4 +116,8 @@
 #define	EKEYREVOKED	134	/* Key has been revoked */
 #define	EKEYREJECTED	135	/* Key was rejected by service */
 
+/* for robust mutexes */
+#define	EOWNERDEAD	136	/* Owner died */
+#define	ENOTRECOVERABLE	137	/* State not recoverable */
+
 #endif
include/asm-mips/errno.h renamed from include/asm-mips/errno.h~owner.notrecoverable.errnos +4 -0
diff -puNa include/asm-mips/errno.h~owner.notrecoverable.errnos include/asm-mips/errno.h
@@ -115,6 +115,10 @@
 #define	EKEYREVOKED	163	/* Key has been revoked */
 #define	EKEYREJECTED	164	/* Key was rejected by service */
 
+/* for robust mutexes */
+#define	EOWNERDEAD	165	/* Owner died */
+#define	ENOTRECOVERABLE	166	/* State not recoverable */
+
 #define EDQUOT		1133	/* Quota exceeded */
 
 #ifdef __KERNEL__
include/asm-parisc/errno.h renamed from include/asm-parisc/errno.h~owner.notrecoverable.errnos +4 -0
diff -puNa include/asm-parisc/errno.h~owner.notrecoverable.errnos include/asm-parisc/errno.h
@@ -115,5 +115,9 @@
 #define ENOTSUP		252	/* Function not implemented (POSIX.4 / HPUX) */
 #define ECANCELLED	253	/* aio request was canceled before complete (POSIX.4 / HPUX) */
 
+/* for robust mutexes */
+#define EOWNERDEAD	254	/* Owner died */
+#define ENOTRECOVERABLE	255	/* State not recoverable */
+
 
 #endif
include/asm-sparc/errno.h renamed from include/asm-sparc/errno.h~owner.notrecoverable.errnos +4 -0
diff -puNa include/asm-sparc/errno.h~owner.notrecoverable.errnos include/asm-sparc/errno.h
@@ -107,4 +107,8 @@
 #define	EKEYREVOKED	130	/* Key has been revoked */
 #define	EKEYREJECTED	131	/* Key was rejected by service */
 
+/* for robust mutexes */
+#define	EOWNERDEAD	132	/* Owner died */
+#define	ENOTRECOVERABLE	133	/* State not recoverable */
+
 #endif
include/asm-sparc64/errno.h renamed from include/asm-sparc64/errno.h~owner.notrecoverable.errnos +4 -0
diff -puNa include/asm-sparc64/errno.h~owner.notrecoverable.errnos include/asm-sparc64/errno.h
@@ -107,4 +107,8 @@
 #define	EKEYREVOKED	130	/* Key has been revoked */
 #define	EKEYREJECTED	131	/* Key was rejected by service */
 
+/* for robust mutexes */
+#define	EOWNERDEAD	132	/* Owner died */
+#define	ENOTRECOVERABLE	133	/* State not recoverable */
+
 #endif /* !(_SPARC64_ERRNO_H) */

_