Imported Upstream version 0.6.5.4

This commit is contained in:
Aron Xu 2016-01-10 20:13:12 +08:00
parent f6188ddded
commit 879bbbc725
16 changed files with 110 additions and 95 deletions

2
META
View File

@ -1,7 +1,7 @@
Meta: 1
Name: spl
Branch: 1.0
Version: 0.6.5.3
Version: 0.6.5.4
Release: 1
Release-Tags: relext
License: GPL

View File

@ -673,11 +673,13 @@ AC_DEFUN([SPL_AC_TEST_MODULE],
fi
])
AS_IF([test "x$cross_compiling" != xyes], [
AC_RUN_IFELSE([
AC_LANG_PROGRAM([
#include "$LINUX/include/linux/license.h"
], [
return !license_is_gpl_compatible("$SPL_META_LICENSE");
return !license_is_gpl_compatible(
"$SPL_META_LICENSE");
])
], [
AC_DEFINE([SPL_IS_GPL_COMPATIBLE], [1],
@ -685,6 +687,7 @@ AC_DEFUN([SPL_AC_TEST_MODULE],
], [
])
])
])
dnl #
dnl # Use the atomic implemenation based on global spinlocks. This

34
configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.68 for spl 0.6.5.3.
# Generated by GNU Autoconf 2.68 for spl 0.6.5.4.
#
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@ -567,8 +567,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='spl'
PACKAGE_TARNAME='spl'
PACKAGE_VERSION='0.6.5.3'
PACKAGE_STRING='spl 0.6.5.3'
PACKAGE_VERSION='0.6.5.4'
PACKAGE_STRING='spl 0.6.5.4'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@ -1357,7 +1357,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures spl 0.6.5.3 to adapt to many kinds of systems.
\`configure' configures spl 0.6.5.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1428,7 +1428,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of spl 0.6.5.3:";;
short | recursive ) echo "Configuration of spl 0.6.5.4:";;
esac
cat <<\_ACEOF
@ -1545,7 +1545,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
spl configure 0.6.5.3
spl configure 0.6.5.4
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@ -1823,7 +1823,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by spl $as_me 0.6.5.3, which was
It was created by spl $as_me 0.6.5.4, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@ -2947,7 +2947,7 @@ fi
# Define the identity of the package.
PACKAGE='spl'
VERSION='0.6.5.3'
VERSION='0.6.5.4'
cat >>confdefs.h <<_ACEOF
@ -12033,6 +12033,8 @@ fi
if test "x$cross_compiling" != xyes; then :
if test "$cross_compiling" = yes; then :
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
@ -12049,7 +12051,8 @@ int
main ()
{
return !license_is_gpl_compatible("$SPL_META_LICENSE");
return !license_is_gpl_compatible(
"$SPL_META_LICENSE");
;
return 0;
@ -12068,6 +12071,8 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
fi
fi
# Check whether --enable-atomic-spinlocks was given.
if test "${enable_atomic_spinlocks+set}" = set; then :
@ -14603,6 +14608,8 @@ fi
if test "x$cross_compiling" != xyes; then :
if test "$cross_compiling" = yes; then :
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
@ -14619,7 +14626,8 @@ int
main ()
{
return !license_is_gpl_compatible("$SPL_META_LICENSE");
return !license_is_gpl_compatible(
"$SPL_META_LICENSE");
;
return 0;
@ -14638,6 +14646,8 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
fi
fi
# Check whether --enable-atomic-spinlocks was given.
if test "${enable_atomic_spinlocks+set}" = set; then :
@ -17452,7 +17462,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by spl $as_me 0.6.5.3, which was
This file was extended by spl $as_me 0.6.5.4, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -17518,7 +17528,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
spl config.status 0.6.5.3
spl config.status 0.6.5.4
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"

View File

@ -56,6 +56,8 @@ adjust_obj_paths()
for MODULE in "${MODULES[@]}"
do
adjust_obj_paths "$KERNEL_DIR/spl/$MODULE/Makefile"
sed -i.bak '/obj =/d' "$KERNEL_DIR/spl/$MODULE/Makefile"
sed -i.bak '/src =/d' "$KERNEL_DIR/spl/$MODULE/Makefile"
done
cat > "$KERNEL_DIR/spl/Kconfig" <<"EOF"
@ -112,8 +114,9 @@ add_after()
}
add_after "$KERNEL_DIR/Kconfig" 'source "arch/$SRCARCH/Kconfig"' 'source "spl/Kconfig"'
# We must take care to build SPL before ZFS, else module initialization order will be wrong
sed -i 's#kernel/ mm/ fs/#kernel/ mm/ spl/ fs/#' "$KERNEL_DIR/Makefile"
# We must take care to build SPL before ZFS, otherwise the symbols required
# to link ZFS will not be available.
sed -i 's#+= kernel/#+= kernel/ spl/#' "$KERNEL_DIR/Makefile"
echo >&2
echo " $0: done." >&2

View File

@ -60,7 +60,7 @@
#endif
/* powerpc (ppc64) arch specific defines */
#elif defined(__powerpc) || defined(__powerpc__)
#elif defined(__powerpc) || defined(__powerpc__) || defined(__powerpc64__)
#if !defined(__powerpc)
#define __powerpc
@ -70,9 +70,15 @@
#define __powerpc__
#endif
#if defined(__powerpc64__)
#if !defined(_LP64)
#define _LP64
#endif
#else
#if !defined(_ILP32)
#define _ILP32
#endif
#endif
/* arm arch specific defines */
#elif defined(__arm) || defined(__arm__) || defined(__aarch64__)
@ -85,6 +91,16 @@
#define __arm__
#endif
#if defined(__aarch64__)
#if !defined(_LP64)
#define _LP64
#endif
#else
#if !defined(_ILP32)
#define _ILP32
#endif
#endif
#if defined(__ARMEL__) || defined(__AARCH64EL__)
#define _LITTLE_ENDIAN
#else
@ -102,18 +118,14 @@
#define __sparc__
#endif
#define _BIG_ENDIAN
#define _SUNOS_VTOC_16
/* sparc64 arch specific defines */
#elif defined(__sparc64) || defined(__sparc64__)
#if !defined(__sparc64)
#define __sparc64
#if defined(__arch64__)
#if !defined(_LP64)
#define _LP64
#endif
#else
#if !defined(_ILP32)
#define _ILP32
#endif
#if !defined(__sparc64__)
#define __sparc64__
#endif
#define _BIG_ENDIAN
@ -127,6 +139,10 @@
#error "Both _ILP32 and _LP64 are defined"
#endif
#if !defined(_ILP32) && !defined(_LP64)
#error "Neither _ILP32 or _LP64 are defined"
#endif
#include <sys/byteorder.h>
#if defined(__LITTLE_ENDIAN) && !defined(_LITTLE_ENDIAN)

View File

@ -186,7 +186,7 @@ extern void spl_cleanup(void);
*/
#define P2ALIGN(x, align) ((x) & -(align))
#define P2CROSS(x, y, align) (((x) ^ (y)) > (align) - 1)
#define P2ROUNDUP(x, align) (-(-(x) & -(align)))
#define P2ROUNDUP(x, align) ((((x) - 1) | ((align) - 1)) + 1)
#define P2PHASE(x, align) ((x) & ((align) - 1))
#define P2NPHASE(x, align) (-(x) & ((align) - 1))
#define ISP2(x) (((x) & ((x) - 1)) == 0)
@ -213,7 +213,7 @@ extern void spl_cleanup(void);
#define P2NPHASE_TYPED(x, align, type) \
(-(type)(x) & ((type)(align) - 1))
#define P2ROUNDUP_TYPED(x, align, type) \
(-(-(type)(x) & -(type)(align)))
((((type)(x) - 1) | ((type)(align) - 1)) + 1)
#define P2END_TYPED(x, align, type) \
(-(~(type)(x) & -(type)(align)))
#define P2PHASEUP_TYPED(x, align, phase, type) \

View File

@ -46,7 +46,7 @@
#define MSEC2NSEC(m) ((hrtime_t)(m) * (NANOSEC / MILLISEC))
#define NSEC2MSEC(n) ((n) / (NANOSEC / MILLISEC))
#define hz HZ
static const int hz = HZ;
#define TIMESPEC_OVERFLOW(ts) \
((ts)->tv_sec < TIME_MIN || (ts)->tv_sec > TIME_MAX)

View File

@ -36,7 +36,6 @@ extern vmem_t *zio_alloc_arena;
extern vmem_t *zio_arena;
extern size_t vmem_size(vmem_t *vmp, int typemask);
extern void *spl_vmalloc(unsigned long size, gfp_t lflags, pgprot_t prot);
/*
* Memory allocation interfaces

View File

@ -26,7 +26,7 @@ modules_install:
KERNELRELEASE=@LINUX_VERSION@
@# Remove extraneous build products when packaging
kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \
if [ -n $$kmoddir ]; then \
if [ -n "$(DESTDIR)" ]; then \
find $$kmoddir -name 'modules.*' | xargs $(RM); \
fi
sysmap=$(DESTDIR)$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \

View File

@ -31,6 +31,7 @@
#include <linux/swap.h>
#include <linux/mm_compat.h>
#include <linux/wait_compat.h>
#include <linux/prefetch.h>
/*
* Within the scope of spl-kmem.c file the kmem_cache_* definitions
@ -200,7 +201,7 @@ kv_alloc(spl_kmem_cache_t *skc, int size, int flags)
ASSERT(ISP2(size));
ptr = (void *)__get_free_pages(lflags, get_order(size));
} else {
ptr = spl_vmalloc(size, lflags | __GFP_HIGHMEM, PAGE_KERNEL);
ptr = __vmalloc(size, lflags | __GFP_HIGHMEM, PAGE_KERNEL);
}
/* Resulting allocated memory will be page aligned */
@ -1155,15 +1156,10 @@ spl_cache_grow_work(void *data)
spl_kmem_cache_t *skc = ska->ska_cache;
spl_kmem_slab_t *sks;
#if defined(PF_MEMALLOC_NOIO)
unsigned noio_flag = memalloc_noio_save();
sks = spl_slab_alloc(skc, ska->ska_flags);
memalloc_noio_restore(noio_flag);
#else
fstrans_cookie_t cookie = spl_fstrans_mark();
sks = spl_slab_alloc(skc, ska->ska_flags);
spl_fstrans_unmark(cookie);
#endif
spin_lock(&skc->skc_lock);
if (sks) {
skc->skc_slab_total++;

View File

@ -185,7 +185,7 @@ spl_kmem_alloc_impl(size_t size, int flags, int node)
*/
if ((size > spl_kmem_alloc_max) || use_vmem) {
if (flags & KM_VMEM) {
ptr = spl_vmalloc(size, lflags, PAGE_KERNEL);
ptr = __vmalloc(size, lflags, PAGE_KERNEL);
} else {
return (NULL);
}
@ -198,7 +198,7 @@ spl_kmem_alloc_impl(size_t size, int flags, int node)
/*
* For vmem_alloc() and vmem_zalloc() callers retry immediately
* using spl_vmalloc() which is unlikely to fail.
* using __vmalloc() which is unlikely to fail.
*/
if ((flags & KM_VMEM) && (use_vmem == 0)) {
use_vmem = 1;

View File

@ -538,7 +538,7 @@ taskq_cancel_id(taskq_t *tq, taskqid_t id)
}
EXPORT_SYMBOL(taskq_cancel_id);
static int taskq_thread_spawn(taskq_t *tq, int seq_tasks);
static int taskq_thread_spawn(taskq_t *tq);
taskqid_t
taskq_dispatch(taskq_t *tq, task_func_t func, void *arg, uint_t flags)
@ -587,9 +587,8 @@ taskq_dispatch(taskq_t *tq, task_func_t func, void *arg, uint_t flags)
wake_up(&tq->tq_work_waitq);
out:
/* Spawn additional taskq threads if required. */
if (tq->tq_nactive == tq->tq_nthreads &&
taskq_member_impl(tq, current))
(void) taskq_thread_spawn(tq, spl_taskq_thread_sequential + 1);
if (tq->tq_nactive == tq->tq_nthreads)
(void) taskq_thread_spawn(tq);
spin_unlock_irqrestore(&tq->tq_lock, tq->tq_lock_flags);
return (rc);
@ -635,9 +634,8 @@ taskq_dispatch_delay(taskq_t *tq, task_func_t func, void *arg,
spin_unlock(&t->tqent_lock);
out:
/* Spawn additional taskq threads if required. */
if (tq->tq_nactive == tq->tq_nthreads &&
taskq_member_impl(tq, current))
(void) taskq_thread_spawn(tq, spl_taskq_thread_sequential + 1);
if (tq->tq_nactive == tq->tq_nthreads)
(void) taskq_thread_spawn(tq);
spin_unlock_irqrestore(&tq->tq_lock, tq->tq_lock_flags);
return (rc);
}
@ -683,9 +681,8 @@ taskq_dispatch_ent(taskq_t *tq, task_func_t func, void *arg, uint_t flags,
wake_up(&tq->tq_work_waitq);
out:
/* Spawn additional taskq threads if required. */
if (tq->tq_nactive == tq->tq_nthreads &&
taskq_member_impl(tq, current))
(void) taskq_thread_spawn(tq, spl_taskq_thread_sequential + 1);
if (tq->tq_nactive == tq->tq_nthreads)
(void) taskq_thread_spawn(tq);
spin_unlock_irqrestore(&tq->tq_lock, tq->tq_lock_flags);
}
EXPORT_SYMBOL(taskq_dispatch_ent);
@ -756,15 +753,14 @@ taskq_thread_spawn_task(void *arg)
* which is also a dynamic taskq cannot be safely used for this.
*/
static int
taskq_thread_spawn(taskq_t *tq, int seq_tasks)
taskq_thread_spawn(taskq_t *tq)
{
int spawning = 0;
if (!(tq->tq_flags & TASKQ_DYNAMIC))
return (0);
if ((seq_tasks > spl_taskq_thread_sequential) &&
(tq->tq_nthreads + tq->tq_nspawn < tq->tq_maxthreads) &&
if ((tq->tq_nthreads + tq->tq_nspawn < tq->tq_maxthreads) &&
(tq->tq_flags & TASKQ_ACTIVE)) {
spawning = (++tq->tq_nspawn);
taskq_dispatch(dynamic_taskq, taskq_thread_spawn_task,
@ -817,9 +813,7 @@ taskq_thread(void *args)
tq = tqt->tqt_tq;
current->flags |= PF_NOFREEZE;
#if defined(PF_MEMALLOC_NOIO)
(void) memalloc_noio_save();
#endif
(void) spl_fstrans_mark();
sigfillset(&blocked);
sigprocmask(SIG_BLOCK, &blocked, NULL);
@ -898,7 +892,8 @@ taskq_thread(void *args)
}
/* Spawn additional taskq threads if required. */
if (taskq_thread_spawn(tq, ++seq_tasks))
if ((++seq_tasks) > spl_taskq_thread_sequential &&
taskq_thread_spawn(tq))
seq_tasks = 0;
tqt->tqt_id = 0;

View File

@ -97,31 +97,6 @@ spl_vmem_free(const void *buf, size_t size)
}
EXPORT_SYMBOL(spl_vmem_free);
/*
* Public vmalloc() interface designed to be safe to be called during I/O.
*/
void *
spl_vmalloc(unsigned long size, gfp_t lflags, pgprot_t prot)
{
#if defined(PF_MEMALLOC_NOIO)
void *ptr;
unsigned noio_flag = 0;
if (spl_fstrans_check())
noio_flag = memalloc_noio_save();
ptr = __vmalloc(size, lflags, prot);
if (spl_fstrans_check())
memalloc_noio_restore(noio_flag);
return (ptr);
#else
return (__vmalloc(size, lflags, prot));
#endif
}
EXPORT_SYMBOL(spl_vmalloc);
int
spl_vmem_init(void)
{

View File

@ -160,6 +160,12 @@ chmod u+x ${RPM_BUILD_ROOT}%{kmodinstdir_prefix}/*/extra/*/*/*
rm -rf $RPM_BUILD_ROOT
%changelog
* Fri Jan 8 2016 Ned Bass <bass6@llnl.gov> - 0.6.5.4-1
- Build fixes on SPARC and some kernels
- Fix taskq dynamic spawning deadlock
- Fix builtin kernel builds
- Fix crash due to overflow in P2ROUNDUP macro
- Fix deadlock during direct memory reclaim
* Tue Oct 13 2015 Ned Bass <bass6@llnl.gov> - 0.6.5.3-1
- Fix CPU hotplug zfsonlinux/spl#482
- Disable dynamic taskqs by default to avoid deadlock zfsonlinux/spl#484

View File

@ -38,6 +38,12 @@ make install DESTDIR=%{?buildroot}
%{_mandir}/man5/*
%changelog
* Fri Jan 8 2016 Ned Bass <bass6@llnl.gov> - 0.6.5.4-1
- Build fixes on SPARC and some kernels
- Fix taskq dynamic spawning deadlock
- Fix builtin kernel builds
- Fix crash due to overflow in P2ROUNDUP macro
- Fix deadlock during direct memory reclaim
* Tue Oct 13 2015 Ned Bass <bass6@llnl.gov> - 0.6.5.3-1
- Fix CPU hotplug zfsonlinux/spl#482
- Disable dynamic taskqs by default to avoid deadlock zfsonlinux/spl#484

View File

@ -38,6 +38,12 @@ make install DESTDIR=%{?buildroot}
%{_mandir}/man5/*
%changelog
* Fri Jan 8 2016 Ned Bass <bass6@llnl.gov> - 0.6.5.4-1
- Build fixes on SPARC and some kernels
- Fix taskq dynamic spawning deadlock
- Fix builtin kernel builds
- Fix crash due to overflow in P2ROUNDUP macro
- Fix deadlock during direct memory reclaim
* Tue Oct 13 2015 Ned Bass <bass6@llnl.gov> - 0.6.5.3-1
- Fix CPU hotplug zfsonlinux/spl#482
- Disable dynamic taskqs by default to avoid deadlock zfsonlinux/spl#484