Skip to content

Commit 46373cb

Browse files
RISC-V: Use mmgrab()
commit f1f1007 ("mm: add new mmgrab() helper") added a helper that we missed out on. Signed-off-by: Palmer Dabbelt <palmer@sifive.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Atish Patra <atish.patra@wdc.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
1 parent 177fae4 commit 46373cb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/riscv/kernel/smpboot.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <linux/irq.h>
3131
#include <linux/of.h>
3232
#include <linux/sched/task_stack.h>
33+
#include <linux/sched/mm.h>
3334
#include <asm/irq.h>
3435
#include <asm/mmu_context.h>
3536
#include <asm/tlbflush.h>
@@ -101,7 +102,7 @@ asmlinkage void __init smp_callin(void)
101102
struct mm_struct *mm = &init_mm;
102103

103104
/* All kernel threads share the same mm context. */
104-
atomic_inc(&mm->mm_count);
105+
mmgrab(mm);
105106
current->active_mm = mm;
106107

107108
trap_init();

0 commit comments

Comments
 (0)