Ағылшыншамен салыстырыңыз: абзацты басыңыз — түпнұсқа терезеде ашылады. Абзац астындағы EN түймесі оны мәтін ішінде көрсетеді.
Мазмұны
Кіріспе
Кэштік үйлесімділік протоколы MSI протоколының кеңейтілуі ретінде Меншік күйін қамтиды. MOSI протоколы негізгі MSI кэштік үйлесімділік протоколының кеңейтілуі болып табылады. Ол Меншік күйін қосады, бұл күй ағымдағы процессордың осы блокқа ие екенін және басқа процессорлардың осы блок бойынша сұрауларын өтеуге дайын екенін көрсетеді.
Cache coherence protocol, includes an Owned state as an extension of the MSI protocol. The MOSI protocol is an extension of the basic MSI cache coherency protocol. It adds the Owned state, which indicates that the current processor owns this block, and will service requests from other processors for the block.
Процессорлық операциялар
Процессор транзакцияларын қарастыра отырып, егер блок жарамсыз (I) күйде болса, онда кэш блогы жадтан ешқашан алынбаған немесе жарамсыз деп белгіленген. Процессор оқыған кезде (PrRd) күйі жарамсыз (I) күйінен ортақ (S) күйіне өтеді, соның нәтижесінде шина арқылы оқылу (BusRd) жүзеге асырылады. Сонымен қатар, егер процессордан жазу сұранысы (PrWr) келіп түссе, блок күйі өзгертілген (M) күйіне ауысады және тыңшы жазу сұранысы (BusRdX) жасалады. Блок иеленген (O) күйде болғаннан кейін, процессор оқуы (PrRd) ешқандай тыңшы сигналды тудырмайды және блок сол күйде қалады. Ал процессордан (PrWr) жазу сұранысы блоктың күйін иеленгеннен (O) өзгертілгенге (M) ауыстырады, сонымен бірге тыңшы жазу сұранысын (BusUpgr) тудырады. Блок өзгертілген (M) күйде болғанда, процессор оқуы (PrRd) немесе процессор жазуы (PrWr) сұранысы тыңшы сигналды тудырмайды, себебі блок ең соңғы және дұрыс мәннің тек осы кэште сақталғанын көрсетеді. Сондықтан ол күйін өзгертпейді және өзгертілген (M) күйінде қалады. Блок ортақ (S) күйде болғанда және процессор оқу (PrRd) сұранысы келіп түссе, кэш блогының мәні басқа процессорларда да, негізгі жадта да бірдей болғандықтан, процессор оқуынан (PrRd) кейін шиналық сигнал жасалмайды. Блок ортақ (S) күйде процессордан жазу (PrWr) сұранысы түскен кезде шина жазу сұранысы (BusUpgr) жасалады, себебі кэш блогы енді басқа кэштерде жарамсыз болып табылады және блок күйі ортақ (S) күйінен өзгертілген (M) күйіне ауысады.
Looking at the case for processor transactions, when the block is in the Invalid (I) state, either the cache block was never fetched from the memory or it was invalidated. When there is a processor read (PrRd), the state changes from invalid (I) to shared (S), thereby generating a bus read (BusRd). At the same time, if it is a processor write request (PrWr), then the state of the block changes to modified (M) along with a snooped write request (BusRdX). Once the block is in the Owned (O) state, then a processor read (PrRd) does not generate any snooped signal and the block remains in the same state. Whereas, a write request from the processor (PrWr) results in changing the state of the block from owned (O) to modified (M) along with generating a snooped write request (BusUpgr). When the block is in the Modified (M) state, neither a processor read (PrRd) nor a processor write (PrWr) request generates a snooped signal since the block already indicates that the most recent and correct value resides only in that cache. Hence, it does not change the state and stays in modified (M) state. While the block is in the Shared (S) state and there is processor read (PrRd) request, since the value of the cache block is the same in every other processor and in the main memory, there is no bus signal that is generated after a processor read (PrRd). A bus write request (BusUpgr) is generated once there is a processor write (PrWr) request to a block in the shared (S) state because the cache block is now no longer valid in all the other caches and the state of the block changes from shared (S) to being modified (M).
Автобустармен жасалатын операциялар
Шекті күй машинасының тыңдалған автобус транзакцияларына қатысты мінез-құлқы ескерілсе, егер кэш блогы жарамсыз (I) күйде болса, тыңдалған автобус сұранысы осы блокқа ешқандай әсер етпейді. Сондықтан, процессордан келген автобус оқу сұранысы (BusRd) немесе блокқа ие болған немесе болмаған процессордан келген автобус жазу сұранысы (BusRdX немесе BusUpgr) болса да, блок сол жарамсыз (I) күйде қалады және қосымша әрекеттер жасалмайды. Кэш блогы ортақ (S) күйде болғанда және тыңдалған автобус оқу (BusRd) транзакциясы орын алғанда, блок сол күйде қалады және қосымша транзакциялар жасалмайды, себебі барлық кэш блоктарының мәні, негізгі жад мәнімен қоса, бірдей болады және тек оқу операциясы жүзеге асырылады, жазу емес. Егер жазу сұранысы (BusRdX немесе BusUpgr) келіп түссе, блок күйі ортақ (S) күйден жарамсыз (I) күйіне өтеді, себебі блок мәні басқа кэш блоктарының бірінде өзгертілген және барлық басқа көшірмелер енді жарамсыз болуы керек. Кэш блогы өзгертілген (M) күйде болғанда және автобус оқу (BusRd) сұранысы келіп түссе, блок өзгертілген деректерді (Flush) тазартады және күйін иеленуші (O) күйіне ауыстырады, осылайша осы нақты кэш блогының жалғыз иесі болады. Сонымен қатар, егер блок өзгертілген (M) күйде болса, басқа процессордан автобус жазу сұранысы (BusUpgr) келе қоймайды, себебі оның кэш блогы жоқ. Егер блокқа ие емес басқа процессордан жазу сұранысы (BusRdX) келіп түссе, блок күйін жарамсыз (I) күйіне өзгертеді, себебі басқа процессор блокқа жазады және осылайша осы блокқа меншік құқығына ие болады. Кэш блогы өзгертілген күйде болғанда, басқа процессордан BusUpgr сұранысы келуі мүмкін емес, себебі олардың ешқайсысында блок жоқ. Өзгертілген (M) күйінің анықтамасы бойынша, тек сол процессор ғана блокқа ие, ал қалғандары жарамсыз, сондықтан BusUpgr сұранысын бастай алмайды. Иеленуші (O) күйде болғанда және оқып алу сұранысы (BusRd) келіп түссе, блок сол күйде қалады, ал басқа процессор оқып алу үшін деректерді (Flush) тазартады. Snooped жазу сұранысы (BusRdX) кезінде блок күйін жарамсыз (I) күйіне өзгертеді, сонымен бірге басқа процессор оған жазып жатқан деректерді (Flush) тазартады, осылайша ол блокқа меншік құқығын жоғалтады. Басқа процессор сол блокқа қол жеткізуге тырысқанда, оған қол жеткізу үшін жадқа барудың орнына, процессор оны басқа кэштен алады, ол блокқа иеленуші (O) күйде. BusUpgr сұранысы иеленуші (O) күйін жарамсыз (I) күйіне өзгертеді. MOSI протоколында өзгертілген (M) күйінен басқа қосымша күйдің (иеленуші) болуы ерекшелік. MSI протоколында, өзгертілген (M) күйдегі блокты оқудан қайтпау сұранысы келіп түссе, ол блоктің мәртебесін ортақ (S) күйіне өзгерте отырып, негізгі жадыға қайта жазады. Бірақ MOSI протоколында, қосымша күй (иесі) болғандықтан, басқа процессор оқу операциясын сұрағанда, блок өзгертілгеннен иеленуші (O) күйіне ауысады және кэштің кір блогын сақтайды, осылайша басты жадыға дереу жазу қажеттілігін жояды. Бұл кейінге қалдыру автобустық трафикті және негізгі жадының транзакциялардың белгілі бір ретімен жазылуын үнемдей алады. Мысалы, егер кэш 1-процессор үшін M күйде болса, онда 2-процессор одан оқиды, содан кейін 1-процессор оған қайта жазады. MSI протоколында 1-процессордың MS күйіне өтуі оқудан бір жадқа жазуға, содан кейін SM күйіне өтуі BusUpgr сұранысына әкеледі. MOSI протоколында MO күйіне өту трафикті тудырмайды, ал OM күйіне өту бұрынғыдай бір BusUpgr сұранысын тудырады. Сондықтан MOSI бастапқы жадына жазуды және оған байланысты автобустық трафикті MSI орындайтын.
Considering the behavior of the finite state machine to snooped bus transactions, if the cache block is in Invalid (I) state then no snooped bus request will affect the block in any way, so even if it is a bus read (BusRd) or bus write request from a processor that has or does not have the block (BusRdX or BusUpgr), the block remains in the same invalid (I) state and does not generate any further actions. When the cache block is in the Shared (S) state and there is a snooped bus read (BusRd) transaction, then the block stays in the same state and generates no more transactions as all the cache blocks have the same value including the main memory and it is only being read, not written into. If there is snooped write request (BusRdX or BusUpgr), then the state of the block changes from shared (S) to invalid (I) as the value of the block has been modified in one of the other cache blocks and all the other copies now must be invalidated. Once the cache block is in the Modified (M) state and there is a bus read (BusRd) request, the block flushes (Flush) the modified data and changes the state to owned (O), thus making it the sole owner for that particular cache block. At the same time, when it is in the modified (M) state, there is never going to be a bus write request (BusUpgr) from another processor as it does not have the cache block. With a write request from another processor that doesn't have the block (BusRdX), the block changes its state to invalid (I) as another processor is writing to the block and hence will have the ownership for that block. While a cache block is in the modified state, there is no possibility of a BusUpgr request from any other processor as none of them will have the block. By the definition of the modified (M) state, only that processor has the block, rest all are invalidated and hence cannot initiate a BusUpgr request. While in the Owner (O) state and there is a snooped read request (BusRd), the block remains in the same state while flushing (Flush) the data for the other processor to read from it. With a snooped write request (BusRdX), the block changes state to invalid (I) along with flushing (Flush) the data as another processor is writing to it, thereby losing its ownership on that block. Whenever another processor tries to access that block, instead of going to the memory to access it, the processor takes it from other cache which already has that block in the owned (O) state. With a BusUpgr, it just changes the state from owner (O) to invalid (I). is the presence of an extra state (owned) in MOSI in addition to having just a modified (M) state. In the MSI protocol, whenever there is a read miss request to block which is in the modified (M) state, it writes back to the main memory while changing the status of the block to shared (S). But in the case of MOSI protocol, where we have an additional state (owner), whenever another processor requests for a read operation, the block changes from modified to the owned (O) state and so retains the dirty block of cache, thereby removing the need to write back to the main memory immediately. This deferral can save bus traffic and main memory writes in certain sequences of transactions. Consider for example if a cache is M for processor 1, then processor 2 reads from it, and then processor 1 writes again to it. In MSI, the MS transition of processor 1 from the read leads to one memory write, and then the SM transition leads to a BusUpgr. On MOSI, the MO transition generates no traffic, and the OM transition also generates one BusUpgr as before. MOSI therefore dispensed the initial memory write back and associated bus traffic which MSI would do.
MESI протоколымен салыстыру
MESI (сондай-ақ Иллинойс деп те аталады) және MOSI протоколдары – әр түрлі мүмкіндіктерді жақсарту мақсатында MSI протоколының кеңейтілген нұсқалары. MOSI деректерді қайта жазуды азайтуға бағытталса, MESI басқа процессордан оқу және жазу сұранысынан кейін қажетті автобус транзакцияларының санын азайтуға тырысады. MESI протоколындағы «эксклюзивті» (E) күй кэш блогының жарамды, таза (негізгі жадтағы мәнмен сәйкес) және тек бір кэште сақталғанын көрсетеді, ал MOSI протоколындағы «меншікті» (O) күй кэш блогының жарамды, мүмкін кір, жазуға болатын және бірнеше кэште (барлық кэштерде мән бірдей) болуы мүмкін екенін білдіреді.
Both MESI (also known as Illinois) and MOSI protocols, are extensions of the MSI protocol to improve different functionalities. MOSI focuses on reducing write backs and MESI attempts to reduce the number of bus transactions required after a read and write request from another processor. The exclusive (E) state in MESI protocol implies that the cache block is valid, clean (same value as in the main memory) and cached only in one cache whereas the owned (O) state in MOSI protocol implies that the cache block is valid, potentially dirty, writable and could be present in more than one cache (all caches have the same value).