summaryrefslogtreecommitdiff
path: root/kernel/futex.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2020-03-04 15:02:41 +0300
committerPeter Zijlstra <peterz@infradead.org>2020-03-06 13:06:18 +0300
commit222993395ed38f3751287f4bd82ef46b3eb3a66d (patch)
tree6b3dd02dcc21765cbeacb30b316b67f4d8101ed6 /kernel/futex.c
parent3867913c45b478dec7f9a60b950ad88a14e2a748 (diff)
downloadlinux-222993395ed38f3751287f4bd82ef46b3eb3a66d.tar.xz
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. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Diffstat (limited to 'kernel/futex.c')
-rw-r--r--kernel/futex.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/kernel/futex.c b/kernel/futex.c
index e14f7cd45dbd..3463c916605a 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -331,17 +331,6 @@ static void compat_exit_robust_list(struct task_struct *curr);
static inline void compat_exit_robust_list(struct task_struct *curr) { }
#endif
-static inline void futex_get_mm(union futex_key *key)
-{
- mmgrab(key->private.mm);
- /*
- * Ensure futex_get_mm() implies a full barrier such that
- * get_futex_key() implies a full barrier. This is relied upon
- * as smp_mb(); (B), see the ordering comment above.
- */
- smp_mb__after_atomic();
-}
-
/*
* Reflects a new waiter being added to the waitqueue.
*/
@@ -432,7 +421,7 @@ static void get_futex_key_refs(union futex_key *key)
smp_mb(); /* explicit smp_mb(); (B) */
break;
case FUT_OFF_MMSHARED:
- futex_get_mm(key); /* implies smp_mb(); (B) */
+ smp_mb(); /* explicit smp_mb(); (B) */
break;
default:
/*
@@ -465,7 +454,6 @@ static void drop_futex_key_refs(union futex_key *key)
case FUT_OFF_INODE:
break;
case FUT_OFF_MMSHARED:
- mmdrop(key->private.mm);
break;
}
}