From: Alex Shi Date: Fri, 10 Jan 2014 15:56:41 +0000 (+0800) Subject: Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android X-Git-Tag: firefly_0821_release~3680^2~175 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=60d29b4f9bf5466c1d6eccac414765b7ac2e8eb4;p=firefly-linux-kernel-4.4.55.git Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android Conflicts: include/linux/mm_types.h --- 60d29b4f9bf5466c1d6eccac414765b7ac2e8eb4 diff --cc include/linux/mm_types.h index 93ddd4eb910b,10a9a17342fc..c14df44a9567 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@@ -462,14 -465,45 +470,53 @@@ static inline cpumask_t *mm_cpumask(str return mm->cpu_vm_mask_var; } - +/* Return the name for an anonymous mapping or NULL for a file-backed mapping */ +static inline const char __user *vma_get_anon_name(struct vm_area_struct *vma) +{ + if (vma->vm_file) + return NULL; + + return vma->shared.anon_name; +} + #if defined(CONFIG_NUMA_BALANCING) || defined(CONFIG_COMPACTION) + /* + * Memory barriers to keep this state in sync are graciously provided by + * the page table locks, outside of which no page table modifications happen. + * The barriers below prevent the compiler from re-ordering the instructions + * around the memory barriers that are already present in the code. + */ + static inline bool mm_tlb_flush_pending(struct mm_struct *mm) + { + barrier(); + return mm->tlb_flush_pending; + } + static inline void set_tlb_flush_pending(struct mm_struct *mm) + { + mm->tlb_flush_pending = true; + + /* + * Guarantee that the tlb_flush_pending store does not leak into the + * critical section updating the page tables + */ + smp_mb__before_spinlock(); + } + /* Clearing is done after a TLB flush, which also provides a barrier. */ + static inline void clear_tlb_flush_pending(struct mm_struct *mm) + { + barrier(); + mm->tlb_flush_pending = false; + } + #else + static inline bool mm_tlb_flush_pending(struct mm_struct *mm) + { + return false; + } + static inline void set_tlb_flush_pending(struct mm_struct *mm) + { + } + static inline void clear_tlb_flush_pending(struct mm_struct *mm) + { + } + #endif #endif /* _LINUX_MM_TYPES_H */