470912470912
五、發明說明() 發明頜城: 本發明關於排列下予磁碟機之命令且特別關於決定 疋否基於命令之優先權位階與磁碟機之未決負荷量對磁 碟機發出一命令。 發明背景: 第1圖是一先前技術電腦系統i 〇〇之方塊圖,它的主 要元件是主電腦110、磁碟控制器115及磁碟機125。磁 碟機125可以是二商用的、現成的、元件的,有時稱為商 用磁碟機,其符合小型電腦系統介面(SCSi)協定。 主電腦1 1 0運算儲存於磁碟機丨2 5的資料。當主電腦 1 1 0欲讀取資料時’它發出一鑑別該資料之讀取命令予磁 碟控制器1 1 5,接著,磁碟控制器丨丨5發出一讀取命令予 磁碟機1 2 5。當磁碟機12 5執行此讀取命令時,它會傳送 資料予磁碟控制器1 1 5,磁碟控制器1 1 5會傳遞該資料予 主電腦110。若當主電腦110欲寫入資料時,它發出一寫 入命令並傳送相關資料予磁碟控制器1 1 5,其後’磁碟控 制器115發出一寫入命令予磁碟機125,當磁碟機125準 備妤執行寫入命令時,它會通知傳送相關資料予磁碟機 125之磁碟控制器1 15。 磁碟控制器1 1 5包含一處理器1 1 7及相關記憶體U 8 以執行有關和主電腦1 1 0與磁碟機1 2 5交換資料的程序。 它同時包含一控制器命令佇列1 20,其含有尚未發出予磁 碟機125之命令。 第2頁 _ (請先閱讀背面之注意事項再填寫本頁) 經濟部智慧財產局員工消費合作社印製 本紙張尺度適用中國國家標準(CNS)A4規格(210 X 297公釐) ·11!11!11 — — — — — — — — — — — —— — — — — — — — — — — ^---- B7 A7 五 經濟部智慧財產局員工消費合作社印製 、發明說明() 磁碟機125也包含一些具處理器格式(未示出)的局部 智慧(local intelligence)及相關的記憶體128,其包含一磁 碟機命令佇列1 3 0。磁碟機命令佇列1 3 〇含有已發給磁碟 機1 2 5但尚未被其執行的命令。 系統的性也’例如電腦系統1 0 〇,通常以反應時間及 輸貫量(throughput)來評估。反應時間,或為等待時間, 為介於命令發出與執行命令間的時間,一個短的反應時間 較佳於一個長反應時間。輸貫量為在一特定時間内系統處 理命令的總數量,一較大的輸貫量較佳於較少的輸貫量。 磁碟控制咨1 1 5與磁碟機1 2 5皆包含企圖減少反應時 間及增加輸貫量的特徵,這些特徵包含於控制器命令仔列 1 20上與磁碟機命令佇列1 30上優先排序與組織命令。 磁碟控制器1 15指定每一個將發出至磁碟機i25之命 令一個優先權位階,最重要的命令將賦予最高之優先權, 關於這三種優先權位階分別是請求階段、前階段及後階 段。 請求階段優先權位階是最高的,並結合著主電腦n 〇 希望讀取資料之命令。通常,當主電腦110發出一讀取命 令予磁碟控制器1 1 5,主電腦1 1 0對該資料有一立即之需 求,因此,當磁碟控制器1 1 5從主電腦1 1 〇收到一讀取命 令時’它賦予讀取命令此請求階段優先權位階。 次咼的優先權是前階段優先權位階,其相對於由主電 腦1 1 0所發出的讀取命令,賦予由磁碟控制器丨丨5發出的 讀取命令。磁碟控制器1 1 5評估最近從主電腦1丨〇接收的 第3頁 ------1¾ (請先閱讀背面之注意事項再填寫本頁) 訂· — •線丨^--- \ ί 【 - * ώ V *t / ㈣912V. Description of the invention () The invention of the jaw city: The present invention relates to the ordering of the disk drives and in particular to the decision whether to issue a command to the disk drive based on the priority level of the command and the pending load of the disk drive. Background of the Invention: Figure 1 is a block diagram of a prior art computer system i00. Its main components are a host computer 110, a disk controller 115, and a disk drive 125. The disk drive 125 may be two commercial, off-the-shelf, component, sometimes referred to as a commercial disk drive, which conforms to the Small Computer System Interface (SCSi) protocol. The host computer 1 1 0 calculates the data stored in the disk drive 2 5. When the host computer 1 1 0 wants to read the data, it sends a read command to identify the data to the disk controller 1 1 5. Then, the disk controller 丨 5 issues a read command to the disk drive 1 2 5. When the drive 12 5 executes this read command, it will send data to the disk controller 1 1 5, and the disk controller 1 15 will pass the data to the host computer 110. If the host computer 110 wants to write data, it sends a write command and sends the related data to the disk controller 1 15. Then, the 'disk controller 115 sends a write command to the disk drive 125. When the disk drive 125 is ready to execute a write command, it will notify the disk controller 115 of the disk drive 125 to transmit relevant data. The disk controller 1 1 5 includes a processor 1 7 and related memory U 8 to execute procedures related to data exchange between the host computer 1 10 and the disk drive 1 2 5. It also contains a controller command queue 120 which contains commands that have not yet been issued to the drive 125. Page 2_ (Please read the notes on the back before filling out this page) The paper size printed by the Employees' Cooperatives of the Intellectual Property Bureau of the Ministry of Economic Affairs is compliant with China National Standard (CNS) A4 (210 X 297 mm). ! 11 — — — — — — — — — — — — — — — — — — — — — — ^ ---- B7 A7 Five, printed by the Intellectual Property Office of the Ministry of Economic Affairs, Consumer Cooperatives, and description of the invention () Disk The machine 125 also includes some local intelligence in a processor format (not shown) and associated memory 128, which includes a drive command queue 130. Drive command queue 1 30 contains commands that have been issued to drive 1 2 5 but have not yet been executed by them. Systematic properties, such as computer systems 100, are usually evaluated in terms of response time and throughput. The response time, or waiting time, is the time between the command being issued and the command being executed. A short response time is better than a long response time. The throughput is the total number of commands processed by the system within a specific time. A larger throughput is better than a smaller throughput. Disk control 1 1 5 and drive 1 2 5 both include features that attempt to reduce response time and increase throughput. These features are included in controller command line 1 20 and drive command line 1 30 Prioritize and organize commands. The disk controller 1 15 specifies a priority level for each command that will be issued to the drive i25. The most important command will give the highest priority. The three priority levels are the request phase, the front phase, and the rear phase. . The request stage has the highest priority and is combined with the command that the host computer n 〇 wishes to read data. Generally, when the host computer 110 issues a read command to the disk controller 1 1 5, the host computer 1 10 has an immediate demand for this data. Therefore, when the disk controller 1 1 5 receives from the host computer 1 1 0 At the time of a read command, it gives the read command priority level for this request phase. The priority of the second stage is the priority level of the previous stage, which is given to the read command issued by the disk controller 5 with respect to the read command issued by the main computer 110. The disk controller 1 1 5 evaluates the 3 pages recently received from the host computer 1 丨 〇 ------ 1¾ (Please read the precautions on the back before filling this page) Order · — • 线 丨 ^ --- \ ί 【-* FREE V * t / ㈣912
五、發明說明( 命令歷史,並企圖預測主電腦110將發出的下一個命令。 例如,假設當主電腦i丨〇已經為兩個相鄰資料區塊發出讀 取〒7磁碟控制盗n 5可能會預測來自主電腦11 〇的下 一個命令將是為第三相鄰資料區塊的讀取命令。由這個命 令的推測,磁碟控制器115為第三相鄰資料區塊發出一讀 取命令予磁碟機1 25。如此由主電腦i丨〇之讀取命令推測 而形成的來自磁碟控制器丨丨5之讀取命令,將被賦予此前 階段優先權位階。 後暗段優先權位階比前階段優先權位階為低,磁碟控 制态1 1 5對將被寫入磁碟機1 2 5之資料賦予寫入命令此後 階段優先權位階’當主電腦丨丨〇窝資料至一儲存裝置時, 它通常至少在短時間内已完成資料處理,主電腦丨i 〇傳送 資料給磁碟控制器11 5然稍後並移至其他的工作,主電腦 1 1 0並不等候磁碟控制器丨丨5實際將資料寫入磁碟機 1 2 5 ’所以對於磁碟機丨2 5執行寫入命令並無立即之緊 急。 磁碟控制器1 1 5以優先權之次序組織控制器命令佇列 1 2 0 ’也就是說’有最高優先權位階的命令被放置於控制 器命令佇列1 20的前端’而有最低優先權位階的命令被放 置於控制器命令佇列1 20的尾端,相同優先權位階的命令 則根據他們在佇列的時間量來排序,亦即,命令是根據優 先權及時間來排序。於控制器命令仵列丨2 0前端的命令是 下一個磁碟控制器1 1 5將發送予磁碟機i 2 5的命令,此控 制器命令佇列1 20上命令之組織是企圖用來將最高優先 第4頁 本紙張尺度適用中國國家標準(CNS)A4規格(210 X 297公爱) (請先閱讀背面之注意事項再填寫本頁) t 訂---------線, 經濟部智慧財產局員工消費合作社印製 47〇912V. Description of the invention (command history and attempt to predict the next command that the host computer 110 will issue. For example, suppose that when the host computer i 丨 〇 has issued read 7 disk control thieves n 5 It may be predicted that the next command from the host computer 11 will be a read command for the third neighboring data block. Based on the speculation of this command, the disk controller 115 issues a read for the third neighboring data block. Command to drive 1 25. The read command from the disk controller 丨 5 formed by the read command from the host computer i 丨 〇 will be given priority in the previous stage. The priority level is lower than the previous stage. The disk control state 1 1 5 gives the write command to the data that will be written to the drive 1 2 5. In the subsequent stage, the priority level is' When the host computer 丨 丨 0 the data to a When the device is stored, it usually completes the data processing at least in a short time. The host computer 丨 i 〇 sends data to the disk controller 11 5 and then moves to other tasks, the host computer 1 1 0 does not wait for the disk Controller 丨 丨 5 Actually write data Disk drive 1 2 5 'Therefore, there is no immediate urgency to execute a write command for disk drive 2 5. Disk controller 1 1 5 organizes the controller command queue 1 2 0 in the order of priority'. That is, 'The command with the highest priority level is placed at the front of the controller command queue 1 20' and the command with the lowest priority level is placed at the end of the controller command queue 1 20. The commands with the same priority level are They are sorted according to the amount of time they are in the queue, that is, the commands are sorted according to priority and time. In the controller command queue, the command in front of 2 0 is the next disk controller 1 1 5 will be sent to the magnetic The order of the disc player i 2 5 and the order of the controller command line 1 20 is an attempt to use the highest priority page 4 This paper size applies the Chinese National Standard (CNS) A4 specification (210 X 297 public love) ( (Please read the notes on the back before filling this page) t-order ---- line, printed by the Consumer Cooperative of the Intellectual Property Bureau of the Ministry of Economic Affairs 47〇912
五、發明說明() 經濟部智慧財產局員工消費合作社印製 權命令之反應時間減到最小。 磁碟控制器1 1 5可以將命令由前階段優先權位階提升 至請求階段優先權位階,當如此之命令被提升至請求階 段’此命令將被置於其他請求階段優先權命令之後。注 意,後階段優先權位階命令是不適合提升的。 磁碟控制器1 1 5亦使用一老化(agillg)演譯法,即於一 預定期間之後提高位於控制器命令佇列丨2 〇上所有命令 的優先權位階。更特別是,經過預定期間之後,於控制器 命令传列丨20上之所有命令被提升至一較高之優先權位 階。須注意’老化演譯法應用於所有命令而不管優先權位 階,老化演譯法是用來避免一個優先權低的命令"餓死,’, 即未被服務’即在新接收的命令具較高優先權位階的情沉 下。 磁碟機1 2 5保留於磁碟機命令佇列丨3 〇上之尚未執行 的命令’磁碟機1 2 5可以執行兩種模式,即順序模式或再 排序模式。於順序模式時,磁碟機1 2 5發出命令予磁碟機 命令佇列1 3 0 ’並以其接收自磁碟控制器丨丨5之順序來執 行命令。於再排序模式時,磁碟機丨2 5改變磁碟機命令佇 列1 3 0上的命令順序,將介於連續執行命令間之尋找時間 及迴轉等待時間減少至最低,因而改進輸貫量。 於再排序模式時,隨著磁碟機命令佇列1 3 0上命令的 數量增加,因為當選擇下一個命令執行時其有較多的命令 以供選擇’磁碟機125變得更有效率。因此,輸貫量增加。 然而’隨著磁碟機命令佇列1 3 0上命令的數量增加’對一 _ 第5頁 _ 本紙張尺度適用中國國豕標準(CNS)A4規格(210 X 297公爱) --------_· (請先閱讀背面之注意事項再填寫本頁) 訂---- 線如---------------------- 470912V. Description of the invention () The response time of the printing order of the consumer cooperative of employees of the Intellectual Property Bureau of the Ministry of Economic Affairs has been minimized. The disk controller 1 1 5 can raise the command from the priority level of the previous stage to the priority level of the request stage. When such a command is promoted to the request stage ', this command will be placed after the priority commands of other request stages. Note that the priority order command at the later stage is not suitable for promotion. The disk controller 1 1 5 also uses an agill algorithm, that is, after a predetermined period, the priority level of all commands on the controller's command queue 丨 2 0 is increased. More specifically, after a predetermined period of time, all commands on the controller command queue 20 are promoted to a higher priority level. It should be noted that the aging interpretation method is applied to all commands regardless of the priority level. The aging interpretation method is used to avoid a command with a lower priority " starvation, ', that is, not being served', that is, the newly received command is compared High-priority sentiment sinks. Drive 1 2 5 remains in the drive command queue 丨 3 〇 Unexecuted commands' drive 1 2 5 can execute two modes, that is, sequential mode or re-sequencing mode. In the sequential mode, the drive 1 2 5 issues a command to the drive command queue 1 3 0 ′ and executes the command in the order it received it from the drive controller 5. In the reordering mode, the drive changes the order of the commands on the drive command queue 1 3 0 to reduce the seek time and rotation waiting time between consecutive execution of commands to a minimum, thus improving the throughput. . In the reordering mode, as the number of commands on the drive command queue 130 increases, because when the next command is selected for execution, it has more commands to choose from. The drive 125 becomes more efficient. . As a result, the throughput increases. However, 'as the number of commands on the drive command queue 1 3 0 increases' to one _ page 5 _ This paper size applies the Chinese National Standard (CNS) A4 specification (210 X 297 public love) ---- ----_ · (Please read the precautions on the back before filling this page) Order ---- Line as ---------------------- 470912
發明說明( ,…疋〒令之潛在最大等待時間亦增加,同時’磁碟機1 並不知it磁碟控制H 115所使用之優先權位階,所以於再 排序模式下磁碟機可能執行一個或數個低優先權命令先 於一高優先權命令。 另一特徵,稱為佇列頭端選擇,允許磁碟控制器i i 5 主張將一特定命令置於磁碟機命令佇列130之頭端。當磁 碟控制益1 1 5發出一命令並指定佇列頭端選擇,此指定防 止磁碟機1 2 5再排序磁碟機命令佇列丨3 〇,且此指定命令 是磁碟機1 25下一個將執行之命令。此特徵將指定命令之 等待時間減至最低’但卻犧牲了磁碟機之效率並增加磁碟 機命令佇列1 3 0上其他命令之等待時間。 有一個問題發生,當數個含佇列頭端選擇的連績命令 被發出快於磁碟機1 2 5可以執行命令之速率,在此情況 下’三個含佇列頭端選擇以C 1、C2及C3次序發出的命 令將以C3、C2及C1的次序執行,最久的命令C1將不管 其優先權位階而最後執行。同時,因為佇列頭端選擇,磁 碟機無法再排序命令以改善輸貫量,結果佇列頭端選擇反 而影響命令C 1之反應時間及電腦系統1 00之整體輸貫 量 0 一個理想的系統會將反應時間降至最低而將輸貫量 增加至最大,下述的專利是一些用以陳述此挑戰之先前技 術的代表。 美國專利號碼4,425,615,發明人為Swenson等人’ 標題為,,多磁碟命令仔列之快取記憶體/磁碟次系統之層 第 61_____ 張尺度適用中國國家標準(CNS)A4規格(210 X 297公釐) --------訂---------線 4^ (請先閱讀背面之注意事項再填寫本頁) 經濟部智慧財產局員工消費合作社印制衣 470912 A7 B7 經濟部智慧財產局員工消費合作社印製 五、發明說明( ’入C憶體系統述一磁碟次系統包含數個磁碟機,其 中為每一個磁碟機提供-命令佇列,賦予每-命令佇列一 優先權值及-次序號碼’使得當磁碟機對應於佇列空閒 時,執行最高優先權佇列命令號碼。 美國專利號碼5,548,795,發明人為Au,標題為,,於命 令佇列再排序程序中,決定命令執行依存關係之方法”, 描述一方法其計算最小之等待時間、維持磁碟機命令佇列 内的依存關係訊息及使用此訊息以限制命令以時間及計 算效率的方式再排序。 美國專利號碼5,469,560 ’發明人為Beglin,標題為n 於一自動儲存之圖書館優先排序等待讀取請求,,,描述一 資料處理系統從自動儲存圖書館之磁碟中,讀取目標之優 先排序方法,將等待時間降至最低。 美國專利號碼5,729,71 8,發明人為Au,標題為,,以磁 頭開關、尋找及迴轉等待時間為方程式解決前置時間等待 之系統及利用隱藏磁碟機控制器為命令佇列再排序",描 述一再排序由磁碟機接收命令之系統。等待之前置時間由 仵列内之命令’其相對於活動命令所決定,此命令使最小 之等待前置時間被選擇且提升至佇列前端,並將於活動命 令後執行。 美國專利號碼5,848,226’發明人為Chen等,標題為 ”數位列印系統經由緩衝記憶體傳送優先排序資料”,描述 一磁碟機之控制方法。此控制方法由軟體本體指定優先權 數值予命令輸出並執行具最高優先權之命令。 第7頁 本紙張尺度適用中國國家標準(CNS)A4規袼(210 X 297公釐) ---------------------t--------------------------------- (請先閱讀背面之注意事項再填寫本頁) 470912 經濟部智慧財產局員工消費合作社印製 A7 ------ - Β7 五、發明說明() 用以減少反應時間或增加輸貫量之先前技術,通常是 指主動地再優先排序命令或再排序一佇列以改善系統效 率的方法。典型的改善反應時間會伴隨著輸貫量的減少, 反之亦然。同時’這些技術通常很複雜而且並不一定適用 於商用磁碟機。 發明目的及概诚 : 因此’本發明之一目標為提供磁碟控制器及方法以決 定是否發出一命令予一磁碟機,將高優先權命令之反應時 間降至最低並提高所有命令之輸貫量。 本發明之另一目的為提供適合商用磁碟機運作之磁 碟控制器及方法。 於包含一磁碟控制器及一磁碟機之一電腦系統中,磁 碟控制器藉由考量一相關於其命令之優先權位階與磁碟 機之未決負荷量,以決定是否發出一命令予磁碟機。 磁碟控制器首先決定命令之優先權位階,若此命令優 先權大於一預定位階,且若磁碟機之未決負荷量少於一第 一臨界Μ時則將發出一命令;若此命令優先權不大於一 預定位階,且若磁碟機之未決負荷量少於一第二臨界Ν時 則將發出一命令。一般而言’ Μ关Ν ’而且其數值會以有 利於高優先權命令執行之方式做選擇。 於一實施例中,並不設限於此,磁碟機之未失負荷量 是指未決命令之數量,亦即已被發出但磁碟機尚未執行之 命令。第一臨界Μ設為8個未決命令’且第二臨界ν設 第8頁 本紙張尺度適用中國國家標準(CNS)A4規格(210 X 297公釐) —--------訂---------線 (請先閱讀背面之注意事項再填寫本頁) A7 470912 ___________Β7 _ _ 五、發明說明() 為2個未決命令。當考量是否發出一命令予磁碟機時,磁 碟控制器首先決定命令之優先權位階,假設此命令優先權 具最高位階,只要未完成命令數目少於8便會發出命令; 假設此命令優先權不具最高位階,只要未完成命令數目·少 於2便會發出命令。藉由當考量一高優先權命令時使用一 具8個未決命令之第一臨界值及考量一較低優先權命令 時使用一具2個未決命令之第二臨界值,磁碟控制器會調 整需求,將高優先權命令之反應時間降至最低而不會對磁 碟機所有命令之輸貫量造成不利之影響。 只當磁碟機在相對輕之未決負荷量下運作時,磁碟控 制器發出一低優先權命令予磁碟機這可保證只有一小量 之低優先權命令未決,當磁碟控制器必須處理高優先權命 令之突然匯入時。 於系統中,其磁碟機包含一個可將未決命令再排序之 命令佇列,當命令佇列上之命令數量增加時磁碟機變得更 有效率,因為磁碟機選擇下一個命令執行時有更多的命令 得以選擇。當磁碟機在相對輕之未決負荷量下運作,且只 有一少量低優先權命令未決於命令仵列上,則磁碟機有較 少的機會將其效率最佳化。然而,單獨命令之反應時間反 而受惠’因為一最近發出之命令將等待於僅一小量先前發 出命令之後。 本發明允許更高優先權命令加入磁碟機命令佇列而 非低優先權命令’因此,若高優先權命令數量增加時,磁 碟機將有較多的命令得以選擇,而且系統的效率及輪貫量 私紙張尺度適用中國國家標準(CNS)A4規格(210 X 297公釐) — — — — — — — — — — — — - — — 111 — — ^ ·111!1111 (請先閱讀背面之注意事項再填寫本頁) 經濟部智慧財產局員工消費合作社印製 五、發明說明() 將會改善。 (請先閱讀背面之注意事項再填寫本頁) 圖式簡單說明: \/第1圖是一關於先前技術電腦系統技術的方塊圖; /第2圖是特別適用於本發明實行之一電腦系統方塊圖;以 及 / /第3圖是根據本發明決定是否發出一命令予磁碟機之程 序的一流程圖。 圖號對照說明: 100 先前技術電腦系統 110 主電腦 115 磁碟控制器 117 處理器 118 記憶體 120 控制器命令佇列 125 磁碟機 128 記憶體 130 磁碟機命令佇列 200 電腦系統 210 主電腦 215 磁碟控制器 216 處理器 217 記憶體 218 未決負荷量 219 命令發出程序 220 控制器命令佇列 225 磁碟機 228 記憶體 230 磁碟機命令佇列 250 資料記憶體 305 未完成命令數目 經濟部智慧財產局員工消費合作社印製 發明詳細說明: 第2圖是一電腦系統200之一方塊圖,其主要元件為 第10頁 本紙張尺度適用中國國家標準(CNS)A4規格(210 X 297公釐) 47〇912Description of the invention (,, ... The potential maximum waiting time of the command is also increased, and 'disk drive 1 does not know the priority level used by it disk control H 115, so the disk drive may perform one or Several low-priority commands precede a high-priority command. Another feature, called queue head selection, allows the disk controller II 5 to claim that a particular command be placed at the head of drive command queue 130. When the disk control command 1 1 5 issues a command and specifies the queue head end selection, this designation prevents the drive 1 2 5 from reordering the drive command queue 丨 3 〇, and the specified command is drive 1 25 The next command to be executed. This feature minimizes the waiting time of the specified command, but sacrifices the efficiency of the drive and increases the waiting time of other commands on the drive command queue 1 3 0. There is a problem Occurs when several consecutive orders with queue head selection are issued faster than the speed at which the drive 1 2 5 can execute the command. In this case, 'three queued head options select C 1, C2 and Orders issued in C3 order will be in the order of C3, C2 and C1 The oldest command C1 will be executed regardless of its priority level. At the same time, due to the queue head end selection, the drive can no longer sort the commands to improve the throughput. As a result, the queue head end selection affects the command C 1 Response time and the overall throughput of the computer system 0 0 An ideal system would minimize the response time and increase the throughput to the maximum. The following patents are representative of some of the previous technologies used to address this challenge . US Patent No. 4,425,615, the inventor is Swenson et al. 'The title is, the level of cache memory / disk system of the multi-disk command array is 61_____. The scale is applicable to the Chinese National Standard (CNS) A4 specification (210 X 297 mm) -------- Order --------- Line 4 ^ (Please read the precautions on the back before filling out this page) Printed Clothing for Employees' Cooperatives of the Intellectual Property Bureau of the Ministry of Economic Affairs 470912 A7 B7 Printed by the Consumer Cooperatives of the Intellectual Property Bureau of the Ministry of Economic Affairs. 5. Description of the invention ('Into the C memory system, a magnetic disk system contains several disk drives, of which a -command queue is provided for each disk drive. Every-command queue Prior weights and -sequence numbers' enable the highest priority queue command number to be executed when the drive corresponding to the queue is idle. US Patent No. 5,548,795, inventor Au, titled, in the order queue reordering procedure "Determining the method of order execution dependencies", describes a method that calculates the minimum wait time, maintains the dependency information in the drive's command queue, and uses this information to limit the order of the command in time and computational efficiency. United States Patent No. 5,469,560 'The inventor is Beglin, and the title is n Priority order waiting for a read request in an automatic storage library, and describes a method for prioritizing a data processing system to read targets from a magnetic disk in an automatic storage library, Minimize waiting time. U.S. Patent No. 5,729,71 8. The inventor is Au. The title is: System for Solving Lead Time Waiting with Head Switch, Search and Rotate Waiting Time as Equations, and Hidden Disk Drive Controller for Command Queue Reordering " Describes a system that repeatedly orders commands received by the drive. The waiting pre-set time is determined by the command in the queue ′ relative to the active command. This command makes the minimum waiting lead time selected and promoted to the front of the queue, and will be executed after the active command. U.S. Patent No. 5,848,226 'is invented by Chen et al., Entitled "Digital Printing System Sends Priority Data via Buffer Memory", and describes a control method for a magnetic disk drive. In this control method, the software body assigns a priority value to the command output and executes the command with the highest priority. Page 7 This paper size applies Chinese National Standard (CNS) A4 Regulation (210 X 297 mm) --------------------- t ----- ---------------------------- (Please read the notes on the back before filling out this page) 470912 Employee Consumer Cooperatives, Intellectual Property Bureau, Ministry of Economic Affairs Print A7 -------Β7 V. Description of the Invention () The previous technology used to reduce the reaction time or increase the throughput, usually refers to actively reordering the order or reordering a queue to improve system efficiency Methods. A typical improvement in response time is accompanied by a decrease in throughput and vice versa. At the same time, these technologies are often complex and not necessarily suitable for commercial drives. Purpose of the invention and sincerity: Therefore, one of the objectives of the present invention is to provide a disk controller and method to decide whether to issue a command to a disk drive, minimize the response time of high priority commands and increase the output of all commands.量 量 Throughput. Another object of the present invention is to provide a disk controller and method suitable for the operation of a commercial disk drive. In a computer system including a disk controller and a disk drive, the disk controller decides whether or not to issue a command by considering a priority level related to its command and the pending load of the disk drive. Drive. The disk controller first determines the priority level of the command. If the priority of the command is greater than a predetermined level, and if the pending load of the disk drive is less than a first critical M, a command will be issued. No more than a predetermined level, and if the pending load of the drive is less than a second critical N, a command will be issued. Generally speaking, 'Μ 关 Ν' and its value will be selected in a way that facilitates the execution of high priority commands. In one embodiment, it is not limited to this. The unloaded amount of the drive refers to the number of pending commands, that is, commands that have been issued but have not yet been executed by the drive. The first threshold M is set to 8 pending orders' and the second threshold ν is set to page 8. This paper size applies the Chinese National Standard (CNS) A4 specification (210 X 297 mm) —-------- Order- -------- Line (Please read the precautions on the back before filling out this page) A7 470912 ___________ Β7 _ _ 5. Description of the invention () is 2 pending orders. When considering whether to issue a command to the drive, the disk controller first determines the priority level of the command. Assuming this command has the highest priority, the command will be issued as long as the number of outstanding commands is less than 8. The right does not have the highest rank, as long as the number of outstanding commands is less than 2, the command will be issued. By using a first threshold value of 8 pending commands when considering a high priority command and a second threshold value of 2 pending commands when considering a lower priority command, the disk controller will adjust Demand to minimize the response time of high priority commands without adversely affecting the throughput of all commands on the drive. The disk controller issues a low priority command to the drive only when the drive is operating at a relatively light pending load. This ensures that only a small number of low priority commands are pending. When processing sudden import of high priority orders. In the system, its drive contains a command queue that can reorder pending commands. When the number of commands on the command queue increases, the drive becomes more efficient because the drive selects the next command to execute. More commands are available. When the drive is operating with a relatively light pending load and only a small number of low priority commands are pending on the command queue, the drive has less chance to optimize its efficiency. However, the response time of individual orders is benefited 'because a recently issued order will wait after only a small amount of previous orders. The present invention allows higher priority commands to be added to the drive command queue instead of low priority commands. Therefore, if the number of high priority commands increases, the drive will have more commands to choose from, and the efficiency and Rotary measuring paper size applies to China National Standard (CNS) A4 (210 X 297 mm) — — — — — — — — — — — — — — — — — 111 — 11! 1111 (Please read the back first Note for re-filling this page) Printed by the Consumer Cooperatives of the Intellectual Property Bureau of the Ministry of Economic Affairs 5. The invention description () will be improved. (Please read the notes on the back before filling in this page) Brief description of the drawings: \ / Figure 1 is a block diagram of the computer technology of the prior art; / Figure 2 is a computer system particularly suitable for the implementation of the present invention Block diagram; and // FIG. 3 is a flowchart of a procedure for deciding whether to issue a command to a disk drive according to the present invention. Comparative description of drawing numbers: 100 prior art computer system 110 main computer 115 disk controller 117 processor 118 memory 120 controller command queue 125 drive 128 memory 130 drive command queue 200 computer system 210 host computer 215 Disk controller 216 Processor 217 Memory 218 Pending load 219 Command issuing procedure 220 Controller command queue 225 Drive 228 Memory 230 Drive command queue 250 Data memory 305 Number of outstanding commands Intellectual Property Bureau employee consumer cooperative printed invention details: Figure 2 is a block diagram of a computer system 200, the main components of which are on page 10. This paper size applies the Chinese National Standard (CNS) A4 specification (210 X 297 mm) ) 47〇912
經濟部智慧財產局員工消費合作社印製 五、發明說明() —主電腦2 1 〇、一磁碟控制器2 1 5及一磁碟機225 ’此三 元件之運作及他們彼此間之關係,與上述第一圖所描述之 内容相似。 磁碟機2 2 5可以是一商用的、現成的、元件的’有時 稱為商用磁碟機,其符合小型電腦系統介面(SCSI)協定。 然而,本發明並不侷限於此S C SI協定,而可以應用於任 何基於執行命令之效率將命令再排序之磁碟機。 磁碟機225包含一處理器(未示出)及相關的記憶體 228 ’其包含一磁碟機命令佇列230。磁碟機命令佇列23〇 含有已發出給磁碟機225但尚未被其執行的命令,磁碟機 2 2 5可將磁碟機命令仔列2 j 0上的命令再排序。 磁碟控制器2 1 5包含一處理器2 1 6及相關的記憶體 2 1 7以執行關於主電腦2 1 0及磁碟機2 2 5改變資料的程 序。一控制器命令佇列220包含尚未發出給磁碟機225的 命令’磁碟控制器2 1 5亦維持一未決負荷量數值2 1 8其表 示磁碟機2 2 5之一未決負荷量’未決負荷量數值2 1 8可以 是任何指示值其代表磁碟機225之未決負荷量,例如執行 未決命令或很多未決命令的估計時間。命令發出程序2 j 9 決定是否發出一命令予磁碟機225。 於一實施例中,未決負荷量數值218是一未完成命令 數目(OCC),亦是已發出給磁碟機225但尚未被其執行的 命令數量。換句話說’未決負荷量數值218表示磁碟機命 令佇列2 3 0上的命令數量’當磁碟控制器2 1 5發出一命令 予磁碟機225時,其增加未決負荷量數值2 1 8的數量,本 第11頁 11 ---^------;---- C請先間讀背面之注意事頊存填寫本頁)Printed by the Consumer Cooperative of the Intellectual Property Bureau of the Ministry of Economic Affairs V. Invention Description ()-host computer 2 10, a disk controller 2 15 and a disk drive 225 'The operation of these three components and their relationship with each other, Similar to what was described in the first picture above. Disk drive 2 2 5 may be a commercial, off-the-shelf, component 'sometimes called a commercial disk drive, which conforms to the Small Computer System Interface (SCSI) protocol. However, the present invention is not limited to this SCSI protocol, but can be applied to any disk drive that reorders commands based on the efficiency of command execution. The disk drive 225 includes a processor (not shown) and associated memory 228 ', which includes a disk drive command queue 230. Drive command queue 23 contains commands that have been issued to drive 225 but have not yet been executed. Drive 2 2 5 can reorder the commands on drive command queue 2 j 0. The disk controller 2 1 5 includes a processor 2 16 and related memory 2 1 7 to execute a program for changing data on the host computer 2 10 and the disk drive 2 2 5. A controller command queue 220 contains a command 'disk controller 2 1 5 also holds a pending load value 2 1 8 which has not yet been issued to the drive 225, which indicates that one of the pending loads of the drive 2 2 5' is pending The load value 2 1 8 can be any indication value that represents the pending load of the drive 225, such as the estimated time to execute a pending command or many pending commands. The command issuing procedure 2 j 9 decides whether to issue a command to the drive 225. In one embodiment, the pending load value 218 is the number of outstanding commands (OCC) and the number of commands that have been issued to the drive 225 but have not yet been executed. In other words, 'pending load value 218 indicates the number of commands on the drive command queue 2 3 0'. When the disk controller 2 1 5 issues a command to the drive 225, it increases the pending load value 2 1 The number of 8, 11 of this page 11 --- ^ ------; ---- C Please read the notes on the back first and save this page)
經濟部智慧財產局員工消費合作社印製 470912 五、發明說明() 磁碟機225執行一命令,磁碟控制器減少未決負荷量數值 2 1 8的數量。 磁碟控制器2 1 5指定一優先權位階予每一個即將發出 給磁碟機22 5的命令,如上所述,於第一圖中,請求階段 是最高的優先權位階。於一實施例中,一命令優先權可以 處於請求階段’或是可以處於一較低的優先權位階,此較 低的優先權位階並不分彼此。亦即,一命令優先權可以處 於請求階段,或是可以不處於請求階段。然而,於一般情 形,本發明可用優先權位階之任一數字運作。 當考量是否發出一命令予磁碟機225時,命令發出程 序219首先決定命令之優先權位階,假設命令優先權是在 處於請求階段,只要當未完成命令數目少於8,命令就會 發出;假設命令優先權不處於請求階段,只要當未完成命 令數目少於2 ’命令就會發出。 此演譯法允許最多8個命令停佇於磁碟機命令佇列 2 3 0上’例如這會發生於當電腦系統2 〇 〇忙到足以累積8 個請求階段命令、當8個較低優先權命令已變成請求階 段,或是此兩例之組合。另一方面,僅2個較低優先權命 令可以停佇於磁碟機命令佇列23 0上。因此,當電腦系統 2 0 0於工作量輕之情形下運作’一請求階段命令將會在不 超過2個先前已發出之命令之後等待。此方法提供請求階 段命令一優先處理’使其反應時間降至最低,而允許磁碟 機2 2 5重新將磁碟機命令彳宁列2 3 〇上之命令排列,將輸貫 量增加至最大。 _____ 第12頁 本紙張尺度適用中國國家標準(CNS)A4規格⑵〇 x 297公]) --- ------------------—^---------^ i^w. (請先閱讀背面之注意事項再填寫本頁) 470912 A7 B7 經濟部智慧財產局員工消費合作社印製 五、發明說明() 第3圖是一命令發出程序219之流程圖300。當磁碟 控制器215必須決定是否發出一命令予磁碟機⑵時,將 援用命令發出程序219,這將發生於當主電腦11〇收到一 個新命令、磁碟機125完成一先前已發出之命令、或是一 命令已被提升至一較高優先權位階,所考量之命令是位於 控制器命令佇列22 0頭端之命令。 如先前所述’未決負荷量218表示磁碟機225之一未 決負荷量,且於較佳實施例中,其保持一未完成命令數 目。如第3圖所示,命令發出程序219評估未完成命令數 目(OCC)305。 於步騾3 1 0中,程序開始於決定考量中之命令是否有 一請求階段優先權位階’若優先權位階是處於請求階段, 則程序前進至步驟3 1 5 ;若優先權位階不是處於請求階 ^又’則程序如進至步驟3 2 5。注意,於此實施例中,請求 階段是一優先權位階臨界,並不需要考量優先權位階大於 清求階段的狀況’因為請求階段是最高可能的優先權位 階。然而’一般狀況而言’此優先權位階臨界並不需要是 最高的優先權位階,而且程序會決定命令優先權位階是否 大於或等於優先權位階臨界。 於步驟315,此程序決定未完成命令數目305是否少 於一數目為8的第一臨界,換句話說,其決定是否磁碟機 命令佇列230含有少於8個未完成命令,若未完成命令數 目少於8,程序則前進至步驟320;若未完成命令數目並 不少於8,程序則前進至步驟3 3 5。 第13肓 本紙張尺度ig用中國國家標準(CNS)A4規格(210 X 297公愛1 "" "" ---------—--------^--------- (請先閱讀背面之注意事項再填寫本頁) 470912 A7 B7 經 濟 部 智 慧 財 產 局 員 工 消 費 合 作 社 印 製 五、發明說明( 於步驟320’此私序發出考量中之命令予磁碟機225, 其後’程序前進至步驟335。 於步驟:)25’此耘序會決定未完成命令數目3〇5是否 少於-數量為2的第二臨界’換句話說,其決定是否磁碟 機命令侍列230含有少於2個未完成命令,若未完成命令 數目少於2,程序則前進至步驟33〇 ;若未完成命令數目 並不少於2 ’程序則前進至步驟3 3 5。 於步驟^0’此程序發出考量中之命令予磁碟機225, 其後’程序前進至步驟335。 於步驟3 3 0 ’此程序結束。 注意,命令發出程序220並不使用先前所述之佇列頭 端選擇,磁碟機225可以於再排列模式下運作而且將磁碟 機命令佇列230上之命令再排列,此允許磁碟機23〇於再 排列模式可得下將其輸貫量最佳化。 當執行這裡所表示之本發明所需程序係如已載入磁 碟控制器215之記憶體217中,其程序也可以配置於儲存 媒體上,例如於第2圖之資料記憶體250,其後可載入吃 憶體2 1 7中。 在此必須了解的是先前所述僅用於對本發明之描 述,熟悉此項技藝之人可以於不脫離本發明範圍之下雙叶 出不同之替代方案及修改。例如,命令發出程序不需限定 為兩個優先權位嘴或兩個未決負荷量臨界,可以考量多個 優先權位階及臨界。其次,磁碟控制器並不需要如第二圖 磁碟控制器2 1 5所代表之一單一元件,而它可以是障藏於 第u頁 本紙張尺度適用中國國家標準(CNS)A4規格(210 χ 297公釐) ---------------------訂---------線"^^ (請先閱讀背面之注音?事項再填寫本頁) A7 470912 B7 — - 一^ — 1 —一丨丨 _丨 — 五、發明說明() 另一裝置中,如主電腦2 1 〇。同時’本發明並不侷限於僅 有一磁碟機之電腦系統’於多磁碟機之系統,磁碟控制器 2 1 5對於多個磁碟機中之每一個保持一控制器命令佇列 220及一未決負荷量218。因此’本發明欲包含落入申請 專利範圍内之所有替代方案、修改方法及其變化。 !.!!------f (請先閱讀背面之注意事項再填寫本頁) 訂----Printed by the Consumer Cooperatives of the Intellectual Property Bureau of the Ministry of Economic Affairs 470912 V. Description of the invention () Disk drive 225 executes a command, and the disk controller reduces the number of pending load values 2 1 8. The disk controller 2 1 5 assigns a priority level to each command to be issued to the disk drive 22 5 as described above. In the first figure, the request phase is the highest priority level. In an embodiment, a command priority may be at the request stage 'or may be at a lower priority level, and the lower priority levels are not separated from each other. That is, a command priority may or may not be in the request phase. However, in general, the present invention can be operated with any number of priority levels. When considering whether to issue a command to the drive 225, the command issuing program 219 first determines the priority level of the command. Assuming that the command priority is in the request stage, the command will be issued as long as the number of outstanding commands is less than 8. Assuming that the command priority is not in the request phase, the command will be issued whenever the number of outstanding commands is less than 2 '. This interpretation allows a maximum of 8 commands to stop on the drive command queue 2 3 0 'for example this would happen when the computer system 2000 is busy enough to accumulate 8 request stage commands, when 8 lower priority The command has become the request phase, or a combination of both. On the other hand, only 2 lower priority commands can stop on the drive command queue 230. Therefore, when the computer system 2000 is operating under a light workload, a request phase command will wait after no more than 2 previously issued commands. This method provides the request stage command with priority processing to minimize the response time, and allows the drive 2 2 5 to re-arrange the drive commands on the command line 2 3 0 to increase the throughput . _____ Page 12 This paper size is applicable to Chinese National Standard (CNS) A4 specification 〇〇 297 公]) --- -------------------- ^ ---- ----- ^ i ^ w. (Please read the notes on the back before filling out this page) 470912 A7 B7 Printed by the Consumer Cooperatives of the Intellectual Property Bureau of the Ministry of Economic Affairs 5. Description of the invention () Figure 3 is an order issuing procedure Flow chart 300 of 219. When the disk controller 215 must decide whether to issue a command to the drive, the command issuing procedure 219 will be invoked. This will happen when the host computer 11 receives a new command and the drive 125 completes a previously issued command. Command, or a command has been promoted to a higher priority level, the command under consideration is a command located at the head of the controller command queue 220. As mentioned previously, the 'pending load amount 218 represents one of the pending loads of the drive 225, and in the preferred embodiment, it maintains a number of outstanding commands. As shown in FIG. 3, the command issuing program 219 evaluates the number of outstanding commands (OCC) 305. In step 3 10, the program starts by determining whether the command under consideration has a request stage priority level. If the priority level is in the request phase, the program proceeds to step 3 1 5; if the priority level is not in the request level ^ Again, the procedure proceeds to step 3 2 5. Note that in this embodiment, the request phase is a priority level critical, and it is not necessary to consider the situation where the priority level is greater than the clearing phase 'because the request phase is the highest possible priority level. However, the “priority level” does not need to be the highest priority level, and the program determines whether the command priority level is greater than or equal to the priority level threshold. In step 315, the program determines whether the number of outstanding commands 305 is less than a first threshold of 8. In other words, it determines whether the drive command queue 230 contains less than 8 outstanding commands. If the number of commands is less than 8, the program advances to step 320; if the number of outstanding commands is not less than 8, the program advances to step 3 35. The 13th paper size ig uses Chinese National Standard (CNS) A4 specifications (210 X 297 Public Love 1 " " " " ------------------- ^ --------- (Please read the notes on the back before filling out this page) 470912 A7 B7 Printed by the Consumer Cooperatives of the Intellectual Property Bureau of the Ministry of Economic Affairs Command to drive 225, after which the program proceeds to step 335. At step :) 25 'This sequence will determine whether the number of outstanding commands 3 05 is less than the second threshold of the number 2-in other words , It determines whether the drive command queue 230 contains less than 2 outstanding commands. If the number of outstanding commands is less than 2, the program proceeds to step 33. If the number of outstanding commands is not less than 2, the program then Proceed to step 3 3 5. At step ^ 0 ', this program issues the command under consideration to the drive 225, and then' procedure proceeds to step 335. At step 3 3 0 'this procedure ends. Note that the command issuing program 220 Instead of using the queuing head-end selection previously described, the drive 225 can operate in rearrange mode Rearranging the commands on the drive command queue 230 allows the drive 23 to optimize its throughput in the rearrangement mode. The program required to execute the present invention as shown here is The program that has been loaded into the memory 217 of the disk controller 215 can also be configured on a storage medium, such as the data memory 250 in FIG. 2, and can be later loaded into the memory 2 17. It must be understood that the foregoing is only used to describe the present invention, and those skilled in the art can make different alternatives and modifications without departing from the scope of the present invention. For example, the order issuing procedure need not be limited to two Priority bit mouths or two pending load thresholds, multiple priority levels and thresholds can be considered. Second, the disk controller does not need a single component as represented by the disk controller 2 15 in the second figure, and It can be hidden on page u. The paper size applies the Chinese National Standard (CNS) A4 specification (210 x 297 mm). --------- line " ^^ (Please read the phonetic on the back? Matters before filling out this page) A7 470912 B7 -One ^ — 1 —One 丨 丨 _ 丨 — V. Description of the invention () In another device, such as the host computer 2 1 〇. At the same time, the present invention is not limited to a computer system with only one disk drive in multi-magnetic Disk drive system, disk controller 2 1 5 holds a controller command queue 220 and a pending load 218 for each of multiple disk drives. Therefore, the present invention is intended to include All alternatives, modifications and changes. !. !! ------ f (Please read the notes on the back before filling this page) Order ----
經濟部智慧財產局員工消費合作社印製 第15頁 本紙張尺度適用中國國家標準(CNS)A4規格(210 x 297公爱)Printed by the Employees' Cooperatives of the Intellectual Property Bureau of the Ministry of Economic Affairs Page 15 This paper size applies to China National Standard (CNS) A4 (210 x 297 public love)