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 (-1 / +1 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");
(-)sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c (-2 / +24 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-4341 vdev_split(vdev_t *vd) Link Here
4336
	vdev_propagate_state(cvd);
4338
	vdev_propagate_state(cvd);
4337
}
4339
}
4338
4340
4341
extern int zfs_deadman_enabled;
4342
4339
void
4343
void
4340
vdev_deadman(vdev_t *vd)
4344
vdev_deadman(vdev_t *vd)
4341
{
4345
{
Lines 4347-4358 vdev_deadman(vdev_t *vd) Link Here
4347
4351
4348
	if (vd->vdev_ops->vdev_op_leaf) {
4352
	if (vd->vdev_ops->vdev_op_leaf) {
4349
		vdev_queue_t *vq = &vd->vdev_queue;
4353
		vdev_queue_t *vq = &vd->vdev_queue;
4354
		ulong_t num;
4350
4355
4351
		mutex_enter(&vq->vq_lock);
4356
		mutex_enter(&vq->vq_lock);
4352
		if (avl_numnodes(&vq->vq_active_tree) > 0) {
4357
		if ((num = avl_numnodes(&vq->vq_active_tree)) > 0) {
4353
			spa_t *spa = vd->vdev_spa;
4358
			spa_t *spa = vd->vdev_spa;
4354
			zio_t *fio;
4359
			zio_t *fio;
4355
			uint64_t delta;
4360
			uint64_t delta, early;
4356
4361
4357
			/*
4362
			/*
4358
			 * Look at the head of all the pending queues,
4363
			 * Look at the head of all the pending queues,
Lines 4361-4371 vdev_deadman(vdev_t *vd) Link Here
4361
			 */
4366
			 */
4362
			fio = avl_first(&vq->vq_active_tree);
4367
			fio = avl_first(&vq->vq_active_tree);
4363
			delta = gethrtime() - fio->io_timestamp;
4368
			delta = gethrtime() - fio->io_timestamp;
4369
			early = delta / 8;
4370
4371
			if (zfs_deadman_enabled > 1 &&
4372
			    early > spa_deadman_synctime(spa)) {
4373
				log(LOG_ERR, "%s SLOW IO: zio io_type %u "
4374
				    "timestamp %lluns, delta/8 %lluns, "
4375
				    "last io %lluns",
4376
				    spa_name(spa), fio->io_type,
4377
				    fio->io_timestamp, (u_longlong_t)early,
4378
				    vq->vq_io_complete_ts);
4379
				log(LOG_ERR, "I/O to pool '%s' appears to be "
4380
				    "hung on vdev guid %llu at '%s' active zio %lu.",
4381
				    spa_name(spa),
4382
				    (long long unsigned int) vd->vdev_guid,
4383
				    vd->vdev_path, num);
4384
			} else
4364
			if (delta > spa_deadman_synctime(spa)) {
4385
			if (delta > spa_deadman_synctime(spa)) {
4365
				vdev_dbgmsg(vd, "SLOW IO: zio timestamp "
4386
				vdev_dbgmsg(vd, "SLOW IO: zio timestamp "
4366
				    "%lluns, delta %lluns, last io %lluns",
4387
				    "%lluns, delta %lluns, last io %lluns",
4367
				    fio->io_timestamp, (u_longlong_t)delta,
4388
				    fio->io_timestamp, (u_longlong_t)delta,
4368
				    vq->vq_io_complete_ts);
4389
				    vq->vq_io_complete_ts);
4390
			    if(zfs_deadman_enabled == 1)
4369
				fm_panic("I/O to pool '%s' appears to be "
4391
				fm_panic("I/O to pool '%s' appears to be "
4370
				    "hung on vdev guid %llu at '%s'.",
4392
				    "hung on vdev guid %llu at '%s'.",
4371
				    spa_name(spa),
4393
				    spa_name(spa),

Return to bug 241980