summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Yao <ryao@gentoo.org>2012-07-10 00:26:07 +0000
committerRichard Yao <ryao@gentoo.org>2012-07-10 00:26:07 +0000
commit33c34b7deae3c43117e1c1a6c7f185826b213e0e (patch)
tree99c7a1bb261005da3f92b79995d657bd6760eda1 /sys-kernel/spl
parentKeyword amd64-linux, x86-linux, updated home page and download url (diff)
downloadgentoo-2-33c34b7deae3c43117e1c1a6c7f185826b213e0e.tar.gz
gentoo-2-33c34b7deae3c43117e1c1a6c7f185826b213e0e.tar.bz2
gentoo-2-33c34b7deae3c43117e1c1a6c7f185826b213e0e.zip
Make KM_SLEEP an alias of KM_PUSHPAGE like it is in FreeBSD
(Portage version: 2.1.10.65/cvs/Linux x86_64)
Diffstat (limited to 'sys-kernel/spl')
-rw-r--r--sys-kernel/spl/ChangeLog9
-rw-r--r--sys-kernel/spl/files/spl-0.6.0_rc9-alias-km-sleep-with-km-pushpage.patch56
-rw-r--r--sys-kernel/spl/spl-0.6.0_rc9-r2.ebuild91
-rw-r--r--sys-kernel/spl/spl-9999.ebuild3
4 files changed, 157 insertions, 2 deletions
diff --git a/sys-kernel/spl/ChangeLog b/sys-kernel/spl/ChangeLog
index 1789eb30b02e..f3ae644c73a1 100644
--- a/sys-kernel/spl/ChangeLog
+++ b/sys-kernel/spl/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-kernel/spl
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-kernel/spl/ChangeLog,v 1.21 2012/06/25 17:54:06 ryao Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/spl/ChangeLog,v 1.22 2012/07/10 00:26:07 ryao Exp $
+
+*spl-0.6.0_rc9-r2 (10 Jul 2012)
+
+ 10 Jul 2012; Richard Yao <ryao@gentoo.org>
+ +files/spl-0.6.0_rc9-alias-km-sleep-with-km-pushpage.patch,
+ +spl-0.6.0_rc9-r2.ebuild, spl-9999.ebuild:
+ Make KM_SLEEP an alias of KM_PUSHPAGE like it is in FreeBSD
*spl-0.6.0_rc9-r1 (25 Jun 2012)
diff --git a/sys-kernel/spl/files/spl-0.6.0_rc9-alias-km-sleep-with-km-pushpage.patch b/sys-kernel/spl/files/spl-0.6.0_rc9-alias-km-sleep-with-km-pushpage.patch
new file mode 100644
index 000000000000..fb0e5914e773
--- /dev/null
+++ b/sys-kernel/spl/files/spl-0.6.0_rc9-alias-km-sleep-with-km-pushpage.patch
@@ -0,0 +1,56 @@
+From 5c072b45b66e841ebc7952db7860c2ee7b024b08 Mon Sep 17 00:00:00 2001
+From: Richard Yao <ryao@cs.stonybrook.edu>
+Date: Mon, 25 Jun 2012 20:05:00 -0400
+Subject: [PATCH] Make KM_SLEEP an alias of KM_PUSHPAGE Use GFP_NOIO in
+ KM_SLEEP
+
+This should prevent direct reclaim issues without requiring
+Linux-specific changes to code from Solaris. This is what is done in
+FreeBSD.
+
+Note that a change to __taskq_dispatch() module/spl/spl-taskq.c is
+needed to make this work. Changing KM_PUSHPAGE to use GFP_NOIO is fine,
+but adding __GFP_HIGH to that triggers a hard-coded panic in
+__taskq_dispatch() during zvol initialization. Removing the hard coded
+panic has no ill effects.
+
+Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
+---
+ include/sys/kmem.h | 2 +-
+ module/spl/spl-taskq.c | 7 ++++---
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/include/sys/kmem.h b/include/sys/kmem.h
+index 796af44..633278b 100644
+--- a/include/sys/kmem.h
++++ b/include/sys/kmem.h
+@@ -41,7 +41,7 @@
+ /*
+ * Memory allocation interfaces
+ */
+-#define KM_SLEEP GFP_KERNEL /* Can sleep, never fails */
++#define KM_SLEEP (GFP_NOIO | __GFP_HIGH) /* Can sleep, never fails */
+ #define KM_NOSLEEP GFP_ATOMIC /* Can not sleep, may fail */
+ #define KM_PUSHPAGE (GFP_NOIO | __GFP_HIGH) /* Use reserved memory */
+ #define KM_NODEBUG __GFP_NOWARN /* Suppress warnings */
+diff --git a/module/spl/spl-taskq.c b/module/spl/spl-taskq.c
+index 0c546c7..5ab387e 100644
+--- a/module/spl/spl-taskq.c
++++ b/module/spl/spl-taskq.c
+@@ -255,9 +255,10 @@
+ if (!(flags & (TQ_SLEEP | TQ_NOSLEEP)))
+ flags |= TQ_SLEEP;
+
+- if (unlikely(in_atomic() && (flags & TQ_SLEEP)))
+- PANIC("May schedule while atomic: %s/0x%08x/%d\n",
+- current->comm, preempt_count(), current->pid);
++ /* FIXME: Why does this fail when KM_SLEEP contains __GFP_HIGHMEM? */
++ //if (unlikely(in_atomic() && (flags & TQ_SLEEP)))
++ // PANIC("May schedule while atomic: %s/0x%08x/%d\n",
++ // current->comm, preempt_count(), current->pid);
+
+ spin_lock_irqsave(&tq->tq_lock, tq->tq_lock_flags);
+
+--
+1.7.10
+
diff --git a/sys-kernel/spl/spl-0.6.0_rc9-r2.ebuild b/sys-kernel/spl/spl-0.6.0_rc9-r2.ebuild
new file mode 100644
index 000000000000..39ab00567ef2
--- /dev/null
+++ b/sys-kernel/spl/spl-0.6.0_rc9-r2.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/spl/spl-0.6.0_rc9-r2.ebuild,v 1.1 2012/07/10 00:26:07 ryao Exp $
+
+EAPI="4"
+AUTOTOOLS_AUTORECONF="1"
+
+inherit flag-o-matic linux-mod autotools-utils
+
+if [[ ${PV} == "9999" ]] ; then
+ inherit git-2
+ EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/downloads/zfsonlinux/${PN}/${PN}-${MY_PV}.tar.gz"
+ S="${WORKDIR}/${PN}-${MY_PV}"
+ KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="The Solaris Porting Layer is a Linux kernel module which provides many of the Solaris kernel APIs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="|| ( GPL-2 GPL-3 )"
+SLOT="0"
+IUSE="custom-cflags debug"
+
+RDEPEND="!sys-devel/spl"
+
+AT_M4DIR="config"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+pkg_setup() {
+ CONFIG_CHECK="
+ !DEBUG_LOCK_ALLOC
+ !GRKERNSEC_HIDESYM
+ !PREEMPT
+ !PREEMPT_VOLUNTARY
+ MODULES
+ KALLSYMS
+ ZLIB_DEFLATE
+ ZLIB_INFLATE
+ "
+ kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required"
+ check_extra_config
+}
+
+src_prepare() {
+ # Workaround for hard coded path
+ sed -i "s|/sbin/lsmod|/bin/lsmod|" scripts/check.sh || die
+
+ if [ ${PV} != "9999" ]
+ then
+ epatch "${FILESDIR}/${P}-detect-kernel-honors-gfp-flags.patch"
+ epatch "${FILESDIR}/${P}-constify-free-functions.patch"
+ epatch "${FILESDIR}/${P}-alias-km-sleep-with-km-pushpage.patch"
+ fi
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ set_arch_to_kernel
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=all
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ $(use_enable debug)
+ )
+ autotools-utils_src_configure
+}
+
+src_test() {
+ if [[ ! -e /proc/modules ]]
+ then
+ die "Missing /proc/modules"
+ elif [[ $UID -ne 0 ]]
+ then
+ ewarn "Cannot run make check tests with FEATURES=userpriv."
+ ewarn "Skipping make check tests."
+ elif grep -q '^spl ' /proc/modules
+ then
+ ewarn "Cannot run make check tests with module spl loaded."
+ ewarn "Skipping make check tests."
+ else
+ autotools-utils_src_test
+ fi
+}
diff --git a/sys-kernel/spl/spl-9999.ebuild b/sys-kernel/spl/spl-9999.ebuild
index 5dd693a9623e..1b482f6d4c80 100644
--- a/sys-kernel/spl/spl-9999.ebuild
+++ b/sys-kernel/spl/spl-9999.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-kernel/spl/spl-9999.ebuild,v 1.19 2012/06/25 17:54:06 ryao Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/spl/spl-9999.ebuild,v 1.20 2012/07/10 00:26:07 ryao Exp $
EAPI="4"
AUTOTOOLS_AUTORECONF="1"
@@ -53,6 +53,7 @@ src_prepare() {
then
epatch "${FILESDIR}/${P}-detect-kernel-honors-gfp-flags.patch"
epatch "${FILESDIR}/${P}-constify-free-functions.patch"
+ epatch "${FILESDIR}/${P}-alias-km-sleep-with-km-pushpage.patch"
fi
autotools-utils_src_prepare