summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-kernel/spl/files/spl-0.6.0_rc9-detect-kernel-honors-gfp-flags.patch')
-rw-r--r--sys-kernel/spl/files/spl-0.6.0_rc9-detect-kernel-honors-gfp-flags.patch91
1 files changed, 0 insertions, 91 deletions
diff --git a/sys-kernel/spl/files/spl-0.6.0_rc9-detect-kernel-honors-gfp-flags.patch b/sys-kernel/spl/files/spl-0.6.0_rc9-detect-kernel-honors-gfp-flags.patch
deleted file mode 100644
index ac10de7a8f17..000000000000
--- a/sys-kernel/spl/files/spl-0.6.0_rc9-detect-kernel-honors-gfp-flags.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 35f75553b720037eb7ef6ac9954c14f7d9c1b4e5 Mon Sep 17 00:00:00 2001
-From: Richard Yao <ryao@cs.stonybrook.edu>
-Date: Wed, 6 Jun 2012 22:38:12 -0400
-Subject: [PATCH] Detect kernels that honor gfp flags passed to vmalloc()
-
-zfsonlinux/spl@2092cf68d89a51eb0d6193aeadabb579dfc4b4a0 used PF_MEMALLOC
-to workaround a bug in the Linux kernel where allocations did not honor
-the gfp flags passed to vmalloc(). Unfortunately, PF_MEMALLOC has the
-side effect of permitting allocations to allocate pages outside of
-ZONE_NORMAL. This has been observed to result in the depletion of
-ZONE_DMA32 on Gentoo Linux. A kernel patch is available in the Gentoo
-bug tracker for this issue:
-
-https://bugs.gentoo.org/show_bug.cgi?id=416685
-
-This negates any benefit PF_MEMALLOC provides, so we introduce an
-autotools check to disable the use of PF_MEMALLOC on systems with
-patched kernels.
-
-Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
----
- config/spl-build.m4 | 26 ++++++++++++++++++++++++++
- module/spl/spl-kmem.c | 4 ++++
- 2 files changed, 30 insertions(+)
-
-diff --git a/config/spl-build.m4 b/config/spl-build.m4
-index 6605b82..29c7ae4 100644
---- a/config/spl-build.m4
-+++ b/config/spl-build.m4
-@@ -87,6 +87,7 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
- SPL_AC_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE
- SPL_AC_SHRINK_CONTROL_STRUCT
- SPL_AC_RWSEM_SPINLOCK_IS_RAW
-+ SPL_AC_PMD_ALLOC_WITH_MASK
- ])
-
- AC_DEFUN([SPL_AC_MODULE_SYMVERS], [
-@@ -2056,3 +2057,28 @@ AC_DEFUN([SPL_AC_RWSEM_SPINLOCK_IS_RAW], [
- ])
- EXTRA_KCFLAGS="$tmp_flags"
- ])
-+
-+dnl #
-+dnl # 2.6.20 API change,
-+dnl # INIT_WORK use 2 args and not store data inside
-+dnl #
-+AC_DEFUN([SPL_AC_PMD_ALLOC_WITH_MASK],
-+ [AC_MSG_CHECKING([whether pmd_alloc_with_mask exists])
-+ SPL_LINUX_TRY_COMPILE([
-+ #define CONFIG_MMU
-+ #undef RCH_HAS_4LEVEL_HACK
-+ #include <linux/mm.h>
-+ ],[
-+ struct mm_struct init_mm;
-+ pud_t pud;
-+ unsigned long addr;
-+ gfp_t gfp_mask;
-+ pmd_alloc_with_mask(&init_mm, &pud, addr, gfp_mask);
-+ ],[
-+ AC_MSG_RESULT(yes)
-+ AC_DEFINE(HAVE_PMD_ALLOC_WITH_MASK, 1,
-+ [pmd_alloc_with_mask exists])
-+ ],[
-+ AC_MSG_RESULT(no)
-+ ])
-+])
-diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c
-index e1d74d3..c640779 100644
---- a/module/spl/spl-kmem.c
-+++ b/module/spl/spl-kmem.c
-@@ -843,6 +843,9 @@ static int spl_cache_flush(spl_kmem_cache_t *skc,
- if (skc->skc_flags & KMC_KMEM) {
- ptr = (void *)__get_free_pages(flags, get_order(size));
- } else {
-+#ifdef HAVE_PMD_ALLOC_WITH_MASK
-+ ptr = __vmalloc(size, flags|__GFP_HIGHMEM, PAGE_KERNEL);
-+#else
- /*
- * As part of vmalloc() an __pte_alloc_kernel() allocation
- * may occur. This internal allocation does not honor the
-@@ -866,6 +869,7 @@ static int spl_cache_flush(spl_kmem_cache_t *skc,
- } else {
- ptr = __vmalloc(size, flags|__GFP_HIGHMEM, PAGE_KERNEL);
- }
-+#endif
- }
-
- /* Resulting allocated memory will be page aligned */
---
-1.7.10
-