講解AIX系統(tǒng)并行多線程知識(shí)
今天,我們來(lái)學(xué)習(xí)AIX系統(tǒng)的知識(shí)。前環(huán)境的可用 CPU 資源以后,可以對(duì)AIX系統(tǒng)監(jiān)控的對(duì)象和方法進(jìn)行規(guī)劃。多數(shù)情況下,操作系統(tǒng)提供的命令輸出提供邏輯處理器 (Logical CPU) 的信息。
在 IBM eServer pSeries 服務(wù)器和 BladeCenter JS 刀片服務(wù)器中,邏輯處理器通常通過(guò)并行多線程技術(shù)實(shí)現(xiàn)。下文是對(duì)該技術(shù)在 AIX系統(tǒng)中應(yīng)用的介紹。
AIX系統(tǒng)并行多線程的查詢和設(shè)置
并行多線程 (Simultaneous Multi-threading,簡(jiǎn)稱 SMT) 是一種基于超標(biāo)量 (superscalar) 體系結(jié)構(gòu)處理器的技術(shù),允許多個(gè)獨(dú)立的線程在一個(gè)時(shí)鐘周期內(nèi)對(duì)多個(gè)功能處理單元 (Functional Unit) 發(fā)出指令。
通常情況下,AIX系統(tǒng)線程和功能處理單元的綁定是完全動(dòng)態(tài)的。使用這項(xiàng)技術(shù)可以較明顯的提高處理器的的實(shí)際利用率,進(jìn)而表現(xiàn)出更強(qiáng)的運(yùn)算性能。在 AIX 操作系統(tǒng)上,我們可以通過(guò) smtctl 命令來(lái)查詢和設(shè)置并行多線程的運(yùn)行狀態(tài)。
清單 5. 運(yùn)行 smtctl 查詢處理器對(duì) SMT 技術(shù)的支持和當(dāng)前的設(shè)置
- $ smtctl
- This system is SMT capable.
- SMT is currently enabled.
- SMT boot mode is not set.
- SMT threads are bound to the same physical processor.
- proc0 has 2 SMT threads.
- Bind processor 0 is bound with proc0
- Bind processor 1 is bound with proc0
- proc2 has 2 SMT threads.
- Bind processor 2 is bound with proc2
- Bind processor 3 is bound with proc2
- proc4 has 2 SMT threads.
- Bind processor 4 is bound with proc4
- Bind processor 5 is bound with proc4
- proc6 has 2 SMT threads.
- Bind processor 6 is bound with proc6
- Bind processor 7 is bound with proc6
命令的結(jié)果說(shuō)明了當(dāng)前AIX系統(tǒng)支持 SMT 技術(shù),而且當(dāng)前正在使用。后面的多行輸出中詳細(xì)說(shuō)明了邏輯處理器和虛擬處理器之間的對(duì)應(yīng)關(guān)系。系統(tǒng)中有四個(gè)可用的虛擬處理器 (Virtual CPU),因?yàn)殚_(kāi)啟了 SMT (Simultaneous MultiThreading) 功能,可以識(shí)別出八個(gè)邏輯上的虛擬處理器 (Logical CPU)。
在缺省情況下,AIX系統(tǒng)中的 SMT 應(yīng)被使用以增強(qiáng)性能。當(dāng)用戶需要調(diào)整系統(tǒng)的 SMT 設(shè)置時(shí),同樣可以使用 smtctl 命令。具體參數(shù)請(qǐng)查閱命令說(shuō)明。在負(fù)載分區(qū)情況下,SMT 設(shè)置不允許被直接修改。
用戶需要對(duì)負(fù)載分區(qū)的宿主機(jī)修改 SMT 配置,這會(huì)對(duì)AIX系統(tǒng)中的所有負(fù)載分區(qū)生效。而在微分區(qū)環(huán)境下,用戶可以自主調(diào)整并行多線程的配置。
【編輯推薦】