Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

Preemption Support #98

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions config/spl-build.m4
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
SPL_AC_KERNEL
SPL_AC_KERNEL_CONFIG

if test "${LINUX_OBJ}" != "${LINUX}"; then
KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
Expand Down Expand Up @@ -211,13 +210,6 @@ AC_DEFUN([SPL_AC_KERNEL], [
SPL_AC_MODULE_SYMVERS
])

AC_DEFUN([SPL_AC_KERNEL_CONFIG], [
SPL_LINUX_CONFIG([PREEMPT],
AC_MSG_ERROR([
*** Kernel built with CONFIG_PREEMPT which is not supported.
** You must rebuild your kernel without this option.]), [])
])

dnl #
dnl # Default SPL user configuration
dnl #
Expand Down Expand Up @@ -640,26 +632,6 @@ AC_DEFUN([SPL_LINUX_TRY_COMPILE],
[$3], [$4])
])

dnl #
dnl # SPL_LINUX_CONFIG
dnl #
AC_DEFUN([SPL_LINUX_CONFIG],
[AC_MSG_CHECKING([whether Linux was built with CONFIG_$1])
SPL_LINUX_TRY_COMPILE([
#include <linux/module.h>
],[
#ifndef CONFIG_$1
#error CONFIG_$1 not #defined
#endif
],[
AC_MSG_RESULT([yes])
$2
],[
AC_MSG_RESULT([no])
$3
])
])

dnl #
dnl # SPL_CHECK_SYMBOL_EXPORT
dnl # check symbol exported or not
Expand Down
5 changes: 5 additions & 0 deletions module/spl/spl-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,8 @@ spl_debug_msg(void *arg, int subsys, int mask, const char *file,
va_list ap;
int i;

preempt_disable();

if (subsys == 0)
subsys = SS_DEBUG_SUBSYS;

Expand Down Expand Up @@ -770,6 +772,7 @@ spl_debug_msg(void *arg, int subsys, int mask, const char *file,
/* no console output requested */
if (tcd != NULL)
trace_put_tcd(tcd);
preempt_enable();
return 1;
}

Expand All @@ -780,6 +783,7 @@ spl_debug_msg(void *arg, int subsys, int mask, const char *file,
cdls->cdls_count++;
if (tcd != NULL)
trace_put_tcd(tcd);
preempt_enable();
return 1;
}

Expand Down Expand Up @@ -833,6 +837,7 @@ spl_debug_msg(void *arg, int subsys, int mask, const char *file,
cdls->cdls_count = 0;
}

preempt_enable();
return 0;
}
EXPORT_SYMBOL(spl_debug_msg);
Expand Down
7 changes: 6 additions & 1 deletion module/spl/spl-kmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,11 @@ spl_magazine_age(void *data)
spl_kmem_magazine_t *skm =
spl_get_work_data(data, spl_kmem_magazine_t, skm_work.work);
spl_kmem_cache_t *skc = skm->skm_cache;
int i = smp_processor_id();
int i;

preempt_disable();

i = smp_processor_id();

ASSERT(skm->skm_magic == SKM_MAGIC);
ASSERT(skc->skc_magic == SKC_MAGIC);
Expand All @@ -1165,6 +1169,7 @@ spl_magazine_age(void *data)
if (!test_bit(KMC_BIT_DESTROY, &skc->skc_flags))
schedule_delayed_work_on(i, &skm->skm_work,
skc->skc_delay / 3 * HZ);
preempt_enable();
}

/*
Expand Down