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.
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -331,17 +331,6 @@ static void compat_exit_robust_list(struct task_struct *curr); · 330 unmodified lines | ||
| 331 | 331 | static inline void compat_exit_robust_list(struct task_struct *curr) { } |
| 332 | 332 | #endif |
| 333 | 333 | |
| 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 | − | |
| 345 | 334 | /* |
| 346 | 335 | * Reflects a new waiter being added to the waitqueue. |
| 347 | 336 | */ |
| @@ -432,7 +421,7 @@ static void get_futex_key_refs(union futex_key *key) · 84 unmodified lines | ||
| 432 | 421 | smp_mb(); /* explicit smp_mb(); (B) */ |
| 433 | 422 | break; |
| 434 | 423 | case FUT_OFF_MMSHARED: |
| 435 | − futex_get_mm(key); /* implies smp_mb(); (B) */ | |
| 424 | + smp_mb(); /* explicit smp_mb(); (B) */ | |
| 436 | 425 | break; |
| 437 | 426 | default: |
| 438 | 427 | /* |
| @@ -465,7 +454,6 @@ static void drop_futex_key_refs(union futex_key *key) · 26 unmodified lines | ||
| 465 | 454 | case FUT_OFF_INODE: |
| 466 | 455 | break; |
| 467 | 456 | case FUT_OFF_MMSHARED: |
| 468 | − mmdrop(key->private.mm); | |
| 469 | 457 | break; |
| 470 | 458 | } |
| 471 | 459 | } |