PERFORCE change 96417 for review
Scott Long
scottl at FreeBSD.org
Sun Apr 30 17:06:44 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=96417
Change 96417 by scottl at scottl-junior on 2006/04/30 17:05:53
Take a stab at fixing the problems with crashdumps. xpt_done assumes
that it is always safe to call swi_sched, even when in a panic state
where the scheduler is in an unknown state. swi_sched should be
fixed to not blow up the scheduler in this scenario, but we also need
to make CAM more deterministic. So when a periph goes into poll
driving more, mark a flag so that xpt_done knows not to bother with
swi_sched. It would be better to set this flag on a per-CCB basis,
but there are no more bits available in the ccb flags field. That
will be fixed later as part of the camlock work.
Affected files ...
.. //depot/projects/scottl-camlock/src/sys/cam/cam_periph.h#6 edit
.. //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#21 edit
.. //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_da.c#9 edit
Differences ...
==== //depot/projects/scottl-camlock/src/sys/cam/cam_periph.h#6 (text+ko) ====
@@ -113,6 +113,7 @@
#define CAM_PERIPH_INVALID 0x08
#define CAM_PERIPH_NEW_DEV_FOUND 0x10
#define CAM_PERIPH_RECOVERY_INPROG 0x20
+#define CAM_PERIPH_POLLED 0x40
u_int32_t immediate_priority;
u_int32_t refcount;
SLIST_HEAD(, ccb_hdr) ccb_list; /* For "immediate" requests */
==== //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#21 (text+ko) ====
@@ -4959,7 +4959,9 @@
sim_links.tqe);
done_ccb->ccb_h.pinfo.index = CAM_DONEQ_INDEX;
mtx_unlock(&cam_bioq_lock);
- swi_sched(cambio_ih, 0);
+ if ((done_ccb->ccb_h.path->periph->flags &
+ CAM_PERIPH_POLLED) == 0)
+ swi_sched(cambio_ih, 0);
break;
default:
panic("unknown periph type %d",
==== //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_da.c#9 (text+ko) ====
@@ -734,6 +734,7 @@
return (ENXIO);
if (length > 0) {
+ periph->flags |= CAM_PERIPH_POLLED;
xpt_setup_ccb(&csio.ccb_h, periph->path, /*priority*/1);
csio.ccb_h.ccb_state = DA_CCB_DUMP;
scsi_read_write(&csio,
@@ -759,10 +760,11 @@
else
printf("status == 0x%x, scsi status == 0x%x\n",
csio.ccb_h.status, csio.scsi_status);
+ periph->flags |= CAM_PERIPH_POLLED;
return(EIO);
}
return(0);
- }
+ }
/*
* Sync the disk cache contents to the physical media.
@@ -801,6 +803,7 @@
}
}
}
+ periph->flags &= ~CAM_PERIPH_POLLED;
return (0);
}
More information about the p4-projects
mailing list