tim at home work and in between.
« March 2006 »
MonTueWedThuFriSatSun
  
1
2
3
4
5
6
7
9
10
11
12
13
15
17
18
19
21
23
24
25
26
27
28
29
30
31
  
       
Today
XML

Blog::Navigation

Site notes

This page validates as XHTML 1.0, and will look much better in a browser that supports web standards, but it is accessible to any browser or Internet device. It was created using techniques detailed at glish.com/css/.

Technorati

Tim Uglow's personal blog

timu_at_home
Powered by Roller Weblogger.
« Previous day (Mar 15, 2006) | Main | Next day (Mar 16, 2006) »
20060316 Thursday March 16, 2006
Where can I/O queue up in sd/ssd

Using the opensolaris source at opensolaris.org you can see the source code to sd.c, which builds the sd and ssd scsi/fibre target drivers.

The driver keeps a count of i/o's it has accepted in the un->un_ncmds_in_driver element of the un structure which is the softstate for that disk lun. It keeps the number of i/o's it has passed down to the HBA to transport in the un->un_ncmds_in_transport variable.

New I/O's passed into sd/ssd to the transport are passed straight down to the HBA until un_ncmds_in_transport exceeds the un_throttle for this lun or during error processing when we retry commands sequentually until one succeeeds.

When we have to queue the bufs we sort them onto a linked list anchored in un->un_waitq_headp and un->un_waitq_tailp.

But there is another place that i/o can be queued before it gets to the waitq and throttles - in the xbuf layer. un->un_xbuf_attr points to the xbuf control block which is of type __ddi_xbuf_attr . This has an unsorted waitq anchored in xa_headp and xa_tailp, by default the xbuf layer only allows 256 commands through to the normal sd waitq and throttles, the rest are queued in the xbuf and un_ncmds_in_driver is incremented. So it is possible when a large number of commands to be dropped on a sd lun, un_ncmds_in_driver is very large but the waitq has less than 256 commands on it - the rest are lurking on the xbuf's queue

These xbuf queued i/o are invisible to iostat's wait column - maybe they shouldn't be?

How unpleasant was that.

So as I peddle my way in this morning, a bit late so I caught the end of the rush hour, I had to exit the big roundabout on the A325 by the Queensgate shopping centre in Farnborough. A I passed the apex of the exit bend an old red Ford Mondeo driver by a young lady apexed that curve - she was within inches of my handlebars. I do my normal polite gesture to indicate that they were too close just in case they look in the mirror. She looked, saw my gesture and performed her own gesture. Clearly she was impressed with my skill and was telling me I was the number one best cyclist.

But why do they do this, you give them polite advise that their driving is rubbish and you just get back abuse, roll on the 10 pound a gallon petrol price..

Copyright (C) 2003, tim at home work and in between.