On Mon, Feb 08, 2010 at 05:14:59PM +0000, Mel Gorman wrote: > On Mon, Feb 08, 2010 at 03:24:22PM +1100, David Gibson wrote: > > On Thu, Feb 04, 2010 at 09:02:18PM +0000, Eric B. Munson wrote: > > > elflink.c tests slice boundaries for all architectures, but this is > > > not necessary on x86[_64] as there are no rules for placement of > > > huge pages with respect to small pages. This patch addes a define > > > that will skip this check on x86[_64] builds. > > > > Hrm. The x86 versions of hugetlb_slice_end() and so forth are already > > supposed to make this check a nop. We shouldn't need to ifdef this > > out. > > > > I think the problem may be with the definition of ALIGN_UP > > ALIGN_UP(x,a) (((x) + (a)) & ~((a) - 1)) > > If the address is already aligned, does this definition not mean that > ALIGN_UP will return a value one hugepage higher than it should? Prehaps > the real definition should have been > > ALIGN_UP(x,a) (((x) + (a) - 1) & ~((a) - 1))
Yes, yes it should. That's embarrassing we have ALIGN() correct, but ALIGN_UP() is wrong. > Eric, could you check what the old and rounded values are and see are > the alignment macros screwing things up? If so and the problem is with > ALIGN_UP, try this version. Indeed. I certainly think just removing the check completely for x86 is the wrong fix - those slice functions should work correctly (if trivially) for x86 too. -- 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 ------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com _______________________________________________ Libhugetlbfs-devel mailing list Libhugetlbfs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel