On Wed, Oct 25, 2006 at 03:35:41AM +0100, Hugh Dickins wrote: > hugetlb_vmtruncate_list was misconverted to prio_tree: its prio_tree is > in units of PAGE_SIZE (PAGE_CACHE_SIZE) like any other, not HPAGE_SIZE > (whereas its radix_tree is kept in units of HPAGE_SIZE, otherwise slots > would be absurdly sparse). > > At first I thought the error benign, just calling __unmap_hugepage_range > on more vmas than necessary; but on 32-bit machines, when the prio_tree > is searched correctly, it happens to ensure the v_offset calculation won't > overflow. As it stood, when truncating at or beyond 4GB, it was liable > to discard pages COWed from lower offsets; or even to clear pmd entries > of preceding vmas, triggering exit_mmap's BUG_ON(nr_ptes). Hugh, I'd like to add a testcase to the libhugetlbfs testsuite which will trigger this bug, but from the description above I'm not sure exactly how to tickle it. Can you give some more details of what sequence of calls will cause the BUG_ON() to be called. I've attached the skeleton test I have now, but I'm not sure if it's even close to what's really required for this. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson