RE: [PATCH 2/3] hugetlb: fix prio_tree unit

Chen, Kenneth W
2006-10-26T06:15:23Z

David Gibson wrote on Wednesday, October 25, 2006 8:48 PM
> On Wed, Oct 25, 2006 at 04:49:29PM -0700, Chen, Kenneth W wrote:
> > It's fairly easy to reproduce. I got a test cases that easily trigger
> > kernel oops and even got a sequence to screw up hugepage_rsvd count.
> > All I have to do is to place vm_start high enough and combined with large
> > enough v_offset, the add "vma->vm_start + v_offset" will overflow. It
> > doesn't even need to be over 4GB.
> >
> > Hugh, if you haven't got time to reconstruct the bug sequence, don't
> > bother. I'll give my test cases to David.
>
> I don't really understand your case1.c, though. It didn't cause any
> oops on my laptop (i386) and I couldn't see what else was expected to
> behave differently between the "pass" and "fail" cases. It returns an
> uninitialized variable as exit code, btw..

Yeah, case1 looked bogus by itself. I must have some other combination
which I now unfortunately unable to recall. This was the one that mess
up with hugepages_rsvd count. I won't pursue this any further given that
there are two other working test cases.

> So, I've integrated both Hugh's testcase and case2.c into the
> libhugetlbfs testsuite. A patch to libhugetlbfs is below. It would
> be good if we could get Signed-off-by lines for it from Hugh and
> Kenneth, to keep the lawyer types happy, then Adam should be able to
> merge it into libhugetlbfs.

map_high_truncate_2.c looks fine.
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>