]> git.proxmox.com Git - mirror_spl-debian.git/log
mirror_spl-debian.git
12 years agoMerge branch 'upstream'
Darik Horn [Mon, 9 Apr 2012 14:07:14 +0000 (09:07 -0500)]
Merge branch 'upstream'

12 years agoRemove condition variable names
Brian Behlendorf [Fri, 6 Apr 2012 18:29:23 +0000 (11:29 -0700)]
Remove condition variable names

Long ago I added support to the spl for condition variable names
because I thought they might be needed.  It turns out they aren't.
In fact the official Solaris cv_init(9F) man page discourages
their use in the kernel.

  cv_init(9F)
    Parameters
      name - Descriptive string. This is obsolete and should be
             NULL. (Non-NULL strings are legal, but they're a
             waste of kernel memory.)

Therefore, I'm removing them from the spl to reclaim this memory
and adding an ASSERT() to ensure no new consumers are added which
make use of the name.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoPPA 0.6.0.57-0ubuntu1 release.
Darik Horn [Fri, 30 Mar 2012 05:08:27 +0000 (00:08 -0500)]
PPA 0.6.0.57-0ubuntu1 release.

12 years agoPPA 0.6.0.56-0ubuntu1 release.
Darik Horn [Tue, 27 Mar 2012 01:47:33 +0000 (20:47 -0500)]
PPA 0.6.0.56-0ubuntu1 release.

12 years agoMerge branch 'upstream'
Darik Horn [Tue, 27 Mar 2012 01:45:14 +0000 (20:45 -0500)]
Merge branch 'upstream'

12 years agoSPL 0.6.0-rc8
Brian Behlendorf [Mon, 26 Mar 2012 18:57:13 +0000 (11:57 -0700)]
SPL 0.6.0-rc8

12 years agoPPA 0.6.0.55-0ubuntu1 release.
Darik Horn [Fri, 23 Mar 2012 23:40:30 +0000 (18:40 -0500)]
PPA 0.6.0.55-0ubuntu1 release.

12 years agoMerge branch 'upstream'
Darik Horn [Fri, 23 Mar 2012 23:39:21 +0000 (18:39 -0500)]
Merge branch 'upstream'

12 years agoAdd SPL_META_RELEASE to module load/unload messages
Brian Behlendorf [Fri, 23 Mar 2012 19:03:57 +0000 (12:03 -0700)]
Add SPL_META_RELEASE to module load/unload messages

Include the ZFS_META_RELEASE in the module load/unload messages
to more clearly indicate exactly what version of the SPL has
been loaded.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoPPA 0.6.0.54-0ubuntu1 release.
Darik Horn [Sat, 17 Mar 2012 04:31:52 +0000 (23:31 -0500)]
PPA 0.6.0.54-0ubuntu1 release.

12 years agoMerge branch 'upstream'
Darik Horn [Sat, 17 Mar 2012 04:30:43 +0000 (23:30 -0500)]
Merge branch 'upstream'

12 years agoSPL 0.6.0-rc7
Brian Behlendorf [Fri, 16 Mar 2012 18:28:28 +0000 (11:28 -0700)]
SPL 0.6.0-rc7

12 years agoPPA 0.6.0.53-0ubuntu1 release.
Darik Horn [Sat, 10 Mar 2012 02:16:40 +0000 (20:16 -0600)]
PPA 0.6.0.53-0ubuntu1 release.

12 years agoMerge branch 'upstream'
Darik Horn [Sat, 10 Mar 2012 02:12:50 +0000 (20:12 -0600)]
Merge branch 'upstream'

12 years agoFix distribution detection
Brian Behlendorf [Mon, 5 Mar 2012 18:22:23 +0000 (10:22 -0800)]
Fix distribution detection

Improve the distribution detection by moving the tests for
distribution specific files first.  The Ubuntu and Debian
checks are left for last because they are the least likely
to be unique.  This is particularly true in the case of Debian
since so many distributions are based on Debian.

Since this is currently only used to identify the correct
packaging method for this system the result in many instances
is simply cosmetic.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoImprove debian/copyright syntax conformance.
Darik Horn [Tue, 28 Feb 2012 19:38:07 +0000 (13:38 -0600)]
Improve debian/copyright syntax conformance.

Remove tailing dots from copyright attributions and remove the GPL
stub from the header paragraph.

12 years agoCorrect the debian/changelog Upstream-Name field.
Darik Horn [Tue, 28 Feb 2012 19:34:07 +0000 (13:34 -0600)]
Correct the debian/changelog Upstream-Name field.

12 years agoPPA 0.6.0.52-0ubuntu2 release.
Darik Horn [Tue, 28 Feb 2012 02:19:56 +0000 (20:19 -0600)]
PPA 0.6.0.52-0ubuntu2 release.

12 years agoRevert "Change POST_INSTALL to POST_BUILD in dkms.conf"
Darik Horn [Tue, 28 Feb 2012 02:16:52 +0000 (20:16 -0600)]
Revert "Change POST_INSTALL to POST_BUILD in dkms.conf"

This reverts commit a68ebb5f24d073aca5f336b2681ee0a64c1a83d8.

The POST_BUILD variable is not in the internal dkms_conf_variables
list, which makes it a no-op on most systems. This is a DKMS bug.

12 years agoPPA 0.6.0.52-0ubuntu1 release.
Darik Horn [Tue, 28 Feb 2012 01:21:46 +0000 (19:21 -0600)]
PPA 0.6.0.52-0ubuntu1 release.

12 years agoMerge branch 'upstream'
Darik Horn [Tue, 28 Feb 2012 01:19:21 +0000 (19:19 -0600)]
Merge branch 'upstream'

12 years agoCleanly support debug packages
Brian Behlendorf [Mon, 27 Feb 2012 18:42:07 +0000 (10:42 -0800)]
Cleanly support debug packages

Allow a source rpm to be rebuilt with debugging enabled.  This
avoids the need to have to manually modify the spec file.  By
default debugging is still largely disabled.  To enable specific
debugging features use the following options with rpmbuild.

  '--with debug'               - Enables ASSERTs
  '--with debug-log'           - Enables the internal debug log
  '--with debug-kmem'          - Enables basic memory accounting
  '--with debug-kmem-tracking' - Enables detailed memory tracking

  # For example:
  $ rpmbuild --rebuild --with debug spl-modules-0.6.0-rc6.src.rpm

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoAdd machine readable debian/copyright file.
Darik Horn [Sat, 25 Feb 2012 16:05:50 +0000 (10:05 -0600)]
Add machine readable debian/copyright file.

Update the copyright file for DEP-5 policy conformance:

  http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/

12 years agoChange POST_INSTALL to POST_BUILD in dkms.conf
Fajar A. Nugraha [Sat, 25 Feb 2012 14:13:03 +0000 (08:13 -0600)]
Change POST_INSTALL to POST_BUILD in dkms.conf

  * Moved cp command to POST_BUILD so you can compile zfs module
    as long as spl module already build, without it having to be
    installed. Useful when testing multiple version of spl module
    in dkms tree

Partial cherry-pick from:
  fajarnugraha/spl@74db6cd7751b082c57137dede2f8624ce01dadc3

12 years agoPPA 0.6.0.51-0ubuntu1 release.
Darik Horn [Mon, 13 Feb 2012 01:00:21 +0000 (19:00 -0600)]
PPA 0.6.0.51-0ubuntu1 release.

12 years agoMerge branch 'upstream'
Darik Horn [Mon, 13 Feb 2012 00:57:18 +0000 (18:57 -0600)]
Merge branch 'upstream'

12 years agoAdd missing spl_debug_* helpers
Brian Behlendorf [Fri, 10 Feb 2012 00:38:42 +0000 (16:38 -0800)]
Add missing spl_debug_* helpers

When building the spl with --disable-debug-log the __SDEBUG()
macro and spl_debug_* helper functions were undefined.  This
change adds the missing functions so the upper layers compiling
against the spl don't need to be aware of how the spl was built.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoPPA 0.6.0.50-0ubuntu1 release.
Darik Horn [Wed, 8 Feb 2012 23:48:53 +0000 (17:48 -0600)]
PPA 0.6.0.50-0ubuntu1 release.

12 years agoPPA 0.6.0.49-0ubuntu1 release.
Darik Horn [Fri, 3 Feb 2012 20:27:19 +0000 (14:27 -0600)]
PPA 0.6.0.49-0ubuntu1 release.

12 years agoMerge branch 'upstream'
Darik Horn [Fri, 3 Feb 2012 20:25:17 +0000 (14:25 -0600)]
Merge branch 'upstream'

12 years agoAdd basic dynamic kstat support
Brian Behlendorf [Mon, 30 Jan 2012 20:15:31 +0000 (12:15 -0800)]
Add basic dynamic kstat support

Add the bare minimum functionality to support dynamic kstats.  A
complete kstat implementation should be done as part of issue #84.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #84

12 years agoAdd --enable-debug-log configure option
Brian Behlendorf [Sat, 21 Jan 2012 00:39:12 +0000 (16:39 -0800)]
Add --enable-debug-log configure option

Until now the notion of an internal debug logging infrastructure
was conflated with enabling ASSERT()s.  This patch clarifies things
by cleanly breaking the two subsystem apart.  The result of this
is the following behavior.

--enable-debug      - Enable/disable code wrapped in ASSERT()s.
--disable-debug       ASSERT()s are used to check invariants and
                      are never required for correct operation.
                      They are disabled by default because they
                      may impact performance.

--enable-debug-log  - Enable/disable the debug log infrastructure.
--disable-debug-log   This infrastructure allows the spl code and
                      its consumer to log messages to an in-kernel
                      log.  The granularity of the logging can be
                      controlled by a debug mask.  By default the
                      mask disables most debug messages resulting
                      in a negligible performance impact.  Because
                      of this the debug log is enabled by default.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoPPA 0.6.0.48-0ubuntu1 release.
Darik Horn [Fri, 20 Jan 2012 02:18:50 +0000 (20:18 -0600)]
PPA 0.6.0.48-0ubuntu1 release.

12 years agoMerge branch 'upstream'
Darik Horn [Fri, 20 Jan 2012 02:17:43 +0000 (20:17 -0600)]
Merge branch 'upstream'

12 years agoTaskq locking optimizations
Ned Bass [Thu, 19 Jan 2012 18:33:19 +0000 (10:33 -0800)]
Taskq locking optimizations

Testing has shown that tq->tq_lock can be highly contended when a
large number of small work items are dispatched.  The lock hold time
is reduced by the following changes:

1) Use exclusive threads in the work_waitq

When a single work item is dispatched we only need to wake a single
thread to service it.  The current implementation uses non-exclusive
threads so all threads are woken when the dispatcher calls wake_up().
If a large number of threads are in the queue this overhead can become
non-negligible.

2) Conditionally add/remove threads from work waitq

Taskq threads need only add themselves to the work wait queue if
there are no pending work items.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #32

12 years agoRevert "Taskq locking optimizations"
Ned Bass [Thu, 19 Jan 2012 19:36:27 +0000 (11:36 -0800)]
Revert "Taskq locking optimizations"

This reverts commit ec2b41049f7f576aaa772b326d083e5971212d33.

A race condition was introduced by which a wake_up() call can be lost
after the taskq thread determines there is no pending work items,
leading to deadlock:

1. taksq thread enables interrupts
2. dispatcher thread runs, queues work item, call wake_up()
3. taskq thread runs, adds self to waitq, sleeps

This could easily happen if an interrupt for an IO completion was
outstanding at the point where the taskq thread reenables interrupts,
just before the call to add_wait_queue_exclusive().  The handler would
run immediately within the race window.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #32

12 years agoPPA 0.6.0.47-0ubuntu1 release.
Darik Horn [Thu, 19 Jan 2012 00:22:04 +0000 (18:22 -0600)]
PPA 0.6.0.47-0ubuntu1 release.

12 years agoMerge branch 'upstream'
Darik Horn [Thu, 19 Jan 2012 00:20:02 +0000 (18:20 -0600)]
Merge branch 'upstream'

12 years agoFix rpm dependencies
Brian Behlendorf [Wed, 18 Jan 2012 00:14:59 +0000 (16:14 -0800)]
Fix rpm dependencies

This change updates the rpm spec files to have strictly correct
package dependencies.  That means a few things:

* Add a dependency to the spl package for the spl-modules package.
  This ensures that when running 'yum install spl' that newest
  version of the spl-modules will be installed.

* Remove the redundant distribution release extension.  This
  is already added once because it is part of the kernel package
  release name.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoAdd the release component to headers
Brian Behlendorf [Wed, 18 Jan 2012 00:14:35 +0000 (16:14 -0800)]
Add the release component to headers

When the original build system code was added the release
component was accidentally omited from the development header
install path.  This patch adds the missing path component so
it's always clear exactly what release your compiling against.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoTaskq locking optimizations
Ned Bass [Tue, 17 Jan 2012 23:34:55 +0000 (15:34 -0800)]
Taskq locking optimizations

Testing has shown that tq->tq_lock can be highly contended when a
large number of small work items are dispatched.  The lock hold time
is reduced by the following changes:

1) Use exclusive threads in the work_waitq

When a single work item is dispatched we only need to wake a single
thread to service it.  The current implementation uses non-exclusive
threads so all threads are woken when the dispatcher calls wake_up().
If a large number of threads are in the queue this overhead can become
non-negligible.

2) Conditionally add/remove threads from work waitq outside of tq_lock

Taskq threads need only add themselves to the work wait queue if there
are no pending work items.  Furthermore, the add and remove function
calls can be made outside of the taskq lock since the wait queues are
protected from concurrent access by their own spinlocks.

3) Call wake_up() outside of tq->tq_lock

Again, the wait queues are protected by their own spinlock, so the
dispatcher functions can drop tq->tq_lock before calling wake_up().

A new splat test taskq:contention was added in a prior commit to measure
the impact of these changes.  The following table summarizes the
results using data from the kernel lock profiler.

                        tq_lock time    %diff   Wall clock (s)  %diff
original:               39117614.10     0       41.72           0
exclusive threads:      31871483.61     18.5    34.2            18.0
unlocked add/rm waitq:  13794303.90     64.7    16.17           61.2
unlocked wake_up():     1589172.08      95.9    16.61           60.2

Each row reflects the average result over 5 test runs.
/proc/lock_stats was zeroed out before and collected after each run.
Column 1 is the cumulative hold time in microseconds for tq->tq_lock.
The tests are cumulative; each row reflects the code changes of the
previous rows.  %diff is calculated with respect to "original" as
100*(orig-new)/orig.

Although calling wake_up() outside of the taskq lock dramatically
reduced the taskq lock hold time, the test actually took slightly more
wall clock time.  This is because the point of contention shifts from
the taskq lock to the wait queue lock.  But the change still seems
worthwhile since it removes our taskq implementation as a bottleneck,
assuming the small increase in wall clock time to be statistical
noise.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #32

12 years agoAdd taskq contention splat test
Ned Bass [Tue, 17 Jan 2012 22:23:58 +0000 (14:23 -0800)]
Add taskq contention splat test

Add a test designed to generate contention on the taskq spinlock by
using a large number of threads (100) to perform a large number (131072)
of trivial work items from a single queue.  This simulates conditions
that may occur with the zio free taskq when a 1TB file is removed from a
ZFS filesystem, for example.  This test should always pass.  Its purpose
is to provide a benchmark to easily measure the effectiveness of taskq
optimizations using statistics from the kernel lock profiler.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #32

12 years agoPPA 0.6.0.46-0ubuntu1 release.
Darik Horn [Wed, 18 Jan 2012 17:47:05 +0000 (11:47 -0600)]
PPA 0.6.0.46-0ubuntu1 release.

12 years agoRemove the debian/rules `make distclean` kludge.
Darik Horn [Wed, 18 Jan 2012 17:38:33 +0000 (11:38 -0600)]
Remove the debian/rules `make distclean` kludge.

The modules/Makefile.am template produced a broken distclean rule for
userland configurations. The packaging kludge was made redundant by
commit zfslinux/spl@966e5200d35a2c38cdb9e14bfaf698a10b31603b.

12 years agoMerge branch 'upstream'
Darik Horn [Wed, 18 Jan 2012 17:37:17 +0000 (11:37 -0600)]
Merge branch 'upstream'

12 years agoFix `make distclean` for `--with-config=user`
Darik Horn [Sat, 14 Jan 2012 04:20:07 +0000 (22:20 -0600)]
Fix `make distclean` for `--with-config=user`

Apply the same fix to SPL that was applied to ZFS earlier at:
zfsonlinux/zfs@d433c206515e567c52ce09589033405a0ae3716e

Additionally quote @LINUX_SYMBOLS@ because it is a null substitution
in this configuration, which results in a `[ -f  ]` expression that
incorrectly evaluates to true.

  # ./configure --with-config=user
  # make distclean

  Making distclean in module
  make[1]: Entering directory `/spl/module'
  make -C  SUBDIRS=`pwd`  clean
  make: Entering an unknown directory
  make: *** SUBDIRS=/spl/module: No such file or directory.  Stop.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoPPA 0.6.0.45-0ubuntu1 release.
Darik Horn [Mon, 16 Jan 2012 00:36:38 +0000 (18:36 -0600)]
PPA 0.6.0.45-0ubuntu1 release.

12 years agoMerge branch 'fhs'
Darik Horn [Mon, 16 Jan 2012 00:32:56 +0000 (18:32 -0600)]
Merge branch 'fhs'

12 years agoMerge branch 'upstream'
Darik Horn [Mon, 16 Jan 2012 00:32:50 +0000 (18:32 -0600)]
Merge branch 'upstream'

12 years agoFHS conformance and DKMS multiarch, SPL interface.
Darik Horn [Sat, 14 Jan 2012 05:31:03 +0000 (23:31 -0600)]
FHS conformance and DKMS multiarch, SPL interface.

Improve FHS conformance by installing intermediary build products --
currently the spl_config.h and Module.symvers files -- into the
/var/lib/dkms area instead of /usr/src.

This has the beneficial side-effect of enabling DKMS multiarch
support for SPL because the autoconf templates and `make install`
rules are not aware of the target architecture.

Mitigates: zfsonlinux/zfs#511

12 years agoWrap long lines in the dkms.conf file.
Darik Horn [Sat, 14 Jan 2012 04:55:47 +0000 (22:55 -0600)]
Wrap long lines in the dkms.conf file.

12 years agoRun SPL_AC_PACMAN only if $VENDOR is "arch"
Brian Behlendorf [Fri, 13 Jan 2012 17:08:12 +0000 (09:08 -0800)]
Run SPL_AC_PACMAN only if $VENDOR is "arch"

Unfortunately, Arch's package manager `pacman` shares it's name with a
popular arcade video game. Thus, in order to refrain from executing the
video game when we mean to execute the package manager, SPL_AC_PACMAN is
now only run when $VENDOR is determined to be "arch".

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes zfsonlinux/zfs#517

12 years agoPPA 0.6.0.44-0ubuntu1 release.
Darik Horn [Fri, 13 Jan 2012 01:26:00 +0000 (19:26 -0600)]
PPA 0.6.0.44-0ubuntu1 release.

12 years agoMerge branch 'upstream'
Darik Horn [Fri, 13 Jan 2012 01:24:02 +0000 (19:24 -0600)]
Merge branch 'upstream'

12 years agoLinux 3.2 compat: rw_semaphore.wait_lock is raw
Darik Horn [Wed, 11 Jan 2012 17:44:34 +0000 (11:44 -0600)]
Linux 3.2 compat: rw_semaphore.wait_lock is raw

The wait_lock member of the rw_semaphore struct became a raw_spinlock_t
in Linux 3.2 at torvalds/linux@ddb6c9b58a19edcfac93ac670b066c836ff729f1.

Wrap spin_lock_* function calls in a new spl_rwsem_* interface to
ensure type safety if raw_spinlock_t becomes architecture specific,
and to satisfy these compiler warnings:

  warning: passing argument 1 of â€˜spinlock_check’
    from incompatible pointer type [enabled by default]
  note: expected â€˜struct spinlock_t *’
    but argument is of type â€˜struct raw_spinlock_t *’

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes: #76
Closes: zfsonlinux/zfs#463
12 years agoPPA 0.6.0.43-0ubuntu1 release.
Darik Horn [Sat, 7 Jan 2012 16:40:33 +0000 (10:40 -0600)]
PPA 0.6.0.43-0ubuntu1 release.

12 years agoAdd precise to the PPA build list.
Darik Horn [Sat, 7 Jan 2012 16:32:32 +0000 (10:32 -0600)]
Add precise to the PPA build list.

Begin building packages for the Ubuntu 12.04 LTS Precise Pangolin
alpha release.

The linux-image-3.2.0-8-generic kernel package is the first Ubuntu
P-series release that is compatible and somewhat stable with SPL.

12 years agoPPA 0.6.0.42-0ubuntu1 release.
Darik Horn [Fri, 23 Dec 2011 13:22:21 +0000 (07:22 -0600)]
PPA 0.6.0.42-0ubuntu1 release.

12 years agoRefresh debian/patches after upstream merge.
Darik Horn [Fri, 23 Dec 2011 13:19:32 +0000 (07:19 -0600)]
Refresh debian/patches after upstream merge.

12 years agoMerge branch 'upstream'
Darik Horn [Fri, 23 Dec 2011 13:19:00 +0000 (07:19 -0600)]
Merge branch 'upstream'

12 years agoProxmox VE kernel compat, invalidate_inodes()
Brian Behlendorf [Wed, 21 Dec 2011 22:22:45 +0000 (14:22 -0800)]
Proxmox VE kernel compat, invalidate_inodes()

The Proxmox VE kernel contains a patch which renames the function
invalidate_inodes() to invalidate_inodes_check().  In the process
it adds a 'check' argument and a '#define invalidate_inodes(x)'
compatibility wrapper for legacy callers.  Therefore, if either
of these functions are exported invalidate_inodes() can be
safely used.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #58

12 years agoMove Arch Linux's VENDOR check above Ubuntu's
Prakash Surya [Sat, 17 Dec 2011 06:16:47 +0000 (22:16 -0800)]
Move Arch Linux's VENDOR check above Ubuntu's

If the lsb-release package is installed on an Arch Linux distribution,
the configure step will incorrectly detect the running distribution as
Ubuntu. This is a result of both distributions providing an
/etc/lsb-release file, and the Ubuntu VENDOR check being performed
first.

Since the Arch Linux test check's for a file more specific to the Arch
Linux distribution, moving Arch Linux's VENDOR check above Unbuntu's
check provides a quick and easy solution.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #72

12 years agoStore copy of tqent_flags prior to servicing task
Prakash Surya [Fri, 16 Dec 2011 22:57:31 +0000 (14:57 -0800)]
Store copy of tqent_flags prior to servicing task

A preallocated taskq_ent_t's tqent_flags must be checked prior to
servicing the taskq_ent_t. Once a preallocated taskq entry is serviced,
the ownership of the entry is handed back to the caller of
taskq_dispatch, thus the entry's contents can potentially be mangled.

In particular, this is a problem in the case where a preallocated taskq
entry is serviced, and the caller clears it's tqent_flags field. Thus,
when the function returns and task_done is called, it looks as though
the entry is **not** a preallocated task (when in fact it **is** a
preallocated task).

In this situation, task_done will place the preallocated taskq_ent_t
structure onto the taskq_t's free list. This is a **huge** mistake. If
the taskq_ent_t is then freed by the caller of taskq_dispatch, the
taskq_t's free list will hold a pointer to garbage data. Even worse, if
nothing has over written the freed memory before the pointer is
dereferenced, it may still look as though it points to a valid list_head
belonging to a taskq_ent_t structure.

Thus, the task entry's flags are now copied prior to servicing the task.
This copy is then checked to see if it is a preallocated task, and
determine if the entry needs to be passed down to the task_done
function.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #71

12 years agoSwap taskq_ent_t with taskqid_t in taskq_thread_t
Prakash Surya [Fri, 16 Dec 2011 17:44:31 +0000 (09:44 -0800)]
Swap taskq_ent_t with taskqid_t in taskq_thread_t

The taskq_t's active thread list is sorted based on its
tqt_ent->tqent_id field. The list is kept sorted solely by inserting
new taskq_thread_t's in their correct sorted location; no other
means is used. This means that once inserted, if a taskq_thread_t's
tqt_ent->tqent_id field changes, the list runs the risk of no
longer being sorted.

Prior to the introduction of the taskq_dispatch_prealloc() interface,
this was not a problem as a taskq_ent_t actively being serviced under
the old interface should always have a static tqent_id field. Thus,
once the taskq_thread_t is added to the taskq_t's active thread list,
the taskq_thread_t's tqt_ent->tqent_id field would remain constant.

Now, this is no longer the case. Currently, if using the
taskq_dispatch_prealloc() interface, any given taskq_ent_t actively
being serviced _may_ have its tqent_id value incremented. This happens
when the preallocated taskq_ent_t structure is recursively dispatched.
Thus, a taskq_thread_t could potentially have its tqt_ent->tqent_id
field silently modified from under its feet. If this were to happen
to a taskq_thread_t on a taskq_t's active thread list, this would
compromise the integrity of the order of the list (as the list
_may_ no longer be sorted).

To get around this, the taskq_thread_t's taskq_ent_t pointer was
replaced with its own static copy of the tqent_id. So, as a taskq_ent_t
is pulled off of the taskq_t's pending list, a static copy of its
tqent_id is made and this copy is used to sort the active thread
list. Using a static copy is key in ensuring the integrity of the
order of the active thread list. Even if the underlying taskq_ent_t
is recursively dispatched (as has its tqent_id modified), this
static copy stored inside the taskq_thread_t will remain constant.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #71

12 years agoPPA 0.6.0.41-0ubuntu1 release.
Darik Horn [Thu, 15 Dec 2011 16:08:17 +0000 (10:08 -0600)]
PPA 0.6.0.41-0ubuntu1 release.

12 years agoMerge branch 'upstream'
Darik Horn [Thu, 15 Dec 2011 16:05:04 +0000 (10:05 -0600)]
Merge branch 'upstream'

12 years agoAdd make rule for building Arch Linux packages
Prakash Surya [Wed, 7 Dec 2011 01:33:51 +0000 (17:33 -0800)]
Add make rule for building Arch Linux packages

Added the necessary build infrastructure for building packages
compatible with the Arch Linux distribution. As such, one can now run:

    $ ./configure
    $ make pkg     # Alternatively, one can run 'make arch' as well

on an Arch Linux machine to create two binary packages compatible with
the pacman package manager, one for the spl userland utilties and
another for the spl kernel modules. The new packages can then be
installed by running:

    # pacman -U $package.pkg.tar.xz

In addition, source-only packages suitable for an Arch Linux chroot
environment or remote builder can also be built using the 'sarch' make
rule.

NOTE: Since the source dist tarball is created on the fly from the head
of the build tree, it's MD5 hash signature will be continually influx.
As a result, the md5sum variable was intentionally omitted from the
PKGBUILD files, and the '--skipinteg' makepkg option is used. This may
or may not have any serious security implications, as the source tarball
is not being downloaded from an outside source.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes: #68
12 years agoMerge branch 'upstream'
Darik Horn [Wed, 14 Dec 2011 02:39:47 +0000 (20:39 -0600)]
Merge branch 'upstream'

12 years agoExercise new taskq interface in splat-taskq tests
Prakash Surya [Tue, 6 Dec 2011 18:11:36 +0000 (10:11 -0800)]
Exercise new taskq interface in splat-taskq tests

The splat-taskq test functions were slightly modified to exercise
the new taskq interface in addition to the old interface.  If the
old interface passes each of its tests, the new interface is
exercised.  Both sub tests (old interface and new interface) must
pass for each test as a whole to pass.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #65

12 years agoImplement taskq_dispatch_prealloc() interface
Prakash Surya [Tue, 6 Dec 2011 18:04:51 +0000 (10:04 -0800)]
Implement taskq_dispatch_prealloc() interface

This patch implements the taskq_dispatch_prealloc() interface which
was introduced by the following illumos-gate commit.  It allows for
a preallocated taskq_ent_t to be used when dispatching items to a
taskq.  This eliminates a memory allocation which helps minimize
lock contention in the taskq when dispatching functions.

    commit 5aeb94743e3be0c51e86f73096334611ae3a058e
    Author: Garrett D'Amore <garrett@nexenta.com>
    Date:   Wed Jul 27 07:13:44 2011 -0700

    734 taskq_dispatch_prealloc() desired
    943 zio_interrupt ends up calling taskq_dispatch with TQ_SLEEP

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #65

12 years agoAdd Test: "Single task queue, recursive dispatch"
Prakash Surya [Tue, 6 Dec 2011 17:48:06 +0000 (09:48 -0800)]
Add Test: "Single task queue, recursive dispatch"

Added another splat taskq test to ensure tasks can be recursively
submitted to a single task queue without issue. When the
taskq_dispatch_prealloc() interface is introduced, this use case
can potentially cause a deadlock if a taskq_ent_t is dispatched
while its tqent_list field is not empty. This _should_ never be
a problem with the existing taskq_dispatch() interface.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #65

12 years agoReplace tq_work_list and tq_threads in taskq_t
Prakash Surya [Tue, 6 Dec 2011 01:32:48 +0000 (17:32 -0800)]
Replace tq_work_list and tq_threads in taskq_t

To lay the ground work for introducing the taskq_dispatch_prealloc()
interface, the tq_work_list and tq_threads fields had to be replaced
with new alternatives in the taskq_t structure.

The tq_threads field was replaced with tq_thread_list. Rather than
storing the pointers to the taskq's kernel threads in an array, they are
now stored as a list. In addition to laying the ground work for the
taskq_dispatch_prealloc() interface, this change could also enable taskq
threads to be dynamically created and destroyed as threads can now be
added and removed to this list relatively easily.

The tq_work_list field was replaced with tq_active_list. Instead of
keeping a list of taskq_ent_t's which are currently being serviced, a
list of taskq_threads currently servicing a taskq_ent_t is kept. This
frees up the taskq_ent_t's tqent_list field when it is being serviced
(i.e. now when a taskq_ent_t is being serviced, it's tqent_list field
will be empty).

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #65

12 years agoReplace struct spl_task with struct taskq_ent
Prakash Surya [Fri, 11 Nov 2011 23:06:35 +0000 (15:06 -0800)]
Replace struct spl_task with struct taskq_ent

The spl_task structure was renamed to taskq_ent, and all of
its fields were renamed to have a prefix of 'tqent' rather
than 't'. This was to align with the naming convention which
the ZFS code assumes.  Previously these fields were private
so the name never mattered.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #65

12 years agoAdd SPLAT_TEST_FINI call for SPLAT_TASKQ_TEST6_ID
Prakash Surya [Fri, 2 Dec 2011 22:05:06 +0000 (14:05 -0800)]
Add SPLAT_TEST_FINI call for SPLAT_TASKQ_TEST6_ID

This change adds the neglected SPLAT_TEST_FINI call for the
SPLAT_TASKQ_TEST6_ID, just as is done for the other 5 SPLAT_TASKQ_*
tests.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #64

12 years agoFix usage of MUTEX macro in mutex_enter_nested
Prakash Surya [Mon, 12 Dec 2011 23:37:30 +0000 (15:37 -0800)]
Fix usage of MUTEX macro in mutex_enter_nested

A call site of the MUTEX macro had incorrectly placed its closing
parenthesis, causing two parameters to be passed rather than one. This
change moves the misplaced parenthesis to fix the typographical error.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #70

12 years agoAllow 64-bit timestamps to be set on 64-bit kernels
Chris Dunlop [Tue, 6 Dec 2011 04:29:58 +0000 (15:29 +1100)]
Allow 64-bit timestamps to be set on 64-bit kernels

ZFS and 64-bit linux are perfectly capable of dealing with 64-bit
timestamps, but ZFS deliberately prevents setting them.  Adjust
the SPL such that TIMESPEC_OVERFLOW will not always assume 32-bit
values and instead use the correct values for your kernel build.
This effectively allows 64-bit timestamps on 64-bit systems.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes ZFS issue #487

12 years agoPPA 0.6.0.40-0ubuntu1 release.
Darik Horn [Tue, 6 Dec 2011 02:06:24 +0000 (20:06 -0600)]
PPA 0.6.0.40-0ubuntu1 release.

12 years agoPPA 0.6.0.39-0ubuntu1 release.
Darik Horn [Tue, 22 Nov 2011 14:31:50 +0000 (08:31 -0600)]
PPA 0.6.0.39-0ubuntu1 release.

12 years agoMerge branch 'upstream'
Darik Horn [Tue, 22 Nov 2011 14:30:03 +0000 (08:30 -0600)]
Merge branch 'upstream'

12 years agoFix a typo referencing an incorrect symbol
Prakash Surya [Fri, 18 Nov 2011 22:27:37 +0000 (14:27 -0800)]
Fix a typo referencing an incorrect symbol

The splat_taskq_test4_common function was incorrectly referencing
the splat_taskq-test13_func symbol, when it meant to be using the
splat_taskq_test4_func symbol.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #61

12 years agoPrepend spl_ to all init/fini functions
Brian Behlendorf [Fri, 11 Nov 2011 17:03:31 +0000 (09:03 -0800)]
Prepend spl_ to all init/fini functions

This is a bit of cleanup I'd been meaning to get to for a while
to reduce the chance of a type conflict.  Well that conflict
finally occurred with the kstat_init() function which conflicts
with a function in the 2.6.32-6-pve kernel.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #56

12 years agoPPA 0.6.0.38-0ubuntu1 release.
Darik Horn [Fri, 11 Nov 2011 14:58:24 +0000 (08:58 -0600)]
PPA 0.6.0.38-0ubuntu1 release.

12 years agoRefresh debian/patches after upstream merge.
Darik Horn [Fri, 11 Nov 2011 14:54:57 +0000 (08:54 -0600)]
Refresh debian/patches after upstream merge.

12 years agoMerge branch 'upstream'
Darik Horn [Fri, 11 Nov 2011 14:51:45 +0000 (08:51 -0600)]
Merge branch 'upstream'

12 years agoFix depmod warning
Brian Behlendorf [Thu, 10 Nov 2011 18:36:21 +0000 (10:36 -0800)]
Fix depmod warning

The depmod utility from module-init-tools 3.12-pre3 generates a
warning when the -e option is used without -E or -F.  This was
observed under OpenSuse 11.4.  To resolve the issue when the
exact System.map-* for your kernel cannot be found fallback to
a generic safe '/sbin/depmod -a'.

  WARNING: -e needs -E or -F

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoLinux 3.1 compat, shrink_*cache_memory
Brian Behlendorf [Thu, 10 Nov 2011 00:31:03 +0000 (16:31 -0800)]
Linux 3.1 compat, shrink_*cache_memory

As of Linux 3.1 the shrink_dcache_memory and shrink_icache_memory
functions have been removed.  This same task is now accomplished
more cleanly with per super block shrinkers.  This unfortunately
leaves us no easy way to support the dnlc_reduce_cache() function.

This support has always been entirely optional.  So when no
reasonable interface is available allow the dnlc_reduce_cache()
function to effectively become a no-op.

The downside of this change is that it will prevent the zfs arc
meta data limts from being enforced.  However, the current zfs
implementation in this regard is already flawed and needs to
be reworked.  If the arc needs to enfore a meta data limit it
will need to be extended to coordinate directly with the zpl.
This will allow us to drop all this compatibility code and get
more fine grained control over the cache management.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #52

12 years agoLinux 3.1 compat, vfs_fsync()
Brian Behlendorf [Wed, 9 Nov 2011 20:45:35 +0000 (12:45 -0800)]
Linux 3.1 compat, vfs_fsync()

Preferentially use the vfs_fsync() function.  This function was
initially introduced in 2.6.29 and took three arguments.  As
of 2.6.35 the dentry argument was dropped from the function.
For older kernels fall back to using file_fsync() which also
took three arguments including the dentry.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #52

12 years agoLinux 3.1 compat, kern_path_parent()
Brian Behlendorf [Wed, 9 Nov 2011 20:29:51 +0000 (12:29 -0800)]
Linux 3.1 compat, kern_path_parent()

Prior to Linux 3.1 the kern_path_parent symbol was exported for
use by kernel modules.  As of Linux 3.1 it is now longer easily
available.  To handle this case the spl will now dynamically
look up address of the missing symbol at module load time.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #52

12 years agoPPA 0.6.0.37-0ubuntu1 release.
Darik Horn [Sat, 5 Nov 2011 15:25:00 +0000 (10:25 -0500)]
PPA 0.6.0.37-0ubuntu1 release.

12 years agoMerge branch 'upstream'
Darik Horn [Sat, 5 Nov 2011 15:24:02 +0000 (10:24 -0500)]
Merge branch 'upstream'

12 years agoFix NULL deref in balance_pgdat()
Brian Behlendorf [Tue, 1 Nov 2011 20:35:12 +0000 (13:35 -0700)]
Fix NULL deref in balance_pgdat()

Be careful not to unconditionally clear the PF_MEMALLOC bit in
the task structure.  It may have already been set when entering
kv_alloc() in which case it must remain set on exit.  In
particular the kswapd thread will have PF_MEMALLOC set in
order to prevent it from entering direct reclaim.  By clearing
it we allow the following NULL deref to potentially occur.

  BUG: unable to handle kernel NULL pointer dereference at (null)
  IP: [<ffffffff8109c7ab>] balance_pgdat+0x25b/0x4ff

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes ZFS issue #287

12 years agoPPA 0.6.0.36-0ubuntu1 release.
Darik Horn [Sat, 29 Oct 2011 00:34:23 +0000 (19:34 -0500)]
PPA 0.6.0.36-0ubuntu1 release.

12 years agoMerge branch 'upstream'
Darik Horn [Sat, 29 Oct 2011 00:32:23 +0000 (19:32 -0500)]
Merge branch 'upstream'

12 years agoRemove redundant postinst and prerm boilerplate.
Darik Horn [Fri, 21 Oct 2011 22:27:01 +0000 (17:27 -0500)]
Remove redundant postinst and prerm boilerplate.

Remove scripting that is automatically added by the dh_dkms helper.

12 years agoMinor typo correction and comment updates.
Darik Horn [Fri, 21 Oct 2011 22:21:25 +0000 (17:21 -0500)]
Minor typo correction and comment updates.

12 years agoPPA 0.6.0.35-0ubuntu2 release.
Darik Horn [Wed, 19 Oct 2011 23:03:35 +0000 (18:03 -0500)]
PPA 0.6.0.35-0ubuntu2 release.

Increment the META version. The previous build was bad because the
volatile-version.patch was not updated, which caused this error:

  Setting up spl-dkms (0.6.0.35-0ubuntu1~oneiric1) ...
  First Installation: checking all kernels...
  Building only for 3.0.0-12-generic
  This package appears to be a binaries-only package
   you will not be able to build against kernel 3.0.0-12-generic
   since the package source was not provided

12 years agoPPA 0.6.0.35-0ubuntu1 release.
Darik Horn [Wed, 19 Oct 2011 19:17:17 +0000 (14:17 -0500)]
PPA 0.6.0.35-0ubuntu1 release.

12 years agoInclude distribution in release
Brian Behlendorf [Wed, 19 Oct 2011 18:23:38 +0000 (11:23 -0700)]
Include distribution in release

Common practice is to include the distribution in the package release.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoRemove tentative gunnarbeutner/bug-391 patch.
Darik Horn [Wed, 19 Oct 2011 18:26:47 +0000 (13:26 -0500)]
Remove tentative gunnarbeutner/bug-391 patch.

This patch was merged upstream.

12 years agoMerge branch 'upstream'
Darik Horn [Wed, 19 Oct 2011 18:25:37 +0000 (13:25 -0500)]
Merge branch 'upstream'