Queued posted-write disk write method with improved error handling.
Abstract
A posted-write queuing program for writing information sectors to disk sectors includes error-handling routines to minimize the risk of data loss upon specified types of errors. Upon timeouts, queuing is suspended and all information sectors pending in the queue are written out to the corresponding disk sectors. Upon specified types of write errors, queuing is discontinued and repeated attempts are made to write out all information sectors to the corresponding disk sectors. For each unsuccessful attempt, the corresponding information sector is saved in the queue; the user is alerted, and subsequent read or write requests directed to the corresponding disk sector is serviced from the saved information sector in the queue.

Term
Term ended
Projected expiry passed 4 August 2009, 17.1 years ago.
- Priority
- Filed
- Published
- Projected expiry
- Today
7 claims: 2 independent, 5 dependent
- 1A method of maintaining a posted-write queue upon a timeout or upon a specified type of error, to which queue may be added information sectors addressed to respective corresponding disk sectors, and from which queue the information sectors may be written out to the respective corresponding disk sectors, the method comprising the steps of:blocking the addition of information sectors to the queue;and attempting to write out to the corresponding disk sector each information sector already added to the queue.
- 5Apparatus for maintaining a posted-write queue in a computer memory upon a timeout or upon a specified type of error, the apparatus including:means arranged to prevent the further addition of information sectors to the queue;and means arranged to attempt to write out to the corresponding disk sector each information sector already added to the queue.
Independent claims2
62 paragraphs, as filed
0001This invention relates to a method for queuing posted-write disk write operations, with improved error handling.
Disk Caching
0002Posted writes to a disk are roughly analogous in some ways to cached reads from a disk. Disk caching, as is well known to those of ordinary skill, is a method of keeping a copy of the information last read from a relatively slow storage device (e.g., a fixed or "hard" disk) in much faster read-write random-access memory (RAM). This permits quicker processing of subsequent requests for that data.
0003Disk caching typically operates in conjunction with read-operation requests by application programs or other programs (referred to here as "tasks").
0004Generally speaking, when a task initiates a read operation, it reserves a certain portion of RAM, referred to as a "buffer," and requests that the information stored in one or more disk sectors be copied to the buffer.
0005Once this information is copied to RAM, the task can manipulate the information much more rapidly than on the disk. In part, this is because manipulation of the information on the disk requires activation of mechanical components of a disk drive, whereas manipulation in RAM is done entirely electronically.
0006When disk caching is used, each time a task requests that a certain disk sector be read (i.e., copied into RAM), not only is the requested sector read, but in addition certain adjacent sectors are also copied into a special RAM "cache buffer." This is done on the assumption that these disk sectors are likely to be read soon themselves.
0007Consequently, if one or more of those adjacent sectors is indeed the subject of a subsequent read request, the request can be filled from the RAM cache buffer. Since the relatively slow disk drives need not be activated, and the request is thus filled entirely electronically, this subsequent read request is completed much faster than the first one.
0008When disk caching is enabled, whenever a read request for specified disk sectors is initiated, the cache buffer is checked first to see if the desired disk sectors have already been read into the cache buffer. Only if the information is not in the cache buffer is an actual disk read operation initiated, whereupon the new information is itself copied to the cache buffer. "Old" information in the cache buffer is removed from the buffer; generally speaking, the information that is removed is the least recently used information.
Interrupts
0009The operation of the present invention makes use of a special capability designed into many computer architectures, known as "interrupts" and "interrupt handlers."
0010Interrupts cause a central processing unit (CPU) of a computer to suspend execution of the current program instruction(s); to execute a specific "interrupt handler" routine or set of instructions; and then to resume execution of the suspended current program instruction(s) at the point where it left off.
0011Interrupts can be generated by software, i.e., by special instructions built into a program known as "software interrupts." When the CPU encounters a software interrupt in a program, among other things it executes the associated interrupt handler routine, then returns to execution of the program into which the software interrupt was built. A return from an interrupt-generated call to an interrupt handler routine is known as an interrupt return or "IRET."
0012Interrupts can also be generated by appropriately designed hardware: many CPUs (e.g., the Intel 8086 family, including the 8086, 8088, 80286, and 80386) are designed so that other hardware components in the computer system can cause an interrupt by transmitting special signals to the CPU.
Disk Write Interrupts
0013Interrupts are commonly used to initiate disk write operations. A disk write operation typically entails copying of information to the disk from RAM that is in use by a task.
0014A disk-write interrupt might be generated by a task. For example, a spreadsheet program could initiate such a request in order to save the user's work.
0015(In this discussion, a computer program itself is sometimes referred to as performing one or another operation. In reality, it is a hardware component such as the CPU that actually performs the operation under control of the program. This is a common shorthand in the art.)
Disk Write Interrupt Handler in ISA BIOS
0016A common disk-write interrupt in the "industry standard architecture" (ISA) causes execution of a specific interrupt handler (known as INT 13H) that is part of the BIOS (basic input/output services) program. The industry standard architecture is exemplified by, e.g., the IBM PC and the Compaq Deskpro 286.
0017The BIOS program typically is stored in a read-only memory (ROM) installed in the ISA computer, and so the BIOS program itself is sometimes referred to as simply "the ROM."
0018In processing the disk write request, the INT 13H interrupt handler does two things (among others). The explanation below uses a write operation to a fixed disk as an example.
0019First, INT 13H copies the specified data to be written to disk (referred to here as a "write buffer") to a buffer under the control of a disk controller associated with the specified disk drive (e.g., in RAM that is installed with the disk controller and not as part of "main" memory). It then directs the disk controller to copy the data to a specified sector(s) on the disk.
0020That having been done, INT 13H itself calls the INT 15H WAIT interrupt handler. By default, INT 15 WAIT simply returns to the calling function, i.e., to the INT 13H interrupt handler.
0021INT 13H then enters a wait loop: in each iteration of the loop, it checks to see if a flag has been set to indicate that a fixed disk hardware interrupt has occurred; if the flag has not been set, the loop continues. In other words, the CPU is now busy waiting for the fixed disk hardware-interrupt-occurred flag to be set -- and has not resumed executing the task's instructions.
0022When the disk controller has completed the write operation, it generates a hardware interrupt that causes the CPU to set the fixed disk hardware-interrupt-occurred flag and execute the INT 15H POST interrupt handler. This routine typically performs an IRET back to the INT 13H wait loop.
0023Now that the fixed disk hardware-interrupt-occurred flag has been set, the INT 13H wait loop is ended, whereupon INT 13H clears the flag, finishes its processing, and performs an IRET to return control to the task.
0024In effect, the design of the INT 13H interrupt handler routine forces the CPU to sit idle until the disk controller (which, once activated, does not need the CPU to perform its data-writing functions) has completed its work.
0025It will be recognized by those of ordinary skill that the above description relates to a relatively simple case of writing to disk. As is well known to those of ordinary skill, some write operations require multiple hardware interrupts thereby causing multiple WAITs and POSTs.
Queued Write Operations
0026Write queuing, generally speaking, involves directing some or all disk write requests to a queue buffer instead of to the disk in question, and control is given back to the task. The actual physical writing to disk is performed later on whenever convenient, thus reducing the delay in resuming execution of the calling task.
0027A posted-write queuing program for writing information sectors to disk sectors includes error-handling routines to minimize the risk of data loss upon specified types of errors. Upon timeouts, queuing is suspended and all information sectors pending in the queue are written out to the corresponding disk sectors. Upon specified types of write errors, queuing is discontinued and repeated attempts are made to write out all information sectors to the corresponding disk sectors. For each unsuccessful attempt, the corresponding information sector is saved in the queue; the user is alerted, and subsequent read or write requests directed to the corresponding disk sector is serviced from the saved information sector in the queue.
Posted-Write Queueing in Disk Cache Utility
0028The present invention is illustrated by the following description of a set of routines for posting and queuing write requests generated by tasks. The routines operate as a part of a disk-cache installable device driver under the MS-DOS operating system (versions 3.10 through 3.39).
0029The posted-write queuing routines operate in conjunction with a disk cache utility that maintains a cache buffer and a cache directory. In the illustration described here, the posted-write queuing routines are written as a part of such a disk cache utility, which forms no part of the present invention (except to the extent claimed) and is not otherwise described.
0030It will be understood that the description is presented by way of illustration and not as a limitation on the subject matter claimed.
Substitution of Interrupt Handlers
0031Several interrupt handlers in the BIOS program have their behavior altered (sometimes referred to as "hooked," "trapped," or "grabbed") in the conventional manner. Generally speaking, this involves (a) saving the vectors that are stored in low memory and are associated with the respective interrupt handlers; these vectors ordinarily point to the respective addresses of the normal BIOS interrupt handler routines; and (b) overwriting these vectors with new vectors pointing to the addresses of substitute interrupt handler routines.
0032In particular, the respective handlers for INT 13H, for INT 15H WAIT and INT 15H POST, and for timeouts and write errors, are replaced. The Flow Chart sets out a pseudocode description of the substitute routines.
0033As is conventional, a substitute routine may call the original interrupt handler; this is done by simply calling the original handler, whose address was saved as part of the overwriting process described above. For example, the Flow Chart shows that this is done in the substitute routine for INT 13H.
Memory Allocation for Queue
0034The posted-write queuing routines use an 8K FIFO (first-in, first-out) buffer in main memory for queuing write requests. More specifically, the queue utilizes the base memory that is reserved by the cache driver during its installation.
0035The queue is kept relatively small to reduce the chance of data loss due to the user turning off the computer when it appears that the write is complete (when in fact it is not).
Single-Sector Writes
0036If the write buffer of a disk write request will occupy no more than one sector on the disk (i.e., if the request is for a single-sector write), then broadly speaking, the write request is queued and posted as complete, and control is returned to the task.
0037More specifically, the substitute INT 13H routine queues the write request and jumps to a DEQUEUE routine. The DEQUEUE routine in turn generates its own conventional INT 13H write request that specifies the queue as the write buffer.
0038When the conventional INT 13H interrupt handler calls the INT 15H WAIT routine, the substitute INT 15H WAIT routine saves the wait environment and returns back to the calling task (instead of to the conventional INT 13H routine that called it), even though the disk controller may not yet have reported completion of the write operation. In effect, this leaves the conventional INT 13H routine in something like a state of suspension.
0039When the disk controller does complete its write operation, it generates a hardware interrupt, thus causing the fixed disk hardware-interrupt-occurred flag to be set and causing the INT 15H POST routine to be called. The substitute INT 15H POST routine restores the previously-saved wait environment and returns control to the previously "suspended" conventional INT 13H write routine, in effect reactivating that routine.
0040Because the fixed disk hardware-interrupt-occurred flag is now set, the now-reactivated conventional INT 13H write routine does not stay in its wait loop waiting for that interrupt (as described above). Instead, the conventional INT 13H write routine finishes its processing and performs an IRET to return control to the DEQUEUE routine that originally called it.
0041The DEQUEUE routine in turn returns control to the calling task, but at the point where the last hardware interrupt occurred, not at the point where the write request was generated.
Error Handling
0042On any time out, queuing is discontinued (i.e., no more write requests are added to the queue) and all write requests already queued are written out individually. Timeout error logic is employed while waiting for the queue to become empty or not full to ensure that a cache controller failure is the only possible cause of an unrecoverable error.
0043The timeout error logic uses flags to determine where the write operation timed out. This aids in making a determination whether or not the last sector sent to the conventional INT 13H write routine was actually written out to the disk. It also aids in determining whether the timeout was caused by hardware (e.g., controller failure) or software (e.g., conflicting programs) and in giving the user an appropriate error message.
0044On any sector-not-found write error or address-not-found write error, repeated attempts (e.g., 5 disk resets and retries) are made to write out each sector in the queue to disk, one at a time. If any given sector(s) cannot be written out, queuing is permanently discontinued (until a reset, of course) and the sector(s) in question are saved in the queue.
0045Subsequent to such action (until power reset), each disk read request and each disk write request is checked to determine whether any requested sector is in the queue (meaning that the actual disk sector is out of date or perhaps even unaccessible). Such requests are serviced from the queue buffer; if the sector in question is written to, it is updated in the queue buffer. A suitable alarm prompts the user to back up the disk (the backup request will be serviced in part from the queue).
Efficiency Considerations
0046Queueing of disk writes takes place only for single-sector writes. Only single-sector writes are queued because the queue is small and most writes will be either single-sector or very large multi-sector writes. To accommodate large writes would require too much complexity and overhead; it is regarded as more efficient to handle only the other most common write size, i.e., single-sector writes.
0047If either a multi-sector write request or a disk read request is generated, the queue is forced empty (i.e., i.e., written out to the disk, or "flushed") before the requested operation is performed. If disk reads are cached, the queue is flushed only if the desired sectors to be read are not present in the cache. This queue flushing is a convenient, low-overhead way of ensuring that the data in the queue is always current.
0048No check is performed for duplication of write requests in the queue. Such a check would theoretically eliminate the extra disk write, but the associated overhead is regarded as not worth the trade-off, because only comparatively rarely will the queue contain two writes to the same disk sector.
0049Likewise, the queue is not sorted, because the queue is small and since most single-sector writes will either be sequential or will vary greatly across the disk. The overhead associated with moving data (in sorting or in copying to the disk controller buffer) is very high, so in this embodiment the queue is copied once and not moved.
0050At any given time, the queue may contain write requests for a number of sectors (i.e., if write requests are generated in quick succession by the task). If successive write requests in the queue are directed to successive disk sectors, a more efficient disk write can be accomplished when emptying the queue by performing a multi-sector write from the queue.
0051Toward this end, the queue in the embodiment described is circular and has a fixed buffer location; furthermore, the head and tail pointers are both placed at the top of the queue when the queue is empty.
2 sheets
Sheet 1 Sheet 2
Every citation, both ways
| Document | Relation | Office | Cited during |
|---|---|---|---|
| EP0702815A1 | Cited by | European Patent Office (EPO) | Search report |
| US7103794B2 | Cited by | United States of America | Applicant |
| US7685169B2 | Cited by | United States of America | Applicant |
| US5680580A | Cited by | United States of America | Search report |
| US5751997A | Cited by | United States of America | Search report |
| EP0498520A2 | Cited by | European Patent Office (EPO) | Search report |
| WO9857265A1 | Cited by | World Intellectual Property Organization (WIPO) | International search |
| EP0702815A4 | Cited by | European Patent Office (EPO) | Search report |
| US5574950A | Cited by | United States of America | Search report |
| US5963962A | Cited by | United States of America | Search report |
| US6038570A | Cited by | United States of America | Search report |
| EP0510245A1 | Cited by | European Patent Office (EPO) | Search report |
| US9009168B2 | Cited by | United States of America | Applicant |
| US7293097B2 | Cited by | United States of America | Applicant |
| US8122286B1 | Cited by | United States of America | Applicant |
| EP0498520A3 | Cited by | European Patent Office (EPO) | Search report |
| US7962531B2 | Cited by | United States of America | Applicant |
| US5867668A | Cited by | United States of America | Search report |
| WO9417473A1 | Cited by | World Intellectual Property Organization (WIPO) | International search |
| EP0508666A2 | Cited by | European Patent Office (EPO) | Search report |
| US5835957A | Cited by | United States of America | Search report |
| EP0508666A3 | Cited by | European Patent Office (EPO) | Search report |
| EP0510245A1 | Cited by | European Patent Office (EPO) | Search report |
| US4523275A | Cites | United States of America | Search report |
| US4598357A | Cites | United States of America | Search report |
10 members in 6 offices; this record represents the family
Priority claims4
| Document | Office | Kind | Date |
|---|---|---|---|
| 24586588 | United States of America | A | |
| 245865 | United States of America | – | |
| US19880245865 | – | – | – |
| 245865 | – | – | – |
Members10
| Document | Office | Kind | |
|---|---|---|---|
| EP0359384A2This record | European Patent Office (EPO) | A2 | |
| JPH0293949A | Japan | A | |
| KR900005326A | Republic of Korea | A | |
| EP0359384A3 | European Patent Office (EPO) | A3 | |
| US5065354A | United States of America | A | |
| CA1319440C | Canada | C | |
| KR970011213B1 | Republic of Korea | B1 | |
| EP0359384B1 | European Patent Office (EPO) | B1 | |
| DE68928542D1 | Germany | D1 | |
| DE68928542T2 | Germany | T2 |
40 legal events, as 4 offices reported them to INPADOC
Over the term
Point at a mark for the eventEvents
| Event | Code | Office | |
|---|---|---|---|
| Lapsed in a contracting state [announced via postgrant information from national office to epo]LapsedPG25 | PG25 | EP | |
| Lapsed in a contracting state [announced via postgrant information from national office to epo]LapsedPG25 | PG25 | EP | |
| Lapsed in a contracting state [announced via postgrant information from national office to epo]LapsedPG25 | PG25 | EP | |
| Lapsed in a contracting state [announced via postgrant information from national office to epo]LapsedPG25 | PG25 | EP | |
| Notification of lapseLapsedST | ST | FR | |
| Gb: european patent ceased through non-payment of renewal feeCeasedGBPC | GBPC | EP | |
| Annual fee paid to national office [announced via postgrant information from national office to epo]GrantedPGFP | PGFP | EP | |
| Annual fee paid to national office [announced via postgrant information from national office to epo]GrantedPGFP | PGFP | EP | |
| Annual fee paid to national office [announced via postgrant information from national office to epo]GrantedPGFP | PGFP | EP | |
| Annual fee paid to national office [announced via postgrant information from national office to epo]GrantedPGFP | PGFP | EP | |
| European patent in force as of 2002-01-01IF02 | IF02 | GB | |
| No opposition filedOpposition26N | 26N | EP | |
| No opposition filed within time limitOppositionORIGINAL CODE: 0009261PLBE | PLBE | EP | |
| Information on the status of an ep patent application or granted ep patentGrantedSTATUS: NO OPPOSITION FILED WITHIN TIME LIMITSTAA | STAA | EP | |
| Patent ceasedCeasedPL | PL | CH | |
| Nl: lapsed or annulled due to failure to fulfill the requirements of art. 29p and 29m of the patents actLapsedNLV1 | NLV1 | EP | |
| Fr: translation filedET | ET | EP | |
| Lapsed in a contracting state [announced via postgrant information from national office to epo]LapsedPG25 | PG25 | EP | |
| Corresponds to:REF | REF | EP | |
| It: translation for a ep patent filedITF | ITF | EP | |
| It: translation for a ep patent filedITF | ITF | EP | |
| European patent takes effect as a national patent in ch/liEP | EP | CH | |
| Designated contracting statesAK | AK | EP | |
| Lapsed in a contracting state [announced via postgrant information from national office to epo]LapsedPG25 | PG25 | EP | |
| Lapsed in a contracting state [announced via postgrant information from national office to epo]LapsedPG25 | PG25 | EP | |
| Lapsed in a contracting state [announced via postgrant information from national office to epo]LapsedPG25 | PG25 | EP | |
| Lapsed in a contracting state [announced via postgrant information from national office to epo]LapsedPG25 | PG25 | EP | |
| Lapsed in a contracting state [announced via postgrant information from national office to epo]LapsedPG25 | PG25 | EP | |
| Lapsed in a contracting state [announced via postgrant information from national office to epo]LapsedPG25 | PG25 | EP | |
| (expected) grantORIGINAL CODE: 0009210GRAA | GRAA | EP | |
| Despatch of communication of intention to grant a patentORIGINAL CODE: EPIDOS IGRAGRAH | GRAH | EP | |
| Despatch of communication of intention to grantORIGINAL CODE: EPIDOS AGRAGRAG | GRAG | EP | |
| Despatch of communication of intention to grant a patentORIGINAL CODE: EPIDOS IGRAGRAH | GRAH | EP | |
| Despatch of communication of intention to grantORIGINAL CODE: EPIDOS AGRAGRAG | GRAG | EP | |
| First examination report despatched17Q | 17Q | EP | |
| Request for examination filed17P | 17P | EP | |
| Designated contracting statesAK | AK | EP | |
| Search report despatchedORIGINAL CODE: 0009013PUAL | PUAL | EP | |
| Designated contracting statesAK | AK | EP | |
| Public reference made under article 153(3) epc to a published international application that has entered the european phaseORIGINAL CODE: 0009012PUAI | PUAI | EP |
Numbers
- Publication
- 0359384
- Publication, DOCDB
- 0359384
- Publication, EPODOC
- EP0359384
- Application
- 89307948
- Application, DOCDB
- 89307948
- Application, EPODOC
- EP19890307948
Titles6
- German
- Warteschlangen-Nachschreibplattenschreibverfahren mit Fehlerbehandlung.
- English
- Queued posted-write disk write method with improved error handling.
- French
- Méthode de mise en file d'attente d'écriture sur disque à écriture postérieure à traitement d'erreur.
- German
- Warteschlangen-Nachschreibplattenschreibverfahren mit Fehlerbehandlung
- English
- Queued posted-write disk write method with improved error handling
- French
- Méthode de mise en file d'attente d'écriture sur disque à écriture postérieure à traitement d'erreur
Classification
- CPC, 7
- G06F11/073
- G06F11/0727
- G06F11/0757
- G06F11/0793
- G06F11/1435
- G06F12/0804
- G06F12/0866
- IPC, 5
- G06F9 48
- G06F11 00
- G06F11 07
- G06F11 14
- G06F12 08
Designated states11
- Contracting states, 11
- Belgium
- Switzerland
- Germany
- Spain
- France
- United Kingdom
- Greece
- Italy
- Liechtenstein
- Netherlands (Kingdom of the)
- Sweden