diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2010-08-04 06:55:44 +0000 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2010-08-04 06:55:44 +0000 |
commit | 739176b05ff2d1c5d74df6e7e4112c0845d1b593 (patch) | |
tree | 3e330603ca57e68aceb3707f1fe137f6db3d35e8 /sys-libs | |
parent | Removed old (diff) | |
download | gentoo-2-739176b05ff2d1c5d74df6e7e4112c0845d1b593.tar.gz gentoo-2-739176b05ff2d1c5d74df6e7e4112c0845d1b593.tar.bz2 gentoo-2-739176b05ff2d1c5d74df6e7e4112c0845d1b593.zip |
Bug #330491: version bump. Tune patch to apply to both versions.
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Diffstat (limited to 'sys-libs')
-rw-r--r-- | sys-libs/libhugetlbfs/ChangeLog | 10 | ||||
-rw-r--r-- | sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-fixup-testsuite.patch | 18 | ||||
-rw-r--r-- | sys-libs/libhugetlbfs/libhugetlbfs-2.9.ebuild | 151 |
3 files changed, 159 insertions, 20 deletions
diff --git a/sys-libs/libhugetlbfs/ChangeLog b/sys-libs/libhugetlbfs/ChangeLog index dd51d8435301..a89c06e9f00c 100644 --- a/sys-libs/libhugetlbfs/ChangeLog +++ b/sys-libs/libhugetlbfs/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-libs/libhugetlbfs -# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/libhugetlbfs/ChangeLog,v 1.4 2009/11/04 04:08:48 robbat2 Exp $ +# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-libs/libhugetlbfs/ChangeLog,v 1.5 2010/08/04 06:55:43 robbat2 Exp $ + +*libhugetlbfs-2.9 (04 Aug 2010) + + 04 Aug 2010; Robin H. Johnson <robbat2@gentoo.org> + files/libhugetlbfs-2.6-fixup-testsuite.patch, +libhugetlbfs-2.9.ebuild: + Bug #330491: version bump. Tune patch to apply to both versions. 04 Nov 2009; Robin H. Johnson <robbat2@gentoo.org> libhugetlbfs-2.6.ebuild, +files/libhugetlbfs-2.6-fixup-testsuite.patch: diff --git a/sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-fixup-testsuite.patch b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-fixup-testsuite.patch index de8fed17c475..12548a884a6f 100644 --- a/sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-fixup-testsuite.patch +++ b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-fixup-testsuite.patch @@ -29,21 +29,3 @@ diff -Nuar --exclude '*.S' --exclude Makefile libhugetlbfs-2.6.orig/tests/run_te # Accounting bug tests # reset free hpages because sharing will have held some -@@ -555,7 +561,7 @@ - """ - Run the set of stress tests. - """ -- iterations = 10 # Number of iterations for looping tests -+ iterations = 10 # Number of iterations for looping tests - - # Don't update NRPAGES every time like above because we want to catch the - # failures that happen when the kernel doesn't release all of the huge pages -@@ -570,7 +576,7 @@ - (rc, tot_pages) = total_hpages() - (rc, size) = hpage_size() - sysctls = setup_shm_sysctl(tot_pages * size) -- threads = 10 # Number of threads for shm-fork -+ threads = 10 # Number of threads for shm-fork - # Run shm-fork once using half available hugepages, then once using all - # This is to catch off-by-ones or races in the kernel allocated that - # can make allocating all hugepages a problem diff --git a/sys-libs/libhugetlbfs/libhugetlbfs-2.9.ebuild b/sys-libs/libhugetlbfs/libhugetlbfs-2.9.ebuild new file mode 100644 index 000000000000..4404446674ae --- /dev/null +++ b/sys-libs/libhugetlbfs/libhugetlbfs-2.9.ebuild @@ -0,0 +1,151 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-libs/libhugetlbfs/libhugetlbfs-2.9.ebuild,v 1.1 2010/08/04 06:55:43 robbat2 Exp $ + +EAPI=2 +inherit eutils multilib toolchain-funcs + +DESCRIPTION="easy hugepage access" +HOMEPAGE="http://libhugetlbfs.ozlabs.org/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc64 ~x86" +IUSE="" + +DEPEND="" + +src_prepare() { + epatch "${FILESDIR}"/${PN}-2.6-noexec-stack.patch + epatch "${FILESDIR}"/${PN}-2.6-fixup-testsuite.patch + sed -i \ + -e '/^PREFIX/s:/local::' \ + -e '1iBUILDTYPE = NATIVEONLY' \ + -e '1iV = 1' \ + -e "/^LIB\(32\)/s:=.*:= $(get_libdir):" \ + -e '/^CC\(32\|64\)/s:=.*:= $(CC):' \ + Makefile + if [ "$(get_libdir)" == "lib64" ]; then + sed -i \ + -e "/^LIB\(32\)/s:=.*:= lib32:" \ + Makefile + fi +} + +src_configure() { + : +} + +src_compile() { + tc-export AR CC + emake libs tools || die +} + +src_install() { + emake install DESTDIR="${D}" || die + dodoc HOWTO NEWS README + rm "${D}"/usr/bin/oprofile* +} + +src_test_alloc_one() { + hugeadm="$1" + sign="$2" + pagesize="$3" + pagecount="$4" + ${hugeadm} \ + --pool-pages-max ${pagesize}:${sign}${pagecount} \ + && \ + ${hugeadm} \ + --pool-pages-min ${pagesize}:${sign}${pagecount} + return $? +} + +# die is NOT allowed in this src_test block after the marked point, so that we +# can clean up memory allocation. You'll leak at LEAST 64MiB per run otherwise. +src_test() { + [[ $UID -eq 0 ]] || die "Need FEATURES=-userpriv to run this testsuite" + einfo "Building testsuite" + emake -j1 tests || die "Failed to build tests" + + hugeadm='obj/hugeadm' + allocated='' + rc=0 + # the testcases need 64MiB per pagesize. + MIN_HUGEPAGE_RAM=$((64*1024*1024)) + + einfo "Planning allocation" + PAGESIZES="$(${hugeadm} --page-sizes-all)" + + # Need to do this before we can create the mountpoints. + for pagesize in ${PAGESIZES} ; do + # The kernel depends on the location :-( + mkdir -p /var/lib/hugetlbfs/pagesize-${pagesize} + addwrite /var/lib/hugetlbfs/pagesize-${pagesize} + done + addwrite /proc/sys/vm/ + addwrite /proc/sys/kernel/shmall + addwrite /proc/sys/kernel/shmmax + addwrite /proc/sys/kernel/shmmni + + einfo "Checking HugeTLB mountpoints" + ${hugeadm} --create-mounts || die "Failed to set up hugetlb mountpoints." + + # ----------------------------------------------------- + # --------- die is unsafe after this point. ----------- + # ----------------------------------------------------- + + einfo "Starting allocation" + for pagesize in ${PAGESIZES} ; do + pagecount=$((${MIN_HUGEPAGE_RAM}/${pagesize})) + einfo " ${pagecount} @ ${pagesize}" + addwrite /var/lib/hugetlbfs/pagesize-${pagesize} + src_test_alloc_one "$hugeadm" "+" "${pagesize}" "${pagecount}" + rc=$? + if [[ $rc -eq 0 ]]; then + allocated="${allocated} ${pagesize}:${pagecount}" + else + eerror "Failed to add ${pagecount} pages of size ${pagesize}" + fi + done + + einfo "Allocation status" + ${hugeadm} --pool-list + + if [[ -n "${allocated}" ]]; then + # All our allocations worked, so time to run. + einfo "Starting tests" + cd "${S}"/tests + TESTOPTS="-t func" + case $ARCH in + amd64|ppc64) + TESTOPTS="${TESTOPTS} -b 64" + ;; + x86) + TESTOPTS="${TESTOPTS} -b 32" + ;; + esac + # This needs a bit of work to give a nice exit code still. + ./run_tests.py ${TESTOPTS} + rc=$? + else + eerror "Failed to make HugeTLB allocations." + rc=1 + fi + + einfo "Cleaning up memory" + cd "${S}" + # Cleanup memory allocation + for alloc in ${allocated} ; do + pagesize="${alloc/:*}" + pagecount="${alloc/*:}" + einfo " ${pagecount} @ ${pagesize}" + src_test_alloc_one "$hugeadm" "-" "${pagesize}" "${pagecount}" + done + + # --------------------------------------------------------- + # --------- die is safe again after this point. ----------- + # --------------------------------------------------------- + + return $rc +} |