Re: [PATCH 3/3] Guarantee that COW faults for a process thatcalled mmap(MAP_PRIVATE) on hugetlbfs will succeed

From: Adam Litke
Date: Wed May 28 2008 - 14:15:49 EST


On Wed, 2008-05-28 at 17:00 +0100, Mel Gorman wrote:
> [PATCH 4/3] Fix prio tree lookup
>
> I spoke too soon. This is a fix to patch 3/3.
>
> If a child unmaps the start of the VMA, the start address is different and
> that is perfectly legimite making the BUG_ON check bogus and should be removed.
> While page cache lookups are in HPAGE_SIZE, the vma->vm_pgoff is in PAGE_SIZE
> units, not HPAGE_SIZE. The offset calculation needs to be in PAGE_SIZE units
> to find other VMAs that are mapping the same range of pages. This patch
> fixes the offset calculation and adds an explanation comment as to why it
> is different from a page cache lookup.
>
> Credit goes to Johannes Weiner for spotting the bogus BUG_ON on IRC which
> led to the discovery of the faulty offset calculation.
>
> Signed-off-by: Mel Gorman <mel@xxxxxxxxx>

Acked-by: Adam Litke <agl@xxxxxxxxxx>

--
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/