/[packages]/cauldron/glibc/current/SOURCES/glibc-2.20-disable-adaptive-elsison-in-rwlocks.patch
ViewVC logotype

Contents of /cauldron/glibc/current/SOURCES/glibc-2.20-disable-adaptive-elsison-in-rwlocks.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 737868 - (show annotations) (download)
Fri Oct 10 15:33:22 2014 UTC (9 years, 5 months ago) by tmb
File size: 3465 byte(s)
ensure adaptive elision in rwlocks is disabled (mga#14172)
1
2 This patch disables adaptive elision on rwlocks as
3 atleast ELIDE_UNLOCK gets triggered on non-haswell hw :/
4
5 https://bugs.mageia.org/show_bug.cgi?id=14172
6
7 Signed-off-by: Thomas Backlund <tmb@mageia.org>
8
9 diff -Nurp glibc-2.20.orig/nptl/pthread_rwlock_rdlock.c glibc-2.20/nptl/pthread_rwlock_rdlock.c
10 --- glibc-2.20.orig/nptl/pthread_rwlock_rdlock.c 2014-09-07 11:09:09.000000000 +0300
11 +++ glibc-2.20/nptl/pthread_rwlock_rdlock.c 2014-10-10 18:16:22.396891335 +0300
12 @@ -103,11 +103,13 @@ __pthread_rwlock_rdlock (pthread_rwlock_
13
14 LIBC_PROBE (rdlock_entry, 1, rwlock);
15
16 +#ifdef ENABLE_LOCK_ELISION
17 if (ELIDE_LOCK (rwlock->__data.__rwelision,
18 rwlock->__data.__lock == 0
19 && rwlock->__data.__writer == 0
20 && rwlock->__data.__nr_readers == 0))
21 return 0;
22 +#endif
23
24 /* Make sure we are alone. */
25 lll_lock (rwlock->__data.__lock, rwlock->__data.__shared);
26 diff -Nurp glibc-2.20.orig/nptl/pthread_rwlock_tryrdlock.c glibc-2.20/nptl/pthread_rwlock_tryrdlock.c
27 --- glibc-2.20.orig/nptl/pthread_rwlock_tryrdlock.c 2014-09-07 11:09:09.000000000 +0300
28 +++ glibc-2.20/nptl/pthread_rwlock_tryrdlock.c 2014-10-10 18:15:05.316076158 +0300
29 @@ -27,11 +27,13 @@ __pthread_rwlock_tryrdlock (pthread_rwlo
30 {
31 int result = EBUSY;
32
33 +#ifdef ENABLE_LOCK_ELISION
34 if (ELIDE_TRYLOCK (rwlock->__data.__rwelision,
35 rwlock->__data.__lock == 0
36 && rwlock->__data.__nr_readers == 0
37 && rwlock->__data.__writer, 0))
38 return 0;
39 +#endif
40
41 lll_lock (rwlock->__data.__lock, rwlock->__data.__shared);
42
43 diff -Nurp glibc-2.20.orig/nptl/pthread_rwlock_trywrlock.c glibc-2.20/nptl/pthread_rwlock_trywrlock.c
44 --- glibc-2.20.orig/nptl/pthread_rwlock_trywrlock.c 2014-09-07 11:09:09.000000000 +0300
45 +++ glibc-2.20/nptl/pthread_rwlock_trywrlock.c 2014-10-10 18:15:24.666280799 +0300
46 @@ -27,11 +27,13 @@ __pthread_rwlock_trywrlock (pthread_rwlo
47 {
48 int result = EBUSY;
49
50 +#ifdef ENABLE_LOCK_ELISION
51 if (ELIDE_TRYLOCK (rwlock->__data.__rwelision,
52 rwlock->__data.__lock == 0
53 && rwlock->__data.__nr_readers == 0
54 && rwlock->__data.__writer, 1))
55 return 0;
56 +#endif
57
58 lll_lock (rwlock->__data.__lock, rwlock->__data.__shared);
59
60 diff -Nurp glibc-2.20.orig/nptl/pthread_rwlock_unlock.c glibc-2.20/nptl/pthread_rwlock_unlock.c
61 --- glibc-2.20.orig/nptl/pthread_rwlock_unlock.c 2014-09-07 11:09:09.000000000 +0300
62 +++ glibc-2.20/nptl/pthread_rwlock_unlock.c 2014-10-10 18:16:03.986696637 +0300
63 @@ -31,9 +31,11 @@ __pthread_rwlock_unlock (pthread_rwlock_
64 {
65 LIBC_PROBE (rwlock_unlock, 1, rwlock);
66
67 +#ifdef ENABLE_LOCK_ELISION
68 if (ELIDE_UNLOCK (rwlock->__data.__writer == 0
69 && rwlock->__data.__nr_readers == 0))
70 return 0;
71 +#endif
72
73 lll_lock (rwlock->__data.__lock, rwlock->__data.__shared);
74 if (rwlock->__data.__writer)
75 diff -Nurp glibc-2.20.orig/nptl/pthread_rwlock_wrlock.c glibc-2.20/nptl/pthread_rwlock_wrlock.c
76 --- glibc-2.20.orig/nptl/pthread_rwlock_wrlock.c 2014-09-07 11:09:09.000000000 +0300
77 +++ glibc-2.20/nptl/pthread_rwlock_wrlock.c 2014-10-10 18:17:48.637803453 +0300
78 @@ -92,11 +92,13 @@ __pthread_rwlock_wrlock (pthread_rwlock_
79 {
80 LIBC_PROBE (wrlock_entry, 1, rwlock);
81
82 +#ifdef ENABLE_LOCK_ELISION
83 if (ELIDE_LOCK (rwlock->__data.__rwelision,
84 rwlock->__data.__lock == 0
85 && rwlock->__data.__writer == 0
86 && rwlock->__data.__nr_readers == 0))
87 return 0;
88 +#endif
89
90 /* Make sure we are alone. */
91 lll_lock (rwlock->__data.__lock, rwlock->__data.__shared);

  ViewVC Help
Powered by ViewVC 1.1.30