Skip to content

Commit

Permalink
Latest milestone. Still fails to pass txg_wait_synced().
Browse files Browse the repository at this point in the history
  • Loading branch information
lundman authored and BjoKaSH committed Mar 7, 2013
1 parent f4a449d commit 658b755
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 19 deletions.
8 changes: 4 additions & 4 deletions module/zfs/dbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ dbuf_init(void)
retry:
h->hash_table_mask = hsize - 1;

printf("[dbuf] init hsize is 0x%llx mask is 0x%llx\n", hsize, h->hash_table_mask);
//printf("[dbuf] init hsize is 0x%llx mask is 0x%llx\n", hsize, h->hash_table_mask);

h->hash_table = kmem_zalloc(hsize * sizeof (void *), KM_PUSHPAGE);

Expand All @@ -313,9 +313,9 @@ dbuf_init(void)
goto retry;
}

printf("[dbuf] hash_table allocated %llu bytes (hsize %llu)\n",
hsize * sizeof (void *),
hsize);
//printf("[dbuf] hash_table allocated %llu bytes (hsize %llu)\n",
// hsize * sizeof (void *),
// hsize);

dbuf_cache = kmem_cache_create("dmu_buf_impl_t",
sizeof (dmu_buf_impl_t),
Expand Down
3 changes: 3 additions & 0 deletions module/zfs/spa.c
Original file line number Diff line number Diff line change
Expand Up @@ -3507,6 +3507,7 @@ spa_create(const char *pool, nvlist_t *nvroot, nvlist_t *props,
* bean counters are appropriately updated.
*/
txg_wait_synced(spa->spa_dsl_pool, txg);
printf("[spa] back from txg_wait_synced!\n");

spa_config_sync(spa, B_FALSE, B_TRUE);

Expand Down Expand Up @@ -6012,6 +6013,7 @@ spa_sync(spa_t *spa, uint64_t txg)
*/
spa_config_enter(spa, SCL_STATE, FTAG, RW_READER);
while (list_head(&spa->spa_state_dirty_list) != NULL) {
printf("spa_sync 0th loop\n");
/*
* We need the write lock here because, for aux vdevs,
* calling vdev_config_dirty() modifies sav_config.
Expand Down Expand Up @@ -6120,6 +6122,7 @@ spa_sync(spa_t *spa, uint64_t txg)
* We hold SCL_STATE to prevent vdev open/close/etc.
* while we're attempting to write the vdev labels.
*/
printf("spa_sync 2nd loop\n");
spa_config_enter(spa, SCL_STATE, FTAG, RW_READER);

if (list_is_empty(&spa->spa_config_dirty_list)) {
Expand Down
14 changes: 7 additions & 7 deletions module/zfs/txg.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ txg_sync_start(dsl_pool_t *dp)

mutex_enter(&tx->tx_sync_lock);

dprintf("pool %p\n", dp);
printf("pool %p\n", dp);

ASSERT(tx->tx_threads == 0);

Expand Down Expand Up @@ -185,7 +185,7 @@ txg_sync_stop(dsl_pool_t *dp)
{
tx_state_t *tx = &dp->dp_tx;

dprintf("pool %p\n", dp);
printf("pool %p\n", dp);
/*
* Finish off any work in progress.
*/
Expand Down Expand Up @@ -435,7 +435,7 @@ txg_sync_thread(dsl_pool_t *dp)
!tx->tx_exiting && timer > 0 &&
tx->tx_synced_txg >= tx->tx_sync_txg_waiting &&
tx->tx_quiesced_txg == 0) {
dprintf("waiting; tx_synced=%llu waiting=%llu dp=%p\n",
printf("waiting; tx_synced=%llu waiting=%llu dp=%p\n",
tx->tx_synced_txg, tx->tx_sync_txg_waiting, dp);
txg_thread_wait(tx, &cpr, &tx->tx_sync_more_cv, timer);
delta = ddi_get_lbolt() - start;
Expand Down Expand Up @@ -471,7 +471,7 @@ txg_sync_thread(dsl_pool_t *dp)
vdev_get_stats(spa->spa_root_vdev, &th->th_vs1);
dsl_pool_txg_history_put(th);

dprintf("txg=%llu quiesce_txg=%llu sync_txg=%llu\n",
printf("txg=%llu quiesce_txg=%llu sync_txg=%llu\n",
txg, tx->tx_quiesce_txg_waiting, tx->tx_sync_txg_waiting);
mutex_exit(&tx->tx_sync_lock);

Expand Down Expand Up @@ -536,7 +536,7 @@ txg_quiesce_thread(dsl_pool_t *dp)
txg_thread_exit(tx, &cpr, &tx->tx_quiesce_thread);

txg = tx->tx_open_txg;
dprintf("txg=%llu quiesce_txg=%llu sync_txg=%llu\n",
printf("txg=%llu quiesce_txg=%llu sync_txg=%llu\n",
txg, tx->tx_quiesce_txg_waiting,
tx->tx_sync_txg_waiting);
mutex_exit(&tx->tx_sync_lock);
Expand All @@ -546,7 +546,7 @@ txg_quiesce_thread(dsl_pool_t *dp)
/*
* Hand this txg off to the sync thread.
*/
dprintf("quiesce done, handing off txg %llu\n", txg);
printf("quiesce done, handing off txg %llu\n", txg);
tx->tx_quiesced_txg = txg;
cv_broadcast(&tx->tx_sync_more_cv);
cv_broadcast(&tx->tx_quiesce_done_cv);
Expand Down Expand Up @@ -619,7 +619,7 @@ txg_wait_open(dsl_pool_t *dp, uint64_t txg)
txg = tx->tx_open_txg + 1;
if (tx->tx_quiesce_txg_waiting < txg)
tx->tx_quiesce_txg_waiting = txg;
dprintf("txg=%llu quiesce_txg=%llu sync_txg=%llu\n",
printf("txg=%llu quiesce_txg=%llu sync_txg=%llu\n",
txg, tx->tx_quiesce_txg_waiting, tx->tx_sync_txg_waiting);
while (tx->tx_open_txg < txg) {
cv_broadcast(&tx->tx_quiesce_more_cv);
Expand Down
4 changes: 3 additions & 1 deletion module/zfs/vdev_disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,8 @@ vdev_disk_io_start(zio_t *zio)
#endif
int flags, error;

printf("vdev_disk_io_start\n");

if (zio->io_type == ZIO_TYPE_IOCTL) {
zio_vdev_io_bypass(zio);

Expand Down Expand Up @@ -461,7 +463,7 @@ vdev_disk_io_start(zio_t *zio)
* and will call vdev_disk_ioctl_done()
* upon completion.
*/
return;
return ZIO_PIPELINE_STOP;;
} else if (error == ENOTSUP || error == ENOTTY) {
/*
* If we get ENOTSUP or ENOTTY, we know that
Expand Down
1 change: 1 addition & 0 deletions module/zfs/vdev_missing.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ vdev_missing_close(vdev_t *vd)
static int
vdev_missing_io_start(zio_t *zio)
{
printf("vdev_missing_io_start\n");
zio->io_error = ENOTSUP;
return (ZIO_PIPELINE_CONTINUE);
}
Expand Down
2 changes: 1 addition & 1 deletion module/zfs/zfs_osx.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ zfs_vfs_sysctl(int *name, __unused u_int namelen, user_addr_t oldp, size_t *oldl
kern_return_t zfs_start (kmod_info_t * ki, void * d)
{

printf("ZFS: Loaded module v0.01. Pool version -1\n");
printf("ZFS: Loading module ...\n");

//if ((error = zvol_init()) != 0)
// goto out1;
Expand Down
15 changes: 9 additions & 6 deletions module/zfs/zio.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ zio_wait_for_children(zio_t *zio, enum zio_child child, enum zio_wait_type wait)
if (*countp != 0) {
zio->io_stage >>= 1;
zio->io_stall = countp;
waiting = B_TRUE;
waiting = B_TRUE;
}
mutex_exit(&zio->io_lock);

Expand Down Expand Up @@ -1016,8 +1016,9 @@ zio_write_bp_init(zio_t *zio)
* wait for them and then repeat this pipeline stage.
*/
if (zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_READY) ||
zio_wait_for_children(zio, ZIO_CHILD_LOGICAL, ZIO_WAIT_READY))
zio_wait_for_children(zio, ZIO_CHILD_LOGICAL, ZIO_WAIT_READY)) {
return (ZIO_PIPELINE_STOP);
}

if (!IO_IS_ALLOCATING(zio))
return (ZIO_PIPELINE_CONTINUE);
Expand Down Expand Up @@ -1119,7 +1120,6 @@ zio_write_bp_init(zio_t *zio)
zio->io_pipeline = ZIO_DDT_WRITE_PIPELINE;
}
}

return (ZIO_PIPELINE_CONTINUE);
}

Expand Down Expand Up @@ -1249,6 +1249,7 @@ __zio_execute(zio_t *zio)
{
zio->io_executor = curthread;


while (zio->io_stage < ZIO_STAGE_DONE) {
enum zio_stage pipeline = zio->io_pipeline;
enum zio_stage stage = zio->io_stage;
Expand Down Expand Up @@ -2856,12 +2857,14 @@ zio_done(zio_t *zio)
if (zio_wait_for_children(zio, ZIO_CHILD_VDEV, ZIO_WAIT_DONE) ||
zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_DONE) ||
zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_DONE) ||
zio_wait_for_children(zio, ZIO_CHILD_LOGICAL, ZIO_WAIT_DONE))
zio_wait_for_children(zio, ZIO_CHILD_LOGICAL, ZIO_WAIT_DONE)) {
return (ZIO_PIPELINE_STOP);
}

for (c = 0; c < ZIO_CHILD_TYPES; c++)
for (w = 0; w < ZIO_WAIT_TYPES; w++)
for (w = 0; w < ZIO_WAIT_TYPES; w++) {
ASSERT(zio->io_children[c][w] == 0);
}

if (zio->io_bp != NULL) {
ASSERT(zio->io_bp->blk_pad[0] == 0);
Expand Down Expand Up @@ -3110,7 +3113,7 @@ zio_done(zio_t *zio)
for (pio = zio_walk_parents(zio); pio != NULL; pio = pio_next) {
zio_link_t *zl = zio->io_walk_link;
pio_next = zio_walk_parents(zio);
zio_remove_child(pio, zio, zl);
zio_remove_child(pio, zio, zl);
zio_notify_parent(pio, zio, ZIO_WAIT_DONE);
}

Expand Down

0 comments on commit 658b755

Please sign in to comment.