[developer] Re: [openzfs/openzfs] 6363 Add UNMAP/TRIM functionality to ZFS and Illumos (#172)

2017-05-11 Thread Matthew Ahrens
ahrens commented on this pull request. > + ASSERT(spa->spa_num_auto_trimming > 0); + spa->spa_num_auto_trimming--; + if (spa->spa_num_auto_trimming == 0) + cv_broadcast(&spa->spa_auto_trim_done_cv); + mutex_exit(&spa->spa_auto_trim_lock); +} + +/* + * Determin

[developer] Re: [openzfs/openzfs] 6363 Add UNMAP/TRIM functionality to ZFS and Illumos (#172)

2017-05-11 Thread Matthew Ahrens
ahrens commented on this pull request. > + * starting and the current txg sync was invoked on its behalf, +* so be prepared to postpone autotrim processing. +*/ + if (!mutex_tryenter(&spa->spa_auto_trim_lock)) + return; + spa->spa_num_auto_trimming

[developer] Re: [openzfs/openzfs] 6363 Add UNMAP/TRIM functionality to ZFS and Illumos (#172)

2017-05-11 Thread Matthew Ahrens
ahrens commented on this pull request. > + + /* +* Another pool management task might be currently prevented from +* starting and the current txg sync was invoked on its behalf, +* so be prepared to postpone autotrim processing. +*/ + if (!mutex_tryent

[developer] Re: [openzfs/openzfs] 6363 Add UNMAP/TRIM functionality to ZFS and Illumos (#172)

2017-05-11 Thread Matthew Ahrens
ahrens commented on this pull request. > + for (uint64_t i = 0; i < spa->spa_root_vdev->vdev_children; i++) { + vdev_t *vd = spa->spa_root_vdev->vdev_child[i]; + vdev_trim_info_t *vti = kmem_zalloc(sizeof (*vti), KM_SLEEP); + vti->vti_vdev = vd; +

[developer] Re: [openzfs/openzfs] 8100 8021 seems to cause random BAD TRAP: type=d (#gp General protection) (#375)

2017-05-11 Thread Jorgen Lundman
lundman approved this pull request. Runs through the tester for us, which is an improvement. `abd_copy()` still gets called with `src==dst`, but this is a noop generally. As we added "ABD move" to our repo to decrease defragmentation, we will add code to skip the null copy, but since that is pa

[developer] Re: [openzfs/openzfs] 6363 Add UNMAP/TRIM functionality to ZFS and Illumos (#172)

2017-05-11 Thread Saso Kiselkov
skiselkov commented on this pull request. > + for (uint64_t i = 0; i < spa->spa_root_vdev->vdev_children; i++) { + vdev_t *vd = spa->spa_root_vdev->vdev_child[i]; + vdev_trim_info_t *vti = kmem_zalloc(sizeof (*vti), KM_SLEEP); + vti->vti_vdev = vd; +

[developer] Re: [openzfs/openzfs] 6363 Add UNMAP/TRIM functionality to ZFS and Illumos (#172)

2017-05-11 Thread Saso Kiselkov
skiselkov commented on this pull request. > + spa_get_force_trim(vd->vdev_spa) != + SPA_FORCE_TRIM_ON) { + zio->io_error = SET_ERROR(ENOTSUP); + break; + } + +

[developer] Re: [openzfs/openzfs] 6363 Add UNMAP/TRIM functionality to ZFS and Illumos (#172)

2017-05-11 Thread Saso Kiselkov
@ahrens I tried to implement the metaslab weight adjustment when taking chunks out of the metaslab due to trimming. The case when the metaslab is loaded is easy. However, the unloaded case, where we only have the spacemap histogram, is not possible. Here's why: I can construct a "negative" histo

[developer] Re: [openzfs/openzfs] 6363 Add UNMAP/TRIM functionality to ZFS and Illumos (#172)

2017-05-11 Thread Saso Kiselkov
skiselkov commented on this pull request. > + ASSERT(spa->spa_num_auto_trimming > 0); + spa->spa_num_auto_trimming--; + if (spa->spa_num_auto_trimming == 0) + cv_broadcast(&spa->spa_auto_trim_done_cv); + mutex_exit(&spa->spa_auto_trim_lock); +} + +/* + * Deter

[developer] Re: [openzfs/openzfs] 6363 Add UNMAP/TRIM functionality to ZFS and Illumos (#172)

2017-05-11 Thread Saso Kiselkov
skiselkov commented on this pull request. > + * threads because the trim rate might have changed above. +*/ + cv_broadcast(&spa->spa_man_trim_update_cv); + mutex_exit(&spa->spa_man_trim_lock); + return; + } + spa_

[developer] Re: [openzfs/openzfs] 6363 Add UNMAP/TRIM functionality to ZFS and Illumos (#172)

2017-05-11 Thread Saso Kiselkov
skiselkov commented on this pull request. > + * starting and the current txg sync was invoked on its behalf, +* so be prepared to postpone autotrim processing. +*/ + if (!mutex_tryenter(&spa->spa_auto_trim_lock)) + return; + spa->spa_num_auto_trimmi

[developer] Re: [openzfs/openzfs] 6363 Add UNMAP/TRIM functionality to ZFS and Illumos (#172)

2017-05-11 Thread Saso Kiselkov
skiselkov commented on this pull request. > + + /* +* Another pool management task might be currently prevented from +* starting and the current txg sync was invoked on its behalf, +* so be prepared to postpone autotrim processing. +*/ + if (!mutex_try

[developer] Re: [openzfs/openzfs] 6363 Add UNMAP/TRIM functionality to ZFS and Illumos (#172)

2017-05-11 Thread Saso Kiselkov
skiselkov commented on this pull request. > + */ +typedef enum { + SPA_FORCE_TRIM_OFF = 0, /* default */ + SPA_FORCE_TRIM_ON +} spa_force_trim_t; + +/* + * Should we send TRIM commands in-line during normal pool operation while + * deleting stuff? + * OFF: no + * ON: yes + */

[developer] Re: [openzfs/openzfs] Merge remote-tracking branch 'illumos/master' into illumos-sync (#376)

2017-05-11 Thread Prakash Surya
Merged #376. -- 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/376#event-1079193443 -- openzfs-developer Archives: https://openzfs.topicbox.com/gro

[developer] Re: [openzfs/openzfs] Merge remote-tracking branch 'illumos/master' into illumos-sync (#376)

2017-05-11 Thread Prakash Surya
prakashsurya approved this pull request. -- 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/376#pullrequestreview-37728770 -- openzfs-developer

[developer] Re: [openzfs/openzfs] 6363 Add UNMAP/TRIM functionality to ZFS and Illumos (#172)

2017-05-11 Thread Brian Behlendorf
behlendorf commented on this pull request. > + spa_get_force_trim(vd->vdev_spa) != + SPA_FORCE_TRIM_ON) { + zio->io_error = SET_ERROR(ENOTSUP); + break; + } + +

[developer] Re: [openzfs/openzfs] 6363 Add UNMAP/TRIM functionality to ZFS and Illumos (#172)

2017-05-11 Thread Matthew Ahrens
ahrens commented on this pull request. > + */ +typedef enum { + SPA_FORCE_TRIM_OFF = 0, /* default */ + SPA_FORCE_TRIM_ON +} spa_force_trim_t; + +/* + * Should we send TRIM commands in-line during normal pool operation while + * deleting stuff? + * OFF: no + * ON: yes + */ +t

[developer] Re: [openzfs/openzfs] 6363 Add UNMAP/TRIM functionality to ZFS and Illumos (#172)

2017-05-11 Thread Matthew Ahrens
ahrens commented on this pull request. > + + spa_config_enter(spa, SCL_STATE_ALL, FTAG, RW_READER); + ASSERT(vd->vdev_ms[0] != NULL); + cursor = vd->vdev_ms[0]->ms_start; + i = 0; + while (i < vti->vti_vdev->vdev_ms_count && !spa->spa_man_trim_stop) { +

[developer] Re: [openzfs/openzfs] 8100 8021 seems to cause random BAD TRAP: type=d (#gp General protection) (#375)

2017-05-11 Thread Dan Kimmel
@zettabot go -- 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/375#issuecomment-300838936 -- openzfs-developer Archives: https://openzfs.topicbox.c