On 2013-10-03 21:33, Christoffer Dall wrote:
On Mon, Sep 23, 2013 at 11:11:07AM +0100, Marc Zyngier wrote:
[...]
+static bool transparent_hugepage_adjust(pfn_t *pfnp, phys_addr_t
*ipap)
+{
pfn_t pfn = *pfnp;gfn_t gfn = *ipap >> PAGE_SHIFT;if (PageTransCompound(pfn_to_page(pfn))) {unsigned long mask;/** mmu_notifier_retry was successful and we holdthe
* mmu_lock here, so the pmd can't becomesplitting
* from under us, and in turn* __split_huge_page_refcount() can't run fromunder
* us and we can safely transfer the refcount from* PG_tail to PG_head as we switch the pfn fromtail to
* head.*/-ECANTPARSE. Well, I sort of can, but this deserves a clearer explanation.
mask = (PMD_SIZE / PAGE_SIZE) - 1;mask = PTRS_PER_PMD -1;
VM_BUG_ON((gfn & mask) != (pfn & mask));if (pfn & mask) {gfn &= ~mask;This doesn't seem to be used later on.
*ipap &= ~(PMD_SIZE - 1);*ipap &= ~PMD_MASK;damn, I trust you too much, you surely meant *ipap &= PMD_MASK;
right?
Indeed. Just keeping you on your toes ;-)
M.