/* Copyright (C) 2009 Red Hat, Inc. * * See ../COPYING for licensing terms. */ #include <linux/mm.h> #include <linux/sched.h> #include <linux/sched/mm.h> #include <linux/sched/task.h> #include <linux/mmu_context.h> #include <linux/export.h> #include <asm/mmu_context.h> /* * use_mm * Makes the calling kernel thread take on the specified * mm context. * (Note: this routine is intended to be called only * from a kernel thread context) */
void use_mm(struct mm_struct *mm) { struct mm_struct *active_mm; struct task_struct *tsk = current; task_lock(tsk); active_mm = tsk->active_mm; if (active_mm != mm) { mmgrab(mm); tsk->active_mm = mm; } tsk->mm = mm; switch_mm(active_mm, mm, tsk); task_unlock(tsk); #ifdef finish_arch_post_lock_switch finish_arch_post_lock_switch(); #endif if (active_mm != mm) mmdrop(active_mm); }Contributors
Person | Tokens | Prop | Commits | CommitProp |
Michael S. Tsirkin | 82 | 90.11% | 2 | 50.00% |
Martin Schwidefsky | 8 | 8.79% | 1 | 25.00% |
Vegard Nossum | 1 | 1.10% | 1 | 25.00% |
Total | 91 | 100.00% | 4 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Michael S. Tsirkin | 46 | 100.00% | 2 | 100.00% |
Total | 46 | 100.00% | 2 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Michael S. Tsirkin | 152 | 88.89% | 4 | 40.00% |
Ingo Molnar | 9 | 5.26% | 3 | 30.00% |
Martin Schwidefsky | 8 | 4.68% | 1 | 10.00% |
Vegard Nossum | 1 | 0.58% | 1 | 10.00% |
Zach Brown | 1 | 0.58% | 1 | 10.00% |
Total | 171 | 100.00% | 10 | 100.00% |