History

futex: Remove pointless mmgrap() + mmdrop()

We always set 'key->private.mm' to 'current->mm', getting an extra reference on 'current->mm' is quite pointless, because as long as the task is blocked it isn't going to go away.

Peter Zijlstra committed 6 years ago

Commit 22299331 parent 38679131 file · +1 −13Browse files

Unified · Split

kernel/futex.c+1−13
@@ -331,17 +331,6 @@ static void compat_exit_robust_list(struct task_struct *curr); · 330 unmodified lines
331331 static inline void compat_exit_robust_list(struct task_struct *curr) { }
332332 #endif
333333
334−static inline void futex_get_mm(union futex_key *key)
335−{
336− mmgrab(key->private.mm);
337− /*
338− * Ensure futex_get_mm() implies a full barrier such that
339− * get_futex_key() implies a full barrier. This is relied upon
340− * as smp_mb(); (B), see the ordering comment above.
341− */
342− smp_mb__after_atomic();
343−}
344−
345334 /*
346335 * Reflects a new waiter being added to the waitqueue.
347336 */
@@ -432,7 +421,7 @@ static void get_futex_key_refs(union futex_key *key) · 84 unmodified lines
432421 smp_mb(); /* explicit smp_mb(); (B) */
433422 break;
434423 case FUT_OFF_MMSHARED:
435− futex_get_mm(key); /* implies smp_mb(); (B) */
424+ smp_mb(); /* explicit smp_mb(); (B) */
436425 break;
437426 default:
438427 /*
@@ -465,7 +454,6 @@ static void drop_futex_key_refs(union futex_key *key) · 26 unmodified lines
465454 case FUT_OFF_INODE:
466455 break;
467456 case FUT_OFF_MMSHARED:
468− mmdrop(key->private.mm);
469457 break;
470458 }
471459 }

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