/* * Copyright (C) 2014 Davidlohr Bueso. */ #include <linux/sched.h> #include <linux/mm.h> #include <linux/vmacache.h> /* * Flush vma caches for threads that share a given mm. * * The operation is safe because the caller holds the mmap_sem * exclusively and other threads accessing the vma cache will * have mmap_sem held at least for read, so no extra locking * is required to maintain the vma cache. */
void vmacache_flush_all(struct mm_struct *mm) { struct task_struct *g, *p; count_vm_vmacache_event(VMACACHE_FULL_FLUSHES); /* * Single threaded tasks need not iterate the entire * list of process. We can avoid the flushing as well * since the mm's seqnum was increased and don't have * to worry about other threads' seqnum. Current's * flush will occur upon the next lookup. */ if (atomic_read(&mm->mm_users) == 1) return; rcu_read_lock(); for_each_process_thread(g, p) { /* * Only flush the vmacache pointers as the * mm seqnum is already set and curr's will * be set upon invalidation when the next * lookup is done. */ if (mm == p->mm) vmacache_flush(p); } rcu_read_unlock(); }Contributors
Person | Tokens | Prop | Commits | CommitProp | |
davidlohr bueso | davidlohr bueso | 65 | 100.00% | 3 | 100.00% |
Total | 65 | 100.00% | 3 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
davidlohr bueso | davidlohr bueso | 28 | 100.00% | 2 | 100.00% |
Total | 28 | 100.00% | 2 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
davidlohr bueso | davidlohr bueso | 35 | 100.00% | 1 | 100.00% |
Total | 35 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
davidlohr bueso | davidlohr bueso | 63 | 100.00% | 1 | 100.00% |
Total | 63 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
davidlohr bueso | davidlohr bueso | 90 | 84.11% | 2 | 66.67% |
linus torvalds | linus torvalds | 17 | 15.89% | 1 | 33.33% |
Total | 107 | 100.00% | 3 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
davidlohr bueso | davidlohr bueso | 95 | 100.00% | 2 | 100.00% |
Total | 95 | 100.00% | 2 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
davidlohr bueso | davidlohr bueso | 393 | 95.85% | 5 | 83.33% |
linus torvalds | linus torvalds | 17 | 4.15% | 1 | 16.67% |
Total | 410 | 100.00% | 6 | 100.00% |