<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/module/zfs/spa.c, branch zfs-0.6.2</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=zfs-0.6.2</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=zfs-0.6.2'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2013-07-03T16:22:44Z</updated>
<entry>
<title>Call zvol_create_minors() in spa_open_common() when initializing pool</title>
<updated>2013-07-03T16:22:44Z</updated>
<author>
<name>Pawel Jakub Dawidek</name>
<email>pjd@FreeBSD.org</email>
</author>
<published>2013-05-28T11:50:38Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=526af78550eb5ccf80ce11e7a9c26f203ae671b0'/>
<id>urn:sha1:526af78550eb5ccf80ce11e7a9c26f203ae671b0</id>
<content type='text'>
There is an extremely odd bug that causes zvols to fail to appear on
some systems, but not others. Recently, I was able to consistently
reproduce this issue over a period of 1 month. The issue disappeared
after I applied this change from FreeBSD.

This is from FreeBSD's pool version 28 import, which occurred in
revision 219089.

Ported-by: Richard Yao &lt;ryao@cs.stonybrook.edu&gt;
Signed-off-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Issue #441
Issue #599
</content>
</entry>
<entry>
<title>Illumos #3498 panic in arc_read()</title>
<updated>2013-07-02T20:34:31Z</updated>
<author>
<name>George Wilson</name>
<email>george.wilson@delphix.com</email>
</author>
<published>2013-07-02T20:26:24Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=294f68063b49c06d3118d51016811063e69cf97a'/>
<id>urn:sha1:294f68063b49c06d3118d51016811063e69cf97a</id>
<content type='text'>
3498 panic in arc_read(): !refcount_is_zero(&amp;pbuf-&gt;b_hdr-&gt;b_refcnt)
Reviewed by: Adam Leventhal &lt;ahl@delphix.com&gt;
Reviewed by: Matthew Ahrens &lt;mahrens@delphix.com&gt;
Approved by: Richard Lowe &lt;richlowe@richlowe.net&gt;

References:
  illumos/illumos-gate@1b912ec7100c10e7243bf0879af0fe580e08c73d
  https://www.illumos.org/issues/3498

Ported-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Closes #1249
</content>
</entry>
<entry>
<title>Fix module probe failure on 32-bit systems</title>
<updated>2013-06-27T17:01:25Z</updated>
<author>
<name>Ying Zhu</name>
<email>casualfisher@gmail.com</email>
</author>
<published>2013-06-27T11:41:30Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c12936b141e7479a1402561e9e528731d763747e'/>
<id>urn:sha1:c12936b141e7479a1402561e9e528731d763747e</id>
<content type='text'>
Previous commit 7ef5e54e2e28884a04dc800657967b891239e933 caused
module probe failure on 32-bit systems, dmesg showed

  Unknown symbol __moddi3

This was caused by the modulo operation 'gethrtime() % tqs-&gt;stqs_count'
in the committed code.  Instead of implementing __moddi3 for all 32-bit
systems, Behlendorf advised we can just cast the return value of
gethrtime() into a uint64_t, since gethrtime does not return negative
value on all circumstances we need not care about the potential overflow.

Signed-off-by: Ying Zhu &lt;casualfisher@gmail.com&gt;
Signed-off-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Closes #1551
</content>
</entry>
<entry>
<title>Illumos #3006</title>
<updated>2013-06-19T22:14:10Z</updated>
<author>
<name>Madhav Suresh</name>
<email>madhav.suresh@delphix.com</email>
</author>
<published>2013-05-10T21:17:03Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c99c90015ece64746e20b74245caca41d1dbefe1'/>
<id>urn:sha1:c99c90015ece64746e20b74245caca41d1dbefe1</id>
<content type='text'>
3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first
     argument is zero

Reviewed by Matt Ahrens &lt;matthew.ahrens@delphix.com&gt;
Reviewed by George Wilson &lt;george.wilson@delphix.com&gt;
Approved by Eric Schrock &lt;eric.schrock@delphix.com&gt;

References:
  illumos/illumos-gate@fb09f5aad449c97fe309678f3f604982b563a96f
  https://illumos.org/issues/3006

Requires:
  zfsonlinux/spl@1c6d149feb4033e4a56fb987004edc5d45288bcb

Ported-by: Tim Chase &lt;tim@chase2k.com&gt;
Signed-off-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Closes #1509
</content>
</entry>
<entry>
<title>Use taskq for dump_bytes()</title>
<updated>2013-05-06T21:05:42Z</updated>
<author>
<name>Brian Behlendorf</name>
<email>behlendorf1@llnl.gov</email>
</author>
<published>2013-05-03T21:17:21Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=044baf009aac4935eca0f96477eb3c43e95d758a'/>
<id>urn:sha1:044baf009aac4935eca0f96477eb3c43e95d758a</id>
<content type='text'>
The vn_rdwr() function performs I/O by calling the vfs_write() or
vfs_read() functions.  These functions reside just below the system
call layer and the expectation is they have almost the entire 8k of
stack space to work with.  In fact, certain layered configurations
such as ext+lvm+md+multipath require the majority of this stack to
avoid stack overflows.

To avoid this posibility the vn_rdwr() call in dump_bytes() has been
moved to the ZIO_TYPE_FREE, taskq.  This ensures that all I/O will be
performed with the majority of the stack space available.  This ends
up being very similiar to as if the I/O were issued via sys_write()
or sys_read().

Signed-off-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Closes #1399
Closes #1423
</content>
</entry>
<entry>
<title>Illumos #3581 spa_zio_taskq[ZIO_TYPE_FREE][ZIO_TASKQ_ISSUE]-&gt;tq_lock contention</title>
<updated>2013-05-06T21:05:37Z</updated>
<author>
<name>Adam Leventhal</name>
<email>ahl@delphix.com</email>
</author>
<published>2013-05-06T19:24:30Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7ef5e54e2e28884a04dc800657967b891239e933'/>
<id>urn:sha1:7ef5e54e2e28884a04dc800657967b891239e933</id>
<content type='text'>
3581 spa_zio_taskq[ZIO_TYPE_FREE][ZIO_TASKQ_ISSUE]-&gt;tq_lock is piping hot

Reviewed by: Matthew Ahrens &lt;mahrens@delphix.com&gt;
Reviewed by: George Wilson &lt;george.wilson@delphix.com&gt;
Reviewed by: Christopher Siden &lt;christopher.siden@delphix.com&gt;
Reviewed by: Gordon Ross &lt;gordon.ross@nexenta.com&gt;
Approved by: Richard Lowe &lt;richlowe@richlowe.net&gt;

References:
  illumos/illumos-gate@ec94d32
  https://illumos.org/issues/3581

Notes for Linux port:

Earlier commit 08d08eb reduced contention on this taskq lock by simply
reducing the number of z_fr_iss threads from 100 to one-per-CPU.  We
also optimized the taskq implementation in zfsonlinux/spl@3c6ed54.
These changes significantly improved unlink performance to acceptable
levels.

This patch further reduces time spent spinning on this lock by
randomly dispatching the work items over multiple independent task
queues.  The Illumos ZFS developers stated that this lock contention
only arose after "3329 spa_sync() spends 10-20% of its time in
spa_free_sync_cb()" was landed.  It's not clear if 3329 affects the
Linux port or not.  I didn't see spa_free_sync_cb() show up in
oprofile sessions while unlinking large files, but I may just not
have used the right test case.

I tested unlinking a 1 TB of data with and without the patch and
didn't observe a meaningful difference in elapsed time.  However,
oprofile showed that the percent time spent in taskq_thread() was
reduced from about 16% to about 5%.  Aside from a possible slight
performance benefit this may be worth landing if only for the sake of
maintaining consistency with upstream.

Ported-by: Ned Bass &lt;bass6@llnl.gov&gt;
Closes #1327
</content>
</entry>
<entry>
<title>Illumos #3329, #3330, #3331, #3335</title>
<updated>2013-05-06T19:39:34Z</updated>
<author>
<name>George Wilson</name>
<email>george.wilson@delphix.com</email>
</author>
<published>2013-05-06T17:14:52Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=55d85d5a8c45c4559a4a0e675c37b0c3afb19c2f'/>
<id>urn:sha1:55d85d5a8c45c4559a4a0e675c37b0c3afb19c2f</id>
<content type='text'>
3329 spa_sync() spends 10-20% of its time in spa_free_sync_cb()
3330 space_seg_t should have its own kmem_cache
3331 deferred frees should happen after sync_pass 1
3335 make SYNC_PASS_* constants tunable

Reviewed by: Adam Leventhal &lt;ahl@delphix.com&gt;
Reviewed by: Matt Ahrens &lt;matthew.ahrens@delphix.com&gt;
Reviewed by: Christopher Siden &lt;chris.siden@delphix.com&gt;
Reviewed by: Eric Schrock &lt;eric.schrock@delphix.com&gt;
Reviewed by: Richard Lowe &lt;richlowe@richlowe.net&gt;
Reviewed by: Dan McDonald &lt;danmcd@nexenta.com&gt;
Approved by: Eric Schrock &lt;eric.schrock@delphix.com&gt;

References:
  illumos/illumos-gate@01f55e48fb4d524eaf70687728aa51b7762e2e97
  https://www.illumos.org/issues/3329
  https://www.illumos.org/issues/3330
  https://www.illumos.org/issues/3331
  https://www.illumos.org/issues/3335

Ported-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
</content>
</entry>
<entry>
<title>Illumos #3306, #3321</title>
<updated>2013-05-03T23:53:52Z</updated>
<author>
<name>George Wilson</name>
<email>george.wilson@delphix.com</email>
</author>
<published>2013-05-02T23:36:32Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=5853fe790d1df58c5dd85ea52c5e165b6d43013c'/>
<id>urn:sha1:5853fe790d1df58c5dd85ea52c5e165b6d43013c</id>
<content type='text'>
3306 zdb should be able to issue reads in parallel
3321 'zpool reopen' command should be documented in the man
     page and help

Reviewed by: Adam Leventhal &lt;ahl@delphix.com&gt;
Reviewed by: Matt Ahrens &lt;matthew.ahrens@delphix.com&gt;
Reviewed by: Christopher Siden &lt;chris.siden@delphix.com&gt;
Approved by: Garrett D'Amore &lt;garrett@damore.org&gt;

References:
  illumos/illumos-gate@31d7e8fa33fae995f558673adb22641b5aa8b6e1
  https://www.illumos.org/issues/3306
  https://www.illumos.org/issues/3321

The vdev_file.c implementation in this patch diverges significantly
from the upstream version.  For consistenty with the vdev_disk.c
code the upstream version leverages the Illumos bio interfaces.
This makes sense for Illumos but not for ZoL for two reasons.

1) The vdev_disk.c code in ZoL has been rewritten to use the
   Linux block device interfaces which differ significantly
   from those in Illumos.  Therefore, updating the vdev_file.c
   to use the Illumos interfaces doesn't get you consistency
   with vdev_disk.c.

2) Using the upstream patch as is would requiring implementing
   compatibility code for those Solaris block device interfaces
   in user and kernel space.  That additional complexity could
   lead to confusion and doesn't buy us anything.

For these reasons I've opted to simply move the existing vn_rdwr()
as is in to the taskq function.  This has the advantage of being
low risk and easy to understand.  Moving the vn_rdwr() function
in to its own taskq thread also neatly avoids the possibility of
a stack overflow.

Finally, because of the additional work which is being handled by
the free taskq the number of threads has been increased.  The
thread count under Illumos defaults to 100 but was decreased to 2
in commit 08d08e due to contention.  We increase it to 8 until
the contention can be address by porting Illumos #3581.

Ported-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Closes #1354
</content>
</entry>
<entry>
<title>3246 ZFS I/O deadman thread</title>
<updated>2013-05-02T00:05:52Z</updated>
<author>
<name>George.Wilson</name>
<email>george.wilson@delphix.com</email>
</author>
<published>2013-04-29T22:49:23Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=cc92e9d0c3e67a7e66c844466f85696a087bf60a'/>
<id>urn:sha1:cc92e9d0c3e67a7e66c844466f85696a087bf60a</id>
<content type='text'>
Reviewed by: Matt Ahrens &lt;matthew.ahrens@delphix.com&gt;
Reviewed by: Eric Schrock &lt;eric.schrock@delphix.com&gt;
Reviewed by: Christopher Siden &lt;chris.siden@delphix.com&gt;
Approved by: Garrett D'Amore &lt;garrett@damore.org&gt;

NOTES: This patch has been reworked from the original in the
following ways to accomidate Linux ZFS implementation

*) Usage of the cyclic interface was replaced by the delayed taskq
   interface.  This avoids the need to implement new compatibility
   code and allows us to rely on the existing taskq implementation.

*) An extern for zfs_txg_synctime_ms was added to sys/dsl_pool.h
   because declaring externs in source files as was done in the
   original patch is just plain wrong.

*) Instead of panicing the system when the deadman triggers a
   zevent describing the blocked vdev and the first pending I/O
   is posted.  If the panic behavior is desired Linux provides
   other generic methods to panic the system when threads are
   observed to hang.

*) For reference, to delay zios by 30 seconds for testing you can
   use zinject as follows: 'zinject -d &lt;vdev&gt; -D30 &lt;pool&gt;'

References:
  illumos/illumos-gate@283b84606b6fc326692c03273de1774e8c122f9a
  https://www.illumos.org/issues/3246

Ported-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Closes #1396
</content>
</entry>
<entry>
<title>Make spa.c assertions catch unsupported pre-feature flag pool versions</title>
<updated>2013-02-12T18:27:44Z</updated>
<author>
<name>Richard Yao</name>
<email>ryao@cs.stonybrook.edu</email>
</author>
<published>2013-02-10T00:25:55Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=8dca0a9a386a7e435889e7d621e5029a15dad612'/>
<id>urn:sha1:8dca0a9a386a7e435889e7d621e5029a15dad612</id>
<content type='text'>
A couple of assertions in spa.c were designed to prevent the use of
invalid pool versions. They were written under the assumption
that all valid pools are less than SPA_VERSION. Since feature flags
jumped from 28 to 5000, any numbers in the range 28 to 5000
non-inclusive will fail to trigger them.  We switch to the new
SPA_VERSION_IS_SUPPORTED macro to correct this.

Signed-off-by: Richard Yao &lt;ryao@cs.stonybrook.edu&gt;
Signed-off-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Closes #1282
</content>
</entry>
</feed>
