Re: [PATCH v7 1/3] mm/madvise: introduce clear_young_dirty_ptes() batch helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey David, Ryan,

How about this change?

static inline void clear_young_dirty_ptes(struct vm_area_struct *vma,
					  unsigned long addr, pte_t *ptep,
					  unsigned int nr, cydp_t flags)
{
	if (flags == CYDP_CLEAR_YOUNG) {
		for (;;) {
			ptep_test_and_clear_young(vma, addr, ptep);
			if (--nr == 0)
				break;
			ptep++;
			addr += PAGE_SIZE;
		}
		return;
	}

	pte_t pte;

	for (;;) {
		pte = ptep_get_and_clear(vma->vm_mm, addr, ptep);

		if (flags & CYDP_CLEAR_YOUNG)
			pte = pte_mkold(pte);
		if (flags & CYDP_CLEAR_DIRTY)
			pte = pte_mkclean(pte);

		if (--nr == 0)
			break;
		ptep++;
		addr += PAGE_SIZE;
	}
}

Thanks,
Lance




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux