[developer] Re: [openzfs/openzfs] 8414 Implemented zpool scrub pause/resume (#407)

2017-06-23 Thread LOLi
@alek-p i found these in the "Artifacts" tab from the Jenkins webui: 
http://jenkins.open-zfs.org/blue/organizations/jenkins/openzfs%2Fopenzfs/detail/PR-407/3/artifacts.

It seems `zpool scrub -p` did not pause the scrub in `zpool_scrub_002_pos`:

```
23:07:00.80 command: zpool scrub testpool
23:07:00.80 command: zpool scrub -p testpool
23:07:00.80 doing scan sync txg 81; bm=21/9/0/696
23:07:00.80 scanned dataset 21 (testpool) with min=1 max=78; suspending=1
23:07:00.80 visited 282 blocks in 1048ms
23:07:00.80 doing scan sync txg 82; bm=21/9/0/967
23:07:00.80 scanned dataset 21 (testpool) with min=1 max=78; suspending=1
23:07:00.80 visited  blocks in 5032ms
23:07:00.80 doing scan sync txg 83; bm=21/9/0/2065
23:07:00.80 scanned dataset 21 (testpool) with min=1 max=78; suspending=1
23:07:00.80 visited 1103 blocks in 5040ms
23:07:00.80 doing scan sync txg 84; bm=21/9/0/3156
```

Full log:
```
Test: /opt/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_002_pos 
(run as root) [00:19] [FAIL]
23:06:42.84 ASSERTION: Verify scrub, scrub -p, and scrub -s show the right 
status.
23:06:47.51 SUCCESS: zpool scrub testpool
23:06:47.53 SUCCESS: is_pool_scrubbing testpool
23:06:48.72 SUCCESS: zpool scrub -p testpool
23:06:48.74 SUCCESS: is_pool_scrub_paused testpool
23:06:48.75 SUCCESS: zpool scrub -p testpool exited 1
23:06:48.76 SUCCESS: is_pool_scrub_paused testpool
23:06:50.01 cannot scrub testpool: currently scrubbing; use 'zpool scrub -s' to 
cancel current scrub
23:06:50.01 ERROR: zpool scrub testpool exited 1
23:06:51.20 NOTE: Performing test-fail callback 
(/opt/zfs-tests/callbacks/zfs_dbgmsg)
23:06:51.23 =
23:06:51.23  Tailing last 200 lines of zfs_dbgmsg log
23:06:51.23 =
23:07:00.80 doing scan sync txg 11; ddt bm=0/0/0/0
23:07:00.80 scanned 0 ddt entries with class_max = 0; suspending=0
23:07:00.80 scanned dataset 18 (testpool/$ORIGIN@$ORIGIN) with min=6 max=8; 
suspending=0
23:07:00.80 scanned dataset 46 (testpool/testfs) with min=6 max=8; suspending=0
23:07:00.80 scanned dataset 21 (testpool) with min=6 max=8; suspending=0
23:07:00.80 scanned dataset 15 (testpool/$ORIGIN) with min=6 max=8; suspending=0
23:07:00.80 visited 61 blocks in 3ms
23:07:00.80 txg 11 traversal complete, waiting till txg 12
23:07:00.80 txg 12 scan complete
23:07:00.80 txg 12 scan done errors=0
23:07:00.80 spa=testpool async request task=8
23:07:00.80 txg 12, spa testpool, DTL old object 0, new object 52
23:07:00.80 txg 12, spa testpool, DTL old object 0, new object 53
23:07:00.80 command: zpool online testpool c4t1d0
23:07:00.80 spa=testpool async request task=16
23:07:00.80 command: zpool offline testpool c4t2d0
23:07:00.80 restarting resilver txg=17
23:07:00.80 restarting scan func=2 txg=17
23:07:00.80 txg 17 scan setup func=2 mintxg=12 maxtxg=14
23:07:00.80 doing scan sync txg 17; ddt bm=0/0/0/0
23:07:00.80 scanned 0 ddt entries with class_max = 0; suspending=0
23:07:00.80 scanned dataset 18 (testpool/$ORIGIN@$ORIGIN) with min=12 max=14; 
suspending=0
23:07:00.80 scanned dataset 15 (testpool/$ORIGIN) with min=12 max=14; 
suspending=0
23:07:00.80 scanned dataset 46 (testpool/testfs) with min=12 max=14; 
suspending=0
23:07:00.80 scanned dataset 21 (testpool) with min=12 max=14; suspending=0
23:07:00.80 visited 45 blocks in 2ms
23:07:00.80 txg 17 traversal complete, waiting till txg 18
23:07:00.80 txg 18 scan complete
23:07:00.80 txg 18 scan done errors=0
23:07:00.80 spa=testpool async request task=8
23:07:00.80 command: zpool online testpool c4t2d0
23:07:00.80 spa=testpool async request task=16
23:07:00.80 command: zpool offline testpool c4t3d0
23:07:00.80 restarting resilver txg=23
23:07:00.80 restarting scan func=2 txg=23
23:07:00.80 txg 23 scan setup func=2 mintxg=18 maxtxg=20
23:07:00.80 doing scan sync txg 23; ddt bm=0/0/0/0
23:07:00.80 scanned 0 ddt entries with class_max = 0; suspending=0
23:07:00.80 scanned dataset 18 (testpool/$ORIGIN@$ORIGIN) with min=18 max=20; 
suspending=0
23:07:00.80 scanned dataset 46 (testpool/testfs) with min=18 max=20; 
suspending=0
23:07:00.80 scanned dataset 21 (testpool) with min=18 max=20; suspending=0
23:07:00.80 scanned dataset 15 (testpool/$ORIGIN) with min=18 max=20; 
suspending=0
23:07:00.80 visited 45 blocks in 2ms
23:07:00.80 txg 23 traversal complete, waiting till txg 24
23:07:00.80 txg 24 scan complete
23:07:00.80 txg 24 scan done errors=0
23:07:00.80 spa=testpool async request task=8
23:07:00.80 command: zpool online testpool c4t3d0
23:07:00.80 command: zpool online testpool c4t1d0
23:07:00.80 command: zpool online testpool c4t1d0
23:07:00.80 command: zpool online testpool c4t1d0
23:07:00.80 command: zpool online testpool c4t1d0
23:07:00.80 command: zpool online testpool c4t1d0
23:07:00.80 command: zpool online testpool c4t1d0
23:07:00.80 command: zpool online testpool c4t1d0
23:07:00.80 command: zpool online testpool c4t1d0
23:07:00.80 command: 

[developer] [openzfs/openzfs] 8423 Implement large_dnode pool feature (#409)

2017-06-23 Thread Matthew Ahrens
Justification
-

This feature adds support for variable length dnodes. Our motivation is
to eliminate the overhead associated with using spill blocks.  Spill
blocks are used to store system attribute data (i.e. file metadata) that
does not fit in the dnode's bonus buffer. By allowing a larger bonus
buffer area the use of a spill block can be avoided.  Spill blocks
potentially incur an additional read I/O for every dnode in a dnode
block. As a worst case example, reading 32 dnodes from a 16k dnode block
and all of the spill blocks could issue 33 separate reads. Now suppose
those dnodes have size 1024 and therefore don't need spill blocks.  Then
the worst case number of blocks read is reduced to from 33 to two--one
per dnode block. In practice spill blocks may tend to be co-located on
disk with the dnode blocks so the reduction in I/O would not be this
drastic. In a badly fragmented pool, however, the improvement could be
significant.

ZFS-on-Linux systems that make heavy use of extended attributes would
benefit from this feature. In particular, ZFS-on-Linux supports the
xattr=sa dataset property which allows file extended attribute data
to be stored in the dnode bonus buffer as an alternative to the
traditional directory-based format. Workloads such as SELinux and the
Lustre distributed filesystem often store enough xattr data to force
spill bocks when xattr=sa is in effect. Large dnodes may therefore
provide a performance benefit to such systems.

Other use cases that may benefit from this feature include files with
large ACLs and symbolic links with long target names. Furthermore,
this feature may be desirable on other platforms in case future
applications or features are developed that could make use of a
larger bonus buffer area.

Implementation
--

The size of a dnode may be a multiple of 512 bytes up to the size of
a dnode block (currently 16384 bytes). A dn_extra_slots field was
added to the current on-disk dnode_phys_t structure to describe the
size of the physical dnode on disk. The 8 bits for this field were
taken from the zero filled dn_pad2 field. The field represents how
many "extra" dnode_phys_t slots a dnode consumes in its dnode block.
This convention results in a value of 0 for 512 byte dnodes which
preserves on-disk format compatibility with older software.

Similarly, the in-memory dnode_t structure has a new dn_num_slots field
to represent the total number of dnode_phys_t slots consumed on disk.
Thus dn->dn_num_slots is 1 greater than the corresponding
dnp->dn_extra_slots. This difference in convention was adopted
because, unlike on-disk structures, backward compatibility is not a
concern for in-memory objects, so we used a more natural way to
represent size for a dnode_t.

The default size for newly created dnodes is determined by the value of
a new "dnodesize" dataset property. By default the property is set to
"legacy" which is compatible with older software. Setting the property
to "auto" will allow the filesystem to choose the most suitable dnode
size. Currently this just sets the default dnode size to 1k, but future
code improvements could dynamically choose a size based on observed
workload patterns. Dnodes of varying sizes can coexist within the same
dataset and even within the same dnode block. For example, to enable
automatically-sized dnodes, run

 # zfs set dnodesize=auto tank/fish

The user can also specify literal values for the dnodesize property.
These are currently limited to powers of two from 1k to 16k. The
power-of-2 limitation is only for simplicity of the user interface.
Internally the implementation can handle any multiple of 512 up to 16k,
and consumers of the DMU API can specify any legal dnode value.

The size of a new dnode is determined at object allocation time and
stored as a new field in the znode in-memory structure. New DMU
interfaces are added to allow the consumer to specify the dnode size
that a newly allocated object should use. Existing interfaces are
unchanged to avoid having to update every call site and to preserve
compatibility with external consumers such as Lustre. The new
interfaces names are given below. The versions of these functions that
don't take a dnodesize parameter now just call the _dnsize() versions
with a dnodesize of 0, which means use the legacy dnode size.

New DMU interfaces:
  dmu_object_alloc_dnsize()
  dmu_object_claim_dnsize()
  dmu_object_reclaim_dnsize()

New ZAP interfaces:
  zap_create_dnsize()
  zap_create_norm_dnsize()
  zap_create_flags_dnsize()
  zap_create_claim_norm_dnsize()
  zap_create_link_dnsize()

The constant DN_MAX_BONUSLEN is renamed to DN_OLD_MAX_BONUSLEN. The
spa_maxdnodesize() function should be used to determine the maximum
bonus length for a pool.

These are a few noteworthy changes to key functions:

* The prototype for dnode_hold_impl() now takes a "slots" parameter.
  When the DNODE_MUST_BE_FREE flag is set, this parameter is used to
  ensure the hole at the specified object

[developer] Re: [openzfs/openzfs] 8423 Implement large_dnode pool feature (#409)

2017-06-23 Thread Matthew Ahrens
Note: this is a port of: 
https://github.com/zfsonlinux/zfs/commit/50c957f702ea6d08a634e42f73e8a49931dd8055
 and 
https://github.com/zfsonlinux/zfs/commit/08f0510d87186575db00269fff17a3409de5ceb6
 . I had to make a few small changes to get it to pass lint, which are captured 
here: https://github.com/zfsonlinux/zfs/pull/6262

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openzfs/openzfs/pull/409#issuecomment-310729555
--
openzfs-developer
Archives: 
https://openzfs.topicbox.com/groups/developer/discussions/Tfefe6318017dd4c7-M2fef9d22d89d7e2e6d7db364
Powered by Topicbox: https://topicbox.com


[developer] Re: [openzfs/openzfs] 8414 Implemented zpool scrub pause/resume (#407)

2017-06-23 Thread Alek P
Thanks for the link @loli10K! The problem was something else:
```
23:06:48.76 SUCCESS: is_pool_scrub_paused testpool
23:06:50.01 cannot scrub testpool: currently scrubbing; use 'zpool scrub -s' to 
cancel current scrub
```
So it's the scrub resume that "wasn't working". In fact the resume was working 
but it was issuing two resume IOCTLs per one scrub pause cmd. The second one 
would see the restarted scrub and bail with an error.
Looks like illumos will re-issue a syscall when it returns ERESTART (probably 
what the OS should do). I've changed the scrub resume to use ECANCELED instead 
of ERESTART and it looks to be working as expected now. If the tests look good 
I'll make the same change in ZoL to keep the code consistent.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openzfs/openzfs/pull/407#issuecomment-310740392
--
openzfs-developer
Archives: 
https://openzfs.topicbox.com/groups/developer/discussions/T693650e65dc896fc-M1c2d438b811de624fe6066f1
Powered by Topicbox: https://topicbox.com


[developer] [openzfs/openzfs] Use segkpm for single-page slabs (#410)

2017-06-23 Thread Matthew Ahrens
I'm not an expert in the VM system so I'm looking for input on if this 
potential change is a good idea or not.  The idea is to use segkpm (the mapping 
of all of physical memory) to reference single-page slabs, rather than setting 
up and tearing down new TLB mappings in the kernel's heap.

This roughly doubles the performance of kmem_reap() of impacted caches.  We 
only do this for ZFS's caches, because they are not dumped.  More work would be 
required to dump these pages, and to allow mdb to access them via segkpm.

I noticed that seg_map has code to do something similar, but it's disabled on 
x86 (segmap_kpm=0).  So I was wondering if there's something wrong with this 
approach?  Unfortunately there weren't any comments explaining *why* it's 
disabled on x86.


You can view, comment on, or merge this pull request online at:

  https://github.com/openzfs/openzfs/pull/410

-- Commit Summary --

  * Use segkpm for single-page slabs

-- File Changes --

M usr/src/uts/common/sys/vmem.h (11)
M usr/src/uts/common/vm/seg_kmem.c (31)
M usr/src/uts/i86pc/os/startup.c (4)

-- Patch Links --

https://github.com/openzfs/openzfs/pull/410.patch
https://github.com/openzfs/openzfs/pull/410.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openzfs/openzfs/pull/410

--
openzfs-developer
Archives: 
https://openzfs.topicbox.com/groups/developer/discussions/T5530aa766ee8412c-Mc4c3739765814a3e08ee1c8a
Powered by Topicbox: https://topicbox.com


[developer] [openzfs/openzfs] Use EC2 "Spot Instances" with Jenkins Automation (#411)

2017-06-23 Thread Prakash Surya
The pricing of EC2 "Spot Instances" is generally much cheaper than
"On-Demand", so this change attempts to refactor the automation to
create the test instances using this less expensive instance type.
You can view, comment on, or merge this pull request online at:

  https://github.com/openzfs/openzfs/pull/411

-- Commit Summary --

  * Use EC2 "Spot Instances" with Jenkins Automation

-- File Changes --

M Jenkinsfile (50)
M jenkins/jobs/build_install_media.groovy (1)
M jenkins/pipelines/build_install_media.groovy (9)
M jenkins/sh/ansible-deploy-roles/ansible-deploy-roles.sh (4)
M jenkins/sh/aws-create-image/aws-create-image.sh (4)
M jenkins/sh/aws-delete-image/aws-delete-image.sh (4)
A jenkins/sh/aws-request-spot-instances/aws-request-spot-instances.sh (116)
A jenkins/sh/aws-request-spot-instances/base-specification.json (11)
A jenkins/sh/aws-request-spot-instances/block-device-mappings/none.json (3)
A 
jenkins/sh/aws-request-spot-instances/block-device-mappings/rpool-fix-labels.json
 (11)
A 
jenkins/sh/aws-request-spot-instances/block-device-mappings/run-zfs-tests.json 
(27)
D jenkins/sh/aws-run-instances/aws-run-instances.sh (120)
D jenkins/sh/aws-stop-instances/aws-stop-instances.sh (26)
M jenkins/sh/aws-terminate-instances/aws-terminate-instances.sh (4)
M jenkins/sh/download-remote-directory/download-remote-directory.sh (4)
M jenkins/sh/download-remote-file/download-remote-file.sh (4)
M jenkins/sh/library/aws.sh (22)

-- Patch Links --

https://github.com/openzfs/openzfs/pull/411.patch
https://github.com/openzfs/openzfs/pull/411.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openzfs/openzfs/pull/411

--
openzfs-developer
Archives: 
https://openzfs.topicbox.com/groups/developer/discussions/T9ea9c38e30ae9553-M0f5a1a6f3bc79e41ebd6bedc
Powered by Topicbox: https://topicbox.com