Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 362500
b: refs/heads/master
c: 1de14c3
h: refs/heads/master
v: v3
  • Loading branch information
Dave Hansen authored and Linus Torvalds committed Apr 12, 2013
1 parent b398082 commit bae4b5c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bf81710c4b6e2df2cc047f7c8e1f342511904b74
refs/heads/master: 1de14c3c5cbc9bb17e9dcc648cda51c0c85d54b9
2 changes: 1 addition & 1 deletion trunk/arch/x86/include/asm/tlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#define tlb_flush(tlb) \
{ \
if (tlb->fullmm == 0) \
if (!tlb->fullmm && !tlb->need_flush_all) \
flush_tlb_mm_range(tlb->mm, tlb->start, tlb->end, 0UL); \
else \
flush_tlb_mm_range(tlb->mm, 0UL, TLB_FLUSH_ALL, 0UL); \
Expand Down
7 changes: 7 additions & 0 deletions trunk/arch/x86/mm/pgtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ void ___pte_free_tlb(struct mmu_gather *tlb, struct page *pte)
void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd)
{
paravirt_release_pmd(__pa(pmd) >> PAGE_SHIFT);
/*
* NOTE! For PAE, any changes to the top page-directory-pointer-table
* entries need a full cr3 reload to flush.
*/
#ifdef CONFIG_X86_PAE
tlb->need_flush_all = 1;
#endif
tlb_remove_page(tlb, virt_to_page(pmd));
}

Expand Down
7 changes: 6 additions & 1 deletion trunk/include/asm-generic/tlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,12 @@ struct mmu_gather {
unsigned int need_flush : 1, /* Did free PTEs */
fast_mode : 1; /* No batching */

unsigned int fullmm;
/* we are in the middle of an operation to clear
* a full mm and can make some optimizations */
unsigned int fullmm : 1,
/* we have performed an operation which
* requires a complete flush of the tlb */
need_flush_all : 1;

struct mmu_gather_batch *active;
struct mmu_gather_batch local;
Expand Down
1 change: 1 addition & 0 deletions trunk/mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ void tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, bool fullmm)
tlb->mm = mm;

tlb->fullmm = fullmm;
tlb->need_flush_all = 0;
tlb->start = -1UL;
tlb->end = 0;
tlb->need_flush = 0;
Expand Down

0 comments on commit bae4b5c

Please sign in to comment.