> + n = PAGE_ALIGN(umem->length + (umem->address & ~HPAGE_MASK)) >> > HPAGE_SHIFT;
This is still wrong I think. What if the user, say, registers 1MB that is aligned exactly at a 2MB huge page start? Then wouldn't this expression set n to 0? I think that PAGE_ALIGN() needs to be a "HPAGE_ALIGN()", although of course that doesn't actually exist, so we would need to do "ALIGN(..., HPAGE_SIZE)" instead... but given that we're just going to do ">> HPAGE_SHIFT" afterwards, maybe "DIV_ROUND_UP(..., HPAGE_SIZE)" is a better way to write it. It maybe is needed to make sure that the virtual address requested is aligned appropriately for using bigger pages (although this should always be the case in the current code I guess, since the userspace virtual address always matches the HCA MR virtual address). - R. _______________________________________________ ewg mailing list ewg@lists.openfabrics.org http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg