memory.c (22b31eec63e5f2e219a3ee15f456897272bc73e8) memory.c (2509ef26db4699a5d9fa876e90ddfc107afcab84)
1/*
2 * linux/mm/memory.c
3 *
4 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
5 */
6
7/*
8 * demand-loading started 01.12.91 - seems it is high on the list of

--- 796 unchanged lines hidden (view full) ---

805 continue;
806 }
807 /*
808 * If details->check_mapping, we leave swap entries;
809 * if details->nonlinear_vma, we leave file entries.
810 */
811 if (unlikely(details))
812 continue;
1/*
2 * linux/mm/memory.c
3 *
4 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
5 */
6
7/*
8 * demand-loading started 01.12.91 - seems it is high on the list of

--- 796 unchanged lines hidden (view full) ---

805 continue;
806 }
807 /*
808 * If details->check_mapping, we leave swap entries;
809 * if details->nonlinear_vma, we leave file entries.
810 */
811 if (unlikely(details))
812 continue;
813 if (!pte_file(ptent))
814 free_swap_and_cache(pte_to_swp_entry(ptent));
813 if (pte_file(ptent)) {
814 if (unlikely(!(vma->vm_flags & VM_NONLINEAR)))
815 print_bad_pte(vma, addr, ptent, NULL);
816 } else if
817 (unlikely(!free_swap_and_cache(pte_to_swp_entry(ptent))))
818 print_bad_pte(vma, addr, ptent, NULL);
815 pte_clear_not_present_full(mm, addr, pte, tlb->fullmm);
816 } while (pte++, addr += PAGE_SIZE, (addr != end && *zap_work > 0));
817
818 add_mm_rss(mm, file_rss, anon_rss);
819 arch_leave_lazy_mmu_mode();
820 pte_unmap_unlock(pte - 1, ptl);
821
822 return addr;

--- 1879 unchanged lines hidden (view full) ---

2702{
2703 unsigned int flags = FAULT_FLAG_NONLINEAR |
2704 (write_access ? FAULT_FLAG_WRITE : 0);
2705 pgoff_t pgoff;
2706
2707 if (!pte_unmap_same(mm, pmd, page_table, orig_pte))
2708 return 0;
2709
819 pte_clear_not_present_full(mm, addr, pte, tlb->fullmm);
820 } while (pte++, addr += PAGE_SIZE, (addr != end && *zap_work > 0));
821
822 add_mm_rss(mm, file_rss, anon_rss);
823 arch_leave_lazy_mmu_mode();
824 pte_unmap_unlock(pte - 1, ptl);
825
826 return addr;

--- 1879 unchanged lines hidden (view full) ---

2706{
2707 unsigned int flags = FAULT_FLAG_NONLINEAR |
2708 (write_access ? FAULT_FLAG_WRITE : 0);
2709 pgoff_t pgoff;
2710
2711 if (!pte_unmap_same(mm, pmd, page_table, orig_pte))
2712 return 0;
2713
2710 if (unlikely(!(vma->vm_flags & VM_NONLINEAR) ||
2711 !(vma->vm_flags & VM_CAN_NONLINEAR))) {
2714 if (unlikely(!(vma->vm_flags & VM_NONLINEAR))) {
2712 /*
2713 * Page table corrupted: show pte and kill process.
2714 */
2715 print_bad_pte(vma, address, orig_pte, NULL);
2716 return VM_FAULT_OOM;
2717 }
2718
2719 pgoff = pte_to_pgoff(orig_pte);

--- 414 unchanged lines hidden ---
2715 /*
2716 * Page table corrupted: show pte and kill process.
2717 */
2718 print_bad_pte(vma, address, orig_pte, NULL);
2719 return VM_FAULT_OOM;
2720 }
2721
2722 pgoff = pte_to_pgoff(orig_pte);

--- 414 unchanged lines hidden ---