View | Details | Raw Unified | Return to bug 241980 | Differences between
and this patch

Collapse All | Expand All

(-)sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c (-2 / +2 lines)
Lines 373-379 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman Link Here
373
SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_checktime_ms, CTLFLAG_RDTUN,
373
SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_checktime_ms, CTLFLAG_RDTUN,
374
    &zfs_deadman_checktime_ms, 0,
374
    &zfs_deadman_checktime_ms, 0,
375
    "Period of checks for stalled ZFS I/O in milliseconds");
375
    "Period of checks for stalled ZFS I/O in milliseconds");
376
SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_enabled, CTLFLAG_RDTUN,
376
SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_enabled, CTLFLAG_RWTUN,
377
    &zfs_deadman_enabled, 0, "Kernel panic on stalled ZFS I/O");
377
    &zfs_deadman_enabled, 0, "Kernel panic on stalled ZFS I/O");
378
SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_asize_inflation, CTLFLAG_RWTUN,
378
SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_asize_inflation, CTLFLAG_RWTUN,
379
    &spa_asize_inflation, 0, "Worst case inflation factor for single sector writes");
379
    &spa_asize_inflation, 0, "Worst case inflation factor for single sector writes");
Lines 667-673 spa_deadman(void *arg, int pending) Link Here
667
	    (gethrtime() - spa->spa_sync_starttime) / NANOSEC,
667
	    (gethrtime() - spa->spa_sync_starttime) / NANOSEC,
668
	    ++spa->spa_deadman_calls);
668
	    ++spa->spa_deadman_calls);
669
	if (zfs_deadman_enabled)
669
	if (zfs_deadman_enabled)
670
		vdev_deadman(spa->spa_root_vdev);
670
		(void)vdev_deadman(spa->spa_root_vdev);
671
#ifdef __FreeBSD__
671
#ifdef __FreeBSD__
672
#ifdef _KERNEL
672
#ifdef _KERNEL
673
	callout_schedule(&spa->spa_deadman_cycid,
673
	callout_schedule(&spa->spa_deadman_cycid,
(-)sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h (-1 / +1 lines)
Lines 96-102 extern void vdev_metaslab_set_size(vdev_ Link Here
96
extern void vdev_ashift_optimize(vdev_t *);
96
extern void vdev_ashift_optimize(vdev_t *);
97
extern void vdev_expand(vdev_t *vd, uint64_t txg);
97
extern void vdev_expand(vdev_t *vd, uint64_t txg);
98
extern void vdev_split(vdev_t *vd);
98
extern void vdev_split(vdev_t *vd);
99
extern void vdev_deadman(vdev_t *vd);
99
extern int vdev_deadman(vdev_t *vd);
100
100
101
extern void vdev_get_stats(vdev_t *vd, vdev_stat_t *vs);
101
extern void vdev_get_stats(vdev_t *vd, vdev_stat_t *vs);
102
extern void vdev_clear_stats(vdev_t *vd);
102
extern void vdev_clear_stats(vdev_t *vd);
(-)sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c (-3 / +35 lines)
Lines 29-34 Link Here
29
 * Copyright 2017 Joyent, Inc.
29
 * Copyright 2017 Joyent, Inc.
30
 */
30
 */
31
31
32
#include <sys/syslog.h>
33
32
#include <sys/zfs_context.h>
34
#include <sys/zfs_context.h>
33
#include <sys/fm/fs/zfs.h>
35
#include <sys/fm/fs/zfs.h>
34
#include <sys/spa.h>
36
#include <sys/spa.h>
Lines 4336-4355 vdev_split(vdev_t *vd) Link Here
4336
	vdev_propagate_state(cvd);
4338
	vdev_propagate_state(cvd);
4337
}
4339
}
4338
4340
4339
void
4341
extern int zfs_deadman_enabled;
4342
4343
int
4340
vdev_deadman(vdev_t *vd)
4344
vdev_deadman(vdev_t *vd)
4341
{
4345
{
4346
	int e;
4347
4348
	e = 0;
4342
	for (int c = 0; c < vd->vdev_children; c++) {
4349
	for (int c = 0; c < vd->vdev_children; c++) {
4343
		vdev_t *cvd = vd->vdev_child[c];
4350
		vdev_t *cvd = vd->vdev_child[c];
4344
4351
4345
		vdev_deadman(cvd);
4352
		if (vdev_deadman(cvd)) {
4353
			e = 1;
4354
			log(LOG_ERR, "SLOW IO: %s is child of %s",
4355
				spa_name(cvd->vdev_spa),
4356
				spa_name(vd->vdev_spa));
4357
		}
4346
	}
4358
	}
4347
4359
4348
	if (vd->vdev_ops->vdev_op_leaf) {
4360
	if (vd->vdev_ops->vdev_op_leaf) {
4349
		vdev_queue_t *vq = &vd->vdev_queue;
4361
		vdev_queue_t *vq = &vd->vdev_queue;
4362
		ulong_t num;
4350
4363
4351
		mutex_enter(&vq->vq_lock);
4364
		mutex_enter(&vq->vq_lock);
4352
		if (avl_numnodes(&vq->vq_active_tree) > 0) {
4365
		if ((num = avl_numnodes(&vq->vq_active_tree)) > 0) {
4353
			spa_t *spa = vd->vdev_spa;
4366
			spa_t *spa = vd->vdev_spa;
4354
			zio_t *fio;
4367
			zio_t *fio;
4355
			uint64_t delta;
4368
			uint64_t delta;
Lines 4361-4371 vdev_deadman(vdev_t *vd) Link Here
4361
			 */
4374
			 */
4362
			fio = avl_first(&vq->vq_active_tree);
4375
			fio = avl_first(&vq->vq_active_tree);
4363
			delta = gethrtime() - fio->io_timestamp;
4376
			delta = gethrtime() - fio->io_timestamp;
4377
4378
			if (zfs_deadman_enabled > 1 &&
4379
			    delta > (spa_deadman_synctime(spa) / 8)) {
4380
				e = 1;
4381
				log(LOG_ERR, "%s SLOW IO: zio io_type %u "
4382
				    "timestamp %lluns, delta %lluns, "
4383
				    "last io %lluns",
4384
				    spa_name(spa), fio->io_type,
4385
				    fio->io_timestamp, (u_longlong_t)delta,
4386
				    vq->vq_io_complete_ts);
4387
				log(LOG_ERR, "I/O to pool '%s' appears to be "
4388
				    "hung on vdev guid %llu at '%s' active zio %lu.",
4389
				    spa_name(spa),
4390
				    (long long unsigned int) vd->vdev_guid,
4391
				    vd->vdev_path, num);
4392
			} else
4364
			if (delta > spa_deadman_synctime(spa)) {
4393
			if (delta > spa_deadman_synctime(spa)) {
4394
				e = 1;
4365
				vdev_dbgmsg(vd, "SLOW IO: zio timestamp "
4395
				vdev_dbgmsg(vd, "SLOW IO: zio timestamp "
4366
				    "%lluns, delta %lluns, last io %lluns",
4396
				    "%lluns, delta %lluns, last io %lluns",
4367
				    fio->io_timestamp, (u_longlong_t)delta,
4397
				    fio->io_timestamp, (u_longlong_t)delta,
4368
				    vq->vq_io_complete_ts);
4398
				    vq->vq_io_complete_ts);
4399
			    if(zfs_deadman_enabled == 1)
4369
				fm_panic("I/O to pool '%s' appears to be "
4400
				fm_panic("I/O to pool '%s' appears to be "
4370
				    "hung on vdev guid %llu at '%s'.",
4401
				    "hung on vdev guid %llu at '%s'.",
4371
				    spa_name(spa),
4402
				    spa_name(spa),
Lines 4375-4378 vdev_deadman(vdev_t *vd) Link Here
4375
		}
4406
		}
4376
		mutex_exit(&vq->vq_lock);
4407
		mutex_exit(&vq->vq_lock);
4377
	}
4408
	}
4409
	return (e);
4378
}
4410
}

Return to bug 241980