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

Showing the changes to kernel (1 of 1 file). Show all

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
32413241 * reference count.
32423242 */
32433243
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+ */
32453248 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− */
32503249 if (q.pi_state && (q.pi_state->owner != current)) {
32513250 spin_lock(q.lock_ptr);
3252− ret = fixup_pi_state_owner(uaddr2, &q, current);
3251+ ret = fixup_owner(uaddr2, &q, true);
32533252 /*
32543253 * Drop the reference to the pi state which
32553254 * 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