scripts: mkbootimg_rpi4: Fix url path to tizen_7.0
[platform/kernel/linux-rpi.git] / mm / khugepaged.c
index 3399d49..f88ad1b 100644 (file)
@@ -1851,6 +1851,12 @@ void collapse_pte_mapped_thp(struct mm_struct *mm, unsigned long addr)
                goto drop_hpage;
 
        start_pte = pte_offset_map_lock(mm, pmd, haddr, &ptl);
+#ifdef CONFIG_FINEGRAINED_THP
+       if (pte_cont(*start_pte)) {
+               pte_unmap_unlock(start_pte, ptl);
+               goto drop_hpage;
+       }
+#endif
 
        /* step 1: check all mapped PTEs are to the right huge page */
        for (i = 0, addr = haddr, pte = start_pte;
@@ -2723,7 +2729,7 @@ static unsigned int khugepaged_scan_vma(struct mm_struct *mm,
                BUG();
 
        while (khugepaged_scan.address < hend) {
-               if (khugepaged_scan.address + hpage_size >= hend) {
+               if (khugepaged_scan.address + hpage_size > hend) {
                        if (khugepaged_scan.address + HPAGE_CONT_PTE_SIZE < hend) {
                                hpage_size = HPAGE_CONT_PTE_SIZE;
                                hpage_nr = HPAGE_CONT_PTE_NR;