/* Mop up any pmd pages which may still be attached to the pgd. Normally they will be freed by munmap/exit_mmap, but any pmd we preallocate which never got a corresponding vma will need to be freed manually.  */
static void pgd_mop_up_pmds(struct mm_struct *mm, pgd_t *pgdp)
/* Mop up any pmd pages which may still be attached to the pgd. Normally they will be freed by munmap/exit_mmap, but any pmd we preallocate which never got a corresponding vma will need to be freed manually.  */
static void pgd_mop_up_pmds(struct mm_struct *mm, pgd_t *pgdp)
{
	int i;
	for(i = 0; i < PREALLOCATED_PMDS; i++) {
		pgd_t pgd = pgdp[i];
		if (pgd_val(pgd) != 0) {
			pmd_t *pmd = (pmd_t *)pgd_page_vaddr(pgd);
			pgdp[i] = native_make_pgd(0);
			paravirt_release_pmd(pgd_val(pgd) >> PAGE_SHIFT);
			pmd_free(mm, pmd);
		}
	}
}