Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 150237 Details for
Bug 217067
A thread in pthread_cond_wait() is being signalled (rapidly) by two other threads but it is not being scheduled.
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
kernel-2.6.9-futex-queue_me-change.patch
kernel-2.6.9-futex-queue_me-change.patch (text/plain), 3.21 KB, created by
IBM Bug Proxy
on 2007-03-16 15:22:15 UTC
(
hide
)
Description:
kernel-2.6.9-futex-queue_me-change.patch
Filename:
MIME Type:
Creator:
IBM Bug Proxy
Created:
2007-03-16 15:22:15 UTC
Size:
3.21 KB
patch
obsolete
>--- kernel-2.6.9/linux-2.6.9/kernel/futex.c.futex-enqueue-change 2007-03-14 10:09:11.000000000 -0700 >+++ kernel-2.6.9/linux-2.6.9/kernel/futex.c 2007-03-15 10:10:26.000000000 -0700 >@@ -446,10 +446,10 @@ > * exactly once. They are called with the hashed spinlock held. > */ > >-/* The key must be already stored in q->key. */ >-static void queue_me(struct futex_q *q, int fd, struct file *filp) >+static inline struct futex_hash_bucket * >+queue_lock(struct futex_q *q, int fd, struct file *filp) > { >- struct futex_hash_bucket *bh; >+ struct futex_hash_bucket *hb; > > q->fd = fd; > q->filp = filp; >@@ -457,13 +457,36 @@ > init_waitqueue_head(&q->waiters); > > get_key_refs(&q->key); >- bh = hash_futex(&q->key); >- q->lock_ptr = &bh->lock; >+ hb = hash_futex(&q->key); >+ q->lock_ptr = &hb->lock; >+ >+ spin_lock(&hb->lock); >+ return hb; >+} >+ >+static inline void __queue_me(struct futex_q *q, struct futex_hash_bucket *hb) >+{ >+ list_add_tail(&q->list, &hb->chain); >+ hb->nqueued++; >+ spin_unlock(&hb->lock); >+} >+ >+static inline void >+queue_unlock(struct futex_q *q, struct futex_hash_bucket *hb) >+{ >+ spin_unlock(&hb->lock); >+ drop_key_refs(&q->key); >+} >+ >+ >+/* The key must be already stored in q->key. */ >+static void queue_me(struct futex_q *q, int fd, struct file *filp) >+{ >+ struct futex_hash_bucket *hb; >+ >+ hb = queue_lock(q, fd, filp); >+ __queue_me(q, hb); > >- spin_lock(&bh->lock); >- bh->nqueued++; >- list_add_tail(&q->list, &bh->chain); >- spin_unlock(&bh->lock); > } > > /* Return 1 if we were still queued (ie. 0 means we were woken) */ >@@ -475,6 +498,7 @@ > /* In the common case we don't take the spinlock, which is nice. */ > retry: > lock_ptr = q->lock_ptr; >+ barrier(); > if (lock_ptr != 0) { > spin_lock(lock_ptr); > /* >@@ -506,7 +530,9 @@ > > static int futex_wait(unsigned long uaddr, int val, unsigned long time) > { >- DECLARE_WAITQUEUE(wait, current); >+ struct task_struct *curr = current; >+ DECLARE_WAITQUEUE(wait, curr); >+ struct futex_hash_bucket *hb; > int ret, curval; > struct futex_q q; > >@@ -517,7 +543,7 @@ > if (unlikely(ret != 0)) > goto out_release_sem; > >- queue_me(&q, -1, NULL); >+ hb = queue_lock(&q, -1, NULL); > > /* > * Access the page after the futex is queued. >@@ -528,25 +554,27 @@ > ret = get_futex_value_locked(&curval, (int __user *)uaddr); > > if (unlikely(ret)) { >+ queue_unlock(&q, hb); >+ > /* If we would have faulted, release mmap_sem, fault it in and > * start all over again. > */ > up_read(¤t->mm->mmap_sem); > >- if (!unqueue_me(&q)) /* There's a chance we got woken already */ >- return 0; >- > ret = get_user(curval, (int __user *)uaddr); > > if (!ret) > goto retry; > return ret; > } >+ ret = -EWOULDBLOCK; > if (curval != val) { >- ret = -EWOULDBLOCK; >- goto out_unqueue; >+ goto out_unlock_release_sem; > } > >+ /* Only actually queue if *uaddr contained val. */ >+ __queue_me(&q, hb); >+ > /* > * Now the futex is queued and we have checked the data, we > * don't want to hold mmap_sem while we sleep. >@@ -587,10 +615,9 @@ > * have handled it for us already. */ > return -EINTR; > >- out_unqueue: >- /* If we were woken (and unqueued), we succeeded, whatever. */ >- if (!unqueue_me(&q)) >- ret = 0; >+ out_unlock_release_sem: >+ queue_unlock(&q, hb); >+ > out_release_sem: > up_read(¤t->mm->mmap_sem); > return ret;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 217067
:
142001
|
145480
|
145684
|
145993
|
145994
|
145995
|
146161
|
146162
| 150237 |
152587
|
152592
|
161087
|
161088
|
161089
|
161090
|
161091
|
161092
|
161093
|
161094
|
161095