SlideShare une entreprise Scribd logo
1  sur  27
SMP IMPLEMENTATION ON
       *BSD/MIPS
        syuu1228
∧ ∧
(    ω )      ≡
(     ≡
/         )
(/ ∪
MIPS


• MIPS

                RISC    

•
MIPS
•   SGI                                                  

•   DEC          NEC                                                 

•                               Windows CE
      NINTENDO64   PS     PS2    PSP
            

•   1999           RISC                      1/3 MIPS        

•          ARM
                                                                 
MIPS
                                               BSD
•                           BSD         MIPS         NetBSD
                           Mach                                    

•                 NetBSD 1.2 1996                    DECstation
           

•



    IIJ   SEIL   Juniper    JunOS    
MIPS SMP

•   MIPS SMP
       SGI


               SGI                    Linux/MIPS
                     BSD                            

•                          SoC


                                   
MIPS
•                                                                          

    •   Broadcom SiByte SB-1                       Cisco               

    •   Cavium Networks OCTEON
                                                                

    •                                     2010              

    •   RMI XLR Processor/XLS Processor

•           SONY    PSP                    PSP CPU R4000×2
            IO
BSD/MIPS         SMP

•         SGI                                BSD
    SMP

•   NetBSD                         Octane2
    64bit                  64bit
    BSD          OpenBSD              OpenBSD

•                CPU
SMP


• SMP         SMP



•
OCTANE2




•   CPU: R12000 400MHz 2MB L2 x 2

•   RAM: 1024MB

•   SCSI HDD

•   100BASE-T Ethernet
BSD/MIPS SMP

•   CPU              •

    MP
                     •

•
                     •   IPI

                     •
•

                     •         MP
•   MP     , mutex
                     •
CPU
                                 MP
•   CPU                            cpu_info

•                                              etc..

•   MIPS
    extern struct cpu_info cpu_info_primary;
    #define
 curcpu()
 (&cpu_info_primary)



•   CPU      cpu_info                      curcpu()
    MP
•

    volatile intrmask_t cpl;
    int splraise(int newcpl) {
           int oldcpl;
    
       __asm__ (" .set noreordern");
    
       oldcpl = cpl;
    
       cpl = oldcpl | newcpl;
    
       __asm__ (" syncn .set reordern");
    
       return (oldcpl);
    }

•   cpl cpu_info                →curcpu()->ci_cpl

•                                        (><;;
•

            →

•         cpu_info

•

    CPU

•
MP                                          ,
                          MUTEX
•


    •   spinlock

    •   atomic                        MIPS       LL/SC

    •


•   MUTEX

    •                             →

    •              mtx_enter(),              mtx_try_enter()

    •
•   Q:                 extern int cnt; cnt++;

•   A:
    r0←cnt
    r1←r0
    r2←r1 + 1
    r0           ←r2

•          CPU                  CPU

•

         LL/SC
LL/SC

r0←cnt
1:
r1←r0                     LL
r2←r1 + 1
r0                   ←r2 SC
if (!r0) goto 1
•   CPU




•
IPI

•

            cpu_unidle, signal, TLB shootdown

•

    IPI: Inter-Processor Interrupt

•
•


•


•


    •


    •




•       MP   CPU

•
MP
•




•

          →CPU                    TLB

•   TLB



•                →TLB Shootdown
'()*+,      -./01
      !"#$%&
      !!"#$%&'(&)*+,-.
       !"#$%&'(&)*+, .
      !2+345678

      !-./019:;<=
      >?@ABCD7E
      >?@ABCD7E+
      35FG+'0HI

      !-./019"J#
      $AB

      !K:;<5=>?             !"#$
                            !"#$%&
      L-./01/M              !!"#$%&'(&)*+,-.
                            !!"#$%&'(&)*+, .
      !"#$%&'/+!-!. 9NOP
      QRSTUC678V            2+34MY0678             !"#$
      WXI                   Z[OPQRSTU              !"#$%&
                            C678VWXI               !!"#$%&'(&)*+,-.

      2+34V                                       2+34MY0678
                                                   Z[OPQRSTU
                                                   C678VWXI
                                                   C    8VWXI
      2+345Y0678            !=>?AB@FG+             !=>?AB@FG+
                            bcde                   bcde
      "#$-]^@_9             !K:;<5=>?              !K:;<5=>?
      `a                    !!"#$%&'(&)*+!,-!0!1
                            !!"#$%&'(&)*+ ,- 0 1   !!"#$%&'(&)*+!,-!0!1
                                                       $ ' )*+
                            !"#$-]^@_9             !"#$-]^@_9
                            `a                     `a
fghi )G+j1k0Y^lmno                                                        0.
•


•




•




•


•   CPU
•


•




•


•


•

    →

•
•             VM             syuu1228
    BSD/MIPS SMP, Plan9, KVM, UNIX        etc...
          ,         http://bit.ly/67BvV

• KVM                    softlab
    KVM            , Intel-VT, AMD SVM,
              http://bit.ly/lTFlw
• P2PSIP

    OverlayWeaver, Genkidama, DHT, P2P,
        ,            : http://bit.ly/phIp4

•

                 ,                    ,      ,

Contenu connexe

En vedette

Risk Managers Presentation
Risk Managers PresentationRisk Managers Presentation
Risk Managers Presentationpat7777
 
Slayter on planning quant design for flc projects - may 2011
Slayter   on planning quant design for flc projects - may 2011Slayter   on planning quant design for flc projects - may 2011
Slayter on planning quant design for flc projects - may 2011Elspeth Slayter
 
Correlational study revise2. ppt
Correlational study revise2. pptCorrelational study revise2. ppt
Correlational study revise2. pptYalams
 
Arapski Brojevi
Arapski BrojeviArapski Brojevi
Arapski Brojeviverka 123
 
Permutation and combination
Permutation and combinationPermutation and combination
Permutation and combinationmanishkanwar
 
Spread the wealth: Learning for change across diverse organisations
Spread the wealth: Learning for change across diverse organisationsSpread the wealth: Learning for change across diverse organisations
Spread the wealth: Learning for change across diverse organisationsBrightwave Group
 
Oddziaływanie COŚ na środowisko
Oddziaływanie COŚ na środowiskoOddziaływanie COŚ na środowisko
Oddziaływanie COŚ na środowiskoEkokonsultacje
 
Digital Audio - Technical Writing Class Paper - OCR Reformat
Digital Audio - Technical Writing Class Paper - OCR ReformatDigital Audio - Technical Writing Class Paper - OCR Reformat
Digital Audio - Technical Writing Class Paper - OCR ReformatPaul Teich
 
What Advisors Do Online 2009
What Advisors Do Online 2009What Advisors Do Online 2009
What Advisors Do Online 2009kasina
 

En vedette (16)

Risk Managers Presentation
Risk Managers PresentationRisk Managers Presentation
Risk Managers Presentation
 
Slayter on planning quant design for flc projects - may 2011
Slayter   on planning quant design for flc projects - may 2011Slayter   on planning quant design for flc projects - may 2011
Slayter on planning quant design for flc projects - may 2011
 
Correlational study revise2. ppt
Correlational study revise2. pptCorrelational study revise2. ppt
Correlational study revise2. ppt
 
Arapski Brojevi
Arapski BrojeviArapski Brojevi
Arapski Brojevi
 
Permutation and combination
Permutation and combinationPermutation and combination
Permutation and combination
 
Spread the wealth: Learning for change across diverse organisations
Spread the wealth: Learning for change across diverse organisationsSpread the wealth: Learning for change across diverse organisations
Spread the wealth: Learning for change across diverse organisations
 
Kelly C. Ruggles
Kelly C. RugglesKelly C. Ruggles
Kelly C. Ruggles
 
Kelly Ruggles
Kelly RugglesKelly Ruggles
Kelly Ruggles
 
Kelly ruggles 2
Kelly ruggles 2Kelly ruggles 2
Kelly ruggles 2
 
Kelly Ruggles
Kelly RugglesKelly Ruggles
Kelly Ruggles
 
Kelly ruggles
Kelly rugglesKelly ruggles
Kelly ruggles
 
Oddziaływanie COŚ na środowisko
Oddziaływanie COŚ na środowiskoOddziaływanie COŚ na środowisko
Oddziaływanie COŚ na środowisko
 
Digital Audio - Technical Writing Class Paper - OCR Reformat
Digital Audio - Technical Writing Class Paper - OCR ReformatDigital Audio - Technical Writing Class Paper - OCR Reformat
Digital Audio - Technical Writing Class Paper - OCR Reformat
 
Kelly c.ruggles
Kelly c.rugglesKelly c.ruggles
Kelly c.ruggles
 
Kelly Ruggless
Kelly RugglessKelly Ruggless
Kelly Ruggless
 
What Advisors Do Online 2009
What Advisors Do Online 2009What Advisors Do Online 2009
What Advisors Do Online 2009
 

Plus de Takuya ASADA

Seastar in 歌舞伎座.tech#8「C++初心者会」
Seastar in 歌舞伎座.tech#8「C++初心者会」Seastar in 歌舞伎座.tech#8「C++初心者会」
Seastar in 歌舞伎座.tech#8「C++初心者会」Takuya ASADA
 
Seastar:高スループットなサーバアプリケーションの為の新しいフレームワーク
Seastar:高スループットなサーバアプリケーションの為の新しいフレームワークSeastar:高スループットなサーバアプリケーションの為の新しいフレームワーク
Seastar:高スループットなサーバアプリケーションの為の新しいフレームワークTakuya ASADA
 
高スループットなサーバアプリケーションの為の新しいフレームワーク
「Seastar」
高スループットなサーバアプリケーションの為の新しいフレームワーク
「Seastar」高スループットなサーバアプリケーションの為の新しいフレームワーク
「Seastar」
高スループットなサーバアプリケーションの為の新しいフレームワーク
「Seastar」Takuya ASADA
 
ヤマノススメ〜秋山郷 de ハッカソン〜
ヤマノススメ〜秋山郷 de ハッカソン〜ヤマノススメ〜秋山郷 de ハッカソン〜
ヤマノススメ〜秋山郷 de ハッカソン〜Takuya ASADA
 
UEFI時代のブートローダ
UEFI時代のブートローダUEFI時代のブートローダ
UEFI時代のブートローダTakuya ASADA
 
OSvのご紹介 in 
Java 8 HotSpot meeting
OSvのご紹介 in 
Java 8 HotSpot meetingOSvのご紹介 in 
Java 8 HotSpot meeting
OSvのご紹介 in 
Java 8 HotSpot meetingTakuya ASADA
 
OSvパンフレット v3
OSvパンフレット v3OSvパンフレット v3
OSvパンフレット v3Takuya ASADA
 
OSvのご紹介 in OSC2014 Tokyo/Fall
OSvのご紹介 in OSC2014 Tokyo/FallOSvのご紹介 in OSC2014 Tokyo/Fall
OSvのご紹介 in OSC2014 Tokyo/FallTakuya ASADA
 
OSvの概要と実装
OSvの概要と実装OSvの概要と実装
OSvの概要と実装Takuya ASADA
 
Linux network stack
Linux network stackLinux network stack
Linux network stackTakuya ASADA
 
Ethernetの受信処理
Ethernetの受信処理Ethernetの受信処理
Ethernetの受信処理Takuya ASADA
 
Presentation on your terminal
Presentation on your terminalPresentation on your terminal
Presentation on your terminalTakuya ASADA
 
僕のIntel nucが起動しないわけがない
僕のIntel nucが起動しないわけがない僕のIntel nucが起動しないわけがない
僕のIntel nucが起動しないわけがないTakuya ASADA
 
Interrupt Affinityについて
Interrupt AffinityについてInterrupt Affinityについて
Interrupt AffinityについてTakuya ASADA
 
OSvパンフレット
OSvパンフレットOSvパンフレット
OSvパンフレットTakuya ASADA
 
BHyVeでOSvを起動したい
〜BIOSがなくてもこの先生きのこるには〜
BHyVeでOSvを起動したい
〜BIOSがなくてもこの先生きのこるには〜BHyVeでOSvを起動したい
〜BIOSがなくてもこの先生きのこるには〜
BHyVeでOSvを起動したい
〜BIOSがなくてもこの先生きのこるには〜Takuya ASADA
 
「ハイパーバイザの作り方」読書会#2
「ハイパーバイザの作り方」読書会#2「ハイパーバイザの作り方」読書会#2
「ハイパーバイザの作り方」読書会#2Takuya ASADA
 
「ハイパーバイザの作り方」読書会#1
「ハイパーバイザの作り方」読書会#1「ハイパーバイザの作り方」読書会#1
「ハイパーバイザの作り方」読書会#1Takuya ASADA
 
10GbE時代のネットワークI/O高速化
10GbE時代のネットワークI/O高速化10GbE時代のネットワークI/O高速化
10GbE時代のネットワークI/O高速化Takuya ASADA
 

Plus de Takuya ASADA (20)

Seastar in 歌舞伎座.tech#8「C++初心者会」
Seastar in 歌舞伎座.tech#8「C++初心者会」Seastar in 歌舞伎座.tech#8「C++初心者会」
Seastar in 歌舞伎座.tech#8「C++初心者会」
 
Seastar:高スループットなサーバアプリケーションの為の新しいフレームワーク
Seastar:高スループットなサーバアプリケーションの為の新しいフレームワークSeastar:高スループットなサーバアプリケーションの為の新しいフレームワーク
Seastar:高スループットなサーバアプリケーションの為の新しいフレームワーク
 
高スループットなサーバアプリケーションの為の新しいフレームワーク
「Seastar」
高スループットなサーバアプリケーションの為の新しいフレームワーク
「Seastar」高スループットなサーバアプリケーションの為の新しいフレームワーク
「Seastar」
高スループットなサーバアプリケーションの為の新しいフレームワーク
「Seastar」
 
ヤマノススメ〜秋山郷 de ハッカソン〜
ヤマノススメ〜秋山郷 de ハッカソン〜ヤマノススメ〜秋山郷 de ハッカソン〜
ヤマノススメ〜秋山郷 de ハッカソン〜
 
UEFI時代のブートローダ
UEFI時代のブートローダUEFI時代のブートローダ
UEFI時代のブートローダ
 
OSvのご紹介 in 
Java 8 HotSpot meeting
OSvのご紹介 in 
Java 8 HotSpot meetingOSvのご紹介 in 
Java 8 HotSpot meeting
OSvのご紹介 in 
Java 8 HotSpot meeting
 
OSvパンフレット v3
OSvパンフレット v3OSvパンフレット v3
OSvパンフレット v3
 
OSvのご紹介 in OSC2014 Tokyo/Fall
OSvのご紹介 in OSC2014 Tokyo/FallOSvのご紹介 in OSC2014 Tokyo/Fall
OSvのご紹介 in OSC2014 Tokyo/Fall
 
OSv噺
OSv噺OSv噺
OSv噺
 
OSvの概要と実装
OSvの概要と実装OSvの概要と実装
OSvの概要と実装
 
Linux network stack
Linux network stackLinux network stack
Linux network stack
 
Ethernetの受信処理
Ethernetの受信処理Ethernetの受信処理
Ethernetの受信処理
 
Presentation on your terminal
Presentation on your terminalPresentation on your terminal
Presentation on your terminal
 
僕のIntel nucが起動しないわけがない
僕のIntel nucが起動しないわけがない僕のIntel nucが起動しないわけがない
僕のIntel nucが起動しないわけがない
 
Interrupt Affinityについて
Interrupt AffinityについてInterrupt Affinityについて
Interrupt Affinityについて
 
OSvパンフレット
OSvパンフレットOSvパンフレット
OSvパンフレット
 
BHyVeでOSvを起動したい
〜BIOSがなくてもこの先生きのこるには〜
BHyVeでOSvを起動したい
〜BIOSがなくてもこの先生きのこるには〜BHyVeでOSvを起動したい
〜BIOSがなくてもこの先生きのこるには〜
BHyVeでOSvを起動したい
〜BIOSがなくてもこの先生きのこるには〜
 
「ハイパーバイザの作り方」読書会#2
「ハイパーバイザの作り方」読書会#2「ハイパーバイザの作り方」読書会#2
「ハイパーバイザの作り方」読書会#2
 
「ハイパーバイザの作り方」読書会#1
「ハイパーバイザの作り方」読書会#1「ハイパーバイザの作り方」読書会#1
「ハイパーバイザの作り方」読書会#1
 
10GbE時代のネットワークI/O高速化
10GbE時代のネットワークI/O高速化10GbE時代のネットワークI/O高速化
10GbE時代のネットワークI/O高速化
 

SMP Implementation on *BSD/MIPS

  • 1. SMP IMPLEMENTATION ON *BSD/MIPS syuu1228
  • 2. ∧ ∧ ( ω ) ≡ ( ≡ / ) (/ ∪
  • 3. MIPS • MIPS RISC   •
  • 4. MIPS • SGI   • DEC NEC   • Windows CE NINTENDO64 PS PS2 PSP   • 1999 RISC 1/3 MIPS   • ARM  
  • 5. MIPS BSD • BSD MIPS NetBSD Mach   • NetBSD 1.2 1996 DECstation   • IIJ SEIL Juniper JunOS  
  • 6. MIPS SMP • MIPS SMP SGI SGI Linux/MIPS BSD   • SoC   
  • 7. MIPS •   • Broadcom SiByte SB-1 Cisco   • Cavium Networks OCTEON   • 2010   • RMI XLR Processor/XLS Processor • SONY PSP PSP CPU R4000×2 IO
  • 8. BSD/MIPS SMP • SGI BSD SMP • NetBSD Octane2 64bit 64bit BSD OpenBSD OpenBSD • CPU
  • 9. SMP • SMP SMP •
  • 10. OCTANE2 • CPU: R12000 400MHz 2MB L2 x 2 • RAM: 1024MB • SCSI HDD • 100BASE-T Ethernet
  • 11. BSD/MIPS SMP • CPU • MP • • • IPI • • • MP • MP , mutex •
  • 12. CPU MP • CPU cpu_info • etc.. • MIPS extern struct cpu_info cpu_info_primary; #define curcpu() (&cpu_info_primary) • CPU cpu_info curcpu() MP
  • 13. volatile intrmask_t cpl; int splraise(int newcpl) { int oldcpl; __asm__ (" .set noreordern"); oldcpl = cpl; cpl = oldcpl | newcpl; __asm__ (" syncn .set reordern"); return (oldcpl); } • cpl cpu_info →curcpu()->ci_cpl • (><;;
  • 14. → • cpu_info • CPU •
  • 15. MP , MUTEX • • spinlock • atomic MIPS LL/SC • • MUTEX • → • mtx_enter(), mtx_try_enter() •
  • 16. Q: extern int cnt; cnt++; • A: r0←cnt r1←r0 r2←r1 + 1 r0 ←r2 • CPU CPU • LL/SC
  • 17. LL/SC r0←cnt 1: r1←r0 LL r2←r1 + 1 r0 ←r2 SC if (!r0) goto 1
  • 18. CPU •
  • 19. IPI • cpu_unidle, signal, TLB shootdown • IPI: Inter-Processor Interrupt •
  • 20. • • • • • • MP CPU •
  • 21. MP • • →CPU TLB • TLB • →TLB Shootdown
  • 22. '()*+, -./01 !"#$%& !!"#$%&'(&)*+,-. !"#$%&'(&)*+, . !2+345678 !-./019:;<= >?@ABCD7E >?@ABCD7E+ 35FG+'0HI !-./019"J# $AB !K:;<5=>? !"#$ !"#$%& L-./01/M !!"#$%&'(&)*+,-. !!"#$%&'(&)*+, . !"#$%&'/+!-!. 9NOP QRSTUC678V 2+34MY0678 !"#$ WXI Z[OPQRSTU !"#$%& C678VWXI !!"#$%&'(&)*+,-. 2+34V 2+34MY0678 Z[OPQRSTU C678VWXI C 8VWXI 2+345Y0678 !=>?AB@FG+ !=>?AB@FG+ bcde bcde "#$-]^@_9 !K:;<5=>? !K:;<5=>? `a !!"#$%&'(&)*+!,-!0!1 !!"#$%&'(&)*+ ,- 0 1 !!"#$%&'(&)*+!,-!0!1 $ ' )*+ !"#$-]^@_9 !"#$-]^@_9 `a `a fghi )G+j1k0Y^lmno 0.
  • 25.
  • 26. VM syuu1228 BSD/MIPS SMP, Plan9, KVM, UNIX etc... , http://bit.ly/67BvV • KVM softlab KVM , Intel-VT, AMD SVM, http://bit.ly/lTFlw
  • 27. • P2PSIP OverlayWeaver, Genkidama, DHT, P2P, , : http://bit.ly/phIp4 • , , ,