diff options
Diffstat (limited to 'kernel/fork.c')
| -rw-r--r-- | kernel/fork.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index be8aa5b98666..e5d9d405ae4e 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
| @@ -592,7 +592,7 @@ static void check_mm(struct mm_struct *mm) | |||
| 592 | * is dropped: either by a lazy thread or by | 592 | * is dropped: either by a lazy thread or by |
| 593 | * mmput. Free the page directory and the mm. | 593 | * mmput. Free the page directory and the mm. |
| 594 | */ | 594 | */ |
| 595 | static void __mmdrop(struct mm_struct *mm) | 595 | void __mmdrop(struct mm_struct *mm) |
| 596 | { | 596 | { |
| 597 | BUG_ON(mm == &init_mm); | 597 | BUG_ON(mm == &init_mm); |
| 598 | mm_free_pgd(mm); | 598 | mm_free_pgd(mm); |
| @@ -603,18 +603,7 @@ static void __mmdrop(struct mm_struct *mm) | |||
| 603 | put_user_ns(mm->user_ns); | 603 | put_user_ns(mm->user_ns); |
| 604 | free_mm(mm); | 604 | free_mm(mm); |
| 605 | } | 605 | } |
| 606 | 606 | EXPORT_SYMBOL_GPL(__mmdrop); | |
| 607 | void mmdrop(struct mm_struct *mm) | ||
| 608 | { | ||
| 609 | /* | ||
| 610 | * The implicit full barrier implied by atomic_dec_and_test() is | ||
| 611 | * required by the membarrier system call before returning to | ||
| 612 | * user-space, after storing to rq->curr. | ||
| 613 | */ | ||
| 614 | if (unlikely(atomic_dec_and_test(&mm->mm_count))) | ||
| 615 | __mmdrop(mm); | ||
| 616 | } | ||
| 617 | EXPORT_SYMBOL_GPL(mmdrop); | ||
| 618 | 607 | ||
| 619 | static void mmdrop_async_fn(struct work_struct *work) | 608 | static void mmdrop_async_fn(struct work_struct *work) |
| 620 | { | 609 | { |
