mm/mmu_gather: define ENCODED_PAGE_FLAG_DELAY_RMAP
[linux-2.6-microblaze.git] / mm / mmu_gather.c
index ac733d8..6540c99 100644 (file)
@@ -53,7 +53,7 @@ static void tlb_flush_rmap_batch(struct mmu_gather_batch *batch, struct vm_area_
        for (int i = 0; i < batch->nr; i++) {
                struct encoded_page *enc = batch->encoded_pages[i];
 
-               if (encoded_page_flags(enc)) {
+               if (encoded_page_flags(enc) & ENCODED_PAGE_BIT_DELAY_RMAP) {
                        struct page *page = encoded_page_ptr(enc);
                        folio_remove_rmap_pte(page_folio(page), page, vma);
                }
@@ -119,6 +119,7 @@ static void tlb_batch_list_free(struct mmu_gather *tlb)
 bool __tlb_remove_page_size(struct mmu_gather *tlb, struct page *page,
                bool delay_rmap, int page_size)
 {
+       int flags = delay_rmap ? ENCODED_PAGE_BIT_DELAY_RMAP : 0;
        struct mmu_gather_batch *batch;
 
        VM_BUG_ON(!tlb->end);
@@ -132,7 +133,7 @@ bool __tlb_remove_page_size(struct mmu_gather *tlb, struct page *page,
         * Add the page and check if we are full. If so
         * force a flush.
         */
-       batch->encoded_pages[batch->nr++] = encode_page(page, delay_rmap);
+       batch->encoded_pages[batch->nr++] = encode_page(page, flags);
        if (batch->nr == batch->max) {
                if (!tlb_next_batch(tlb))
                        return true;