History

kernel/futex: Make futex_wait_requeue_pi() only call fixup_owner()

A small cleanup that allows for fixup_pi_state_owner() only to be called from fixup_owner(), and make requeue_pi uniformly call fixup_owner() regardless of the state in which the fixup is actually needed. Of course this makes the caller's first pi_state->owner != current check redundant, but that should't really matter.

Davidlohr Bueso committed 5 years ago

Commit a1565aa1 parent 9a4b99f1 file · +5 −6Browse files

Unified · Split

kernel/futex.c+5−6
@@ -3241,15 +3241,14 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, · 3240 unmodified lines
3241 * reference count.3241 * reference count.
3242 */3242 */
3243 3243
3244 /* Check if the requeue code acquired the second futex for us. */3244 /*
3245 * Check if the requeue code acquired the second futex for us and do
3246 * any pertinent fixup.
3247 */
3245 if (!q.rt_waiter) {3248 if (!q.rt_waiter) {
3246 /*
3247 * Got the lock. We might not be the anticipated owner if we
3248 * did a lock-steal - fix up the PI-state in that case.
3249 */
3250 if (q.pi_state && (q.pi_state->owner != current)) {3249 if (q.pi_state && (q.pi_state->owner != current)) {
3251 spin_lock(q.lock_ptr);3250 spin_lock(q.lock_ptr);
3252 ret = fixup_pi_state_owner(uaddr2, &q, current);3251 ret = fixup_owner(uaddr2, &q, true);
3253 /*3252 /*
3254 * Drop the reference to the pi state which3253 * Drop the reference to the pi state which
3255 * the requeue_pi() code acquired for us.3254 * the requeue_pi() code acquired for us.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t