Skip to contentSkip to conversation

Hugepages don't work on the Xen Linux git tree

DISCUSSION Dave McCracken 2 participants 2 messages Apr 20, 2010

lore
Share & tools
lore
#0 lore raw

I hadn't actually tested mainline Linux or the Xen Linux git tree in awhile, since we're focusing on RedHat released versions. When I actually tried to use it today it fell over dead as soon as I tried to map a hugepage.

The current method for mapping hugepages does not work at all with Xen. We have set_huge_pte_at() in arch/x86/include/asm/hugetlb.h which does a set_pte_at(), but passes it a pmd pointer and a pmd entry. This will succeed on a native Linux kernel, but after passing through the paravirt vector to xen_set_pte_at(), it fails miserably. It expects HYPERVISOR_update_va_mapping() to do the right thing and it doesn't.

The fix I have in older kernels is for set_huge_pte_at() to call set_pmd() instead. However, in this brave new world of paravirt vectors, should I instead set up a vector for it? What is the architecturally right thing to do? However we decide to do it, expect a patch for it shortly afterward.

Thanks,
Dave McCracken

#1 lore raw
Quoted 5 lines · Dave McCracken

The fix I have in older kernels is for set_huge_pte_at() to call set_pmd() instead. However, in this brave new world of paravirt vectors, should I instead set up a vector for it? What is the architecturally right thing to do? However we decide to do it, expect a patch for it shortly afterward.

Yeah, its a bit awkward. A huge pte is semantically a pte, but structurally a pmd, so which should it be? The perhaps "cleanest" fix might be to add a set of huge pte operators, but I don't think that's really justified given that this is a fairly specific, narrow case.

I think on balance the best thing is to make set_huge_pte_at() call set_pmd().

J