/* Copyright (C) 2009 Red Hat, Inc. * * See ../COPYING for licensing terms. */ #include <linux/mm.h> #include <linux/sched.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) { atomic_inc(&mm->mm_count); 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 | michael s. tsirkin | 86 | 91.49% | 2 | 66.67% |
martin schwidefsky | martin schwidefsky | 8 | 8.51% | 1 | 33.33% |
Total | 94 | 100.00% | 3 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
michael s. tsirkin | michael s. tsirkin | 46 | 100.00% | 2 | 100.00% |
Total | 46 | 100.00% | 2 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
michael s. tsirkin | michael s. tsirkin | 156 | 92.86% | 4 | 57.14% |
martin schwidefsky | martin schwidefsky | 8 | 4.76% | 1 | 14.29% |
ingo molnar | ingo molnar | 3 | 1.79% | 1 | 14.29% |
zach brown | zach brown | 1 | 0.60% | 1 | 14.29% |
Total | 168 | 100.00% | 7 | 100.00% |