I believe the problem can be solved by just keeping a list of pending IO’s and a #define of maximum pending IOs.
For Example if my list says.
2 4 10 15
and my max pending IO is 4.
Then all the IOs except 2, 4, 10, 15, >15 are complete.
2, 4, 10, 15 are posted not yet complete
15 are not yet posted.
If say the list is only 2, 4, 10
and max pending IO is 4.
Then all the IOs except 2, 4, 10 are complete
2, 4, 10 are posted not yet complete
all IOs are posted.
wouldn’t that be enough?
-Srin.
-----Original Message-----
From: Mark Lobo [mailto:xxxxx@yahoo.com]
Sent: Wednesday, August 13, 2003 9:46 AM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: Disk to disk copy
But its needed to keep residual counts of the
operation, in case it fails and return error to the
caller with how much was transferred. And if the
number of IOs outstanding is 10, and if a completion
comes in out of order, say IO 3 completes before IO 0,
and we reissue IO 4 using IO 3s structure, we need to
maintain state on too many IOs and their completion
status. Say if it is like this: 0 has not completed, 1
has, 2 has not completed, but 3 has, 4 has not
completed but 5 has, and all the completed IOs strucs
have been reused to issue new IOs. Since the
structures for the IOs which have completed have been
reused, we need a kind of a bitmask which tells us the
status of the IO completed. For a 10 Terabyte disk,
this bitmask can go to pretty high proportions, if say
we are doing 256k IOs.If the residual count didnt
matter, i.e. the operation is just errored to the
caller when any IO fails, then yes, the IO objects can
just be reused right away without waiting. But in this
case, how does one keep track of residual counts
without keeping too much state AND using as much
parallelism as possible?
Mark
— Carl Appellof
wrote:
>
> “Mark Lobo” wrote in
> message news:xxxxx@ntdev…
> >
> > Multiple IOs mean out of order completions, which
> > means that if an out of order completion comes in,
> we
> > wait for the write completion of the last pending
> IO
> > before issuing another read.e.g if I issue IO
> number 0
> > 1 2 and 3, and 3 completes, I need to wait for 0 1
> and
> > 2 to complete before I can reissue a read using IO
> > struc 3. Unfortunately, no piggback completions
> are
> > available in SCSI so its pretty serial.
>
> No piggyback completions in SCSI, but out of order
> completions are possible
> depending on how the SCSI disk controller reorders
> the I/O requests it gets.
>
> But I don’t see your problem with having to wait for
> I/Os 0, 1, and 2 to
> complete in order to start another one for completed
> I/O number 3. Let’s
> say each of your I/Os is for 1 sector of a disk,
> both read and write. At
> the start, you launch 4 I/O operations to read
> sector 0, sector 1, sector 2,
> and sector 3 of the disk. If the read for 3
> completes, you can immediately
> launch a write operation to write sector 3 of the
> target disk, and launch a
> read for sector 4 (or whatever the next highest
> sector is, based on a
> pointer you keep.) Similarly, as each read for
> sector N completes, you
> launch a write for sector N and launch a new read
> for sector NEXT.
>
> As the writes complete, you can recycle the I/O
> structures you had set up
> for them.
>
> Oh, and use unbuffered I/O so you won’t thrash the
> Windows filesystem buffer
> cache.
>
> Carl
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
xxxxx@lists.osr.com
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
—
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@nai.com
To unsubscribe send a blank email to xxxxx@lists.osr.com