|
@@ -235,6 +235,9 @@ void tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, unsigned long
|
|
|
|
|
|
static void tlb_flush_mmu_tlbonly(struct mmu_gather *tlb)
|
|
|
{
|
|
|
+ if (!tlb->end)
|
|
|
+ return;
|
|
|
+
|
|
|
tlb_flush(tlb);
|
|
|
mmu_notifier_invalidate_range(tlb->mm, tlb->start, tlb->end);
|
|
|
#ifdef CONFIG_HAVE_RCU_TABLE_FREE
|
|
@@ -247,7 +250,7 @@ static void tlb_flush_mmu_free(struct mmu_gather *tlb)
|
|
|
{
|
|
|
struct mmu_gather_batch *batch;
|
|
|
|
|
|
- for (batch = &tlb->local; batch; batch = batch->next) {
|
|
|
+ for (batch = &tlb->local; batch && batch->nr; batch = batch->next) {
|
|
|
free_pages_and_swap_cache(batch->pages, batch->nr);
|
|
|
batch->nr = 0;
|
|
|
}
|
|
@@ -256,9 +259,6 @@ static void tlb_flush_mmu_free(struct mmu_gather *tlb)
|
|
|
|
|
|
void tlb_flush_mmu(struct mmu_gather *tlb)
|
|
|
{
|
|
|
- if (!tlb->end)
|
|
|
- return;
|
|
|
-
|
|
|
tlb_flush_mmu_tlbonly(tlb);
|
|
|
tlb_flush_mmu_free(tlb);
|
|
|
}
|