numa

NUMA(7)                    Linux Programmer's Manual                   NUMA(7)



åå
       numa - é対称åã¡ã¢ãªã¼ã¢ã¼ããã¯ãã£ã¼ã®æ¦è¦

説æ
       é対称åã¡ã¢ãªã¼ã¢ã¯ã»ã¹ (Non-Uniform Memory Access; NUMA) ã¯ã
       ã¡ã¢ãªã¼ãè¤æ°ã®ã¡ã¢ãªã¼ãã¼ãã«åå²ããã¦ãããã«ãããã»ããµã·ã¹ãã
       ã®ãã¨ã§ãããã¡ã¢ãªã¼ãã¼ãã¸ã®ã¢ã¯ã»ã¹æéã¯ãã¢ã¯ã»ã¹åã® CPU ã¨
       ã¢ã¯ã»ã¹åã®ãã¼ãã®ç¸å¯¾çãªä½ç½®é¢ä¿ã«ä¾åãã (ããã«å¯¾ãã対称åãã«ããã‐
       ã»ããµã·ã¹ãã ã§ã¯ãã©ã® CPU ãã ã©ã®ã¡ã¢ãªã¼ã¸ã®ã¢ã¯ã»ã¹æéãåãã§ãã)ã
       é常ã¯ã NUMA ã·ã¹ãã ã®å CPU ã«ã¯ãã¼ã«ã«ã®ã¡ã¢ãªã¼ãã¼ããããã
       ãã®ã¡ã¢ãªã¼ãã¼ãã«ã¯ãä»ã® CPU ã®ãã¼ã«ã«ãã¼ããå¨ã¦ã® CPU ã§
       å±æããããã¹ä¸ã®ã¡ã¢ãªã¼ãããæ©ãã¢ã¯ã»ã¹ãããã¨ãã§ããã

   NUMA ã·ã¹ãã ã³ã¼ã«
       Linux ã«ã¼ãã«ã«ã¯ã次ã«ç¤ºã NUMA é¢é£ã®ã·ã¹ãã ã³ã¼ã«ãå®è£ããã¦ãã:
       get_mempolicy(2), mbind(2), migrate_pages(2), move_pages(2),
       set_mempolicy(2).  ãã ããã¢ããªã±ã¼ã·ã§ã³ã¯é常㯠libnuma
       ãæä¾ããã¤ã³ã¿ã¼ãã§ã¼ã¹ ã使ç¨ãã¹ãã§ãããä¸è¨ã®ãã©ã¤ãã©ãªã«ãããµãã¼ãããåç§ã

   /proc/[number]/numa_maps (Linux 2.6.14 以é)
       ãã®ãã¡ã¤ã«ã¯ãããã»ã¹ã® NUMA ã¡ã¢ãªã¼ããªã·ã¼ã¨å²ãå½ã¦ã«é¢ãã
       æå ±ã表示ããã

       åè¡ã«ããã®ããã»ã¹ã使ç¨ãã¦ããã¡ã¢ãªã¼é åã«é¢ããæå ±ã表示ãããããã®ä»ã®æå ± —
       ãã®ã¡ã¢ãªã¼é åã«é©ç¨ããã¦ããã¡ã¢ãªã¼ããªã·ã¼ãããã®ãã¼ã¸ãã©ã®ãã¼ãä¸ã«å²ãå½ã¦ããã¦ãããããªã©
       — ããããã¦è¡¨ç¤ºãããã

       numa_maps ã¯èªã¿åºãå°ç¨ã®ãã¡ã¤ã«ã§ããã /proc/<pid>/numa_maps ããèª‐
       ã¿åºããè¡ãããã¨ã ã«ã¼ãã«ã¯ãã®ããã»ã¹ã®ä»®æ³ã¢ãã¬ã¹ç©ºéãã¹ãã£ã³ãã
       ã¡ã¢ãªã¼ã®ä½¿ç¨ç¶æ³ãå ±åããã ããã»ã¹ã®ã¡ã¢ãªã¼é åã®æå ±ã 1 è¡ã« 1
       é åã§è¡¨ç¤ºãããã

       åè¡ã®æåã®ãã£ã¼ã«ãã¯ã¡ã¢ãªã¼é åã®éå§ã¢ãã¬ã¹ã示ãã ãã®ãã£ã¼ã«ãã¯
       /proc/<pid>/maps ãã¡ã¤ã«ã®å容ã¨å¯¾å¿ãã¦ããã /proc/<pid>/maps
       ã«ã¯ãã¡ã¢ãªã¼é åã®æ«å°¾ã®ã¢ãã¬ã¹ããã¢ã¯ã»ã¹è¨±å¯ãå±æã¨ãã£ãä»ã®æå ±ãå«ã¾ããã

       2 çªç®ã®ãã£ã¼ã«ãã¯ã ãã®ã¡ã¢ãªã¼é åã«ç¾å¨é©ç¨ããã¦ããã¡ã¢ãªã¼ããªã·ã¼ã示ãã
       é©ç¨ããã¦ããããªã·ã¼ã¯ã å¿ããããã®ããã»ã¹ããã®ã¡ã¢ãªã¼é åã«å¯¾ãã¦è¨‐
       å®ããããªã·ã¼ã¨ã¯éããªãç¹ã«æ³¨æãããã¨ã ç¹ã«ã ãã‐
       ã»ã¹ããã®é åã«å¯¾ãã¦ãããã©ã«ããããªã·ã¼ãè¨‐
       å®ããå ´åããã®é åã«é©ç¨ãããããªã·ã¼ã¯ãã‐
       ã»ã¹ã®ããªã·ã¼ã¨ãªããããããããã©ã«ããããªã·ã¼ã¨ãªãå ´åãããã°ããã§ãªãå ´åãããã

       è¡ã®æ®ãã®é¨åã«ã¯ããã®ã¡ã¢ãªã¼é åã«å²ãå½ã¦ããããã¼ã¸ã«é¢ããæå ±ãå¥ãã以ä¸ã«è©³ç´°ã示ãã

       N<node>=<nr_pages>
              <node> ã«å²ãå½ã¦ããã¦ãããã¼ã¸æ°ã <nr_pages> ã«ã¯ã ãã®ãã‐
              ã»ã¹ãç¾å¨ãããã³ã°ãã¦ãããã¼ã¸ã ããå«ã¾ããã
              ãã¼ã¸ã®ç§»åãã¡ã¢ãªã¼ã®åå©ç¨ã«ããã ãã®ã¡ã¢ãªã¼é åã«é¢é£ä»ãããã¦ãããã
              ä¸æçã«ãããã³ã°ããã¦ããªããã¼ã¸ãåå¨ããå ´åãããã ãã‐
              ã»ã¹ããããã®ãã¼ã¸ãåç§ãããã¨ããå¾ã«ã¯ã ãããã®ãã¼ã¸ã¯åã³ç¾ããå¯è½æ§ãããã
              ã¡ã¢ãªã¼é åãå±æã¡ã¢ãªã¼ããã¡ã¤ã«ãããã³ã°ã®å ´åã«ã¯ã
              ãã®ã¡ã¢ãªã¼é ååã«å¥ã®ãã¼ã¸ãä»ã®ããã»ã¹ããããã³ã°ãã¦ããå ´åãããã

       file=<filename>
              ãã®ã¡ã¢ãªã¼é åã«é¢é£ä»ãããã¦ãããã¡ã¤ã«ã ãã¡ã¤ã«ããã©ã¤ãã¼ã (éå¬é)
              ã§ãããã³ã°ããã¦ããå ´åã æ¸ãè¾¼ã¿ã¢ã¯ã»ã¹ãããã¨ã
              ãã®ã¡ã¢ãªã¼é åã«æ¸ãè¾¼ã¿æã³ãã¼ (Copy-On-Write)
              ãã¼ã¸ãçæããããã¨ãããã ãããã®ãã¼ã¸ã¯ç¡åãã¼ã¸ (anonymous page)
              ã¨ãã¦è¡¨ç¤ºãããã

       heap   ãã¼ãã«ä½¿ç¨ããã¦ããã¡ã¢ãªã¼ç¯å²ã

       stack  ã¹ã¿ãã¯ã«ä½¿ç¨ããã¦ããã¡ã¢ãªã¼ç¯å²ã

       huge   ãã¥ã¼ã¸ã¡ã¢ãªã¼ã®ç¯å²ã表示ããããã¼ã¸æ°ã¯ã
              é常ã®å¤§ããã®ãã¼ã¸ã§ã¯ãªãããã¥ã¼ã¸ãã¼ã¸ã®æ°ã§ããã

       anon=<pages>
              ã¡ã¢ãªã¼ç¯å²åã®ç¡åãã¼ã¸ (anonymous page) ã®æ°ã

       dirty=<pages>
              dirty (å¤æ´ããã) ãã¼ã¸ã®æ°ã

       mapped=<pages>
              ãããã³ã°ããã¦ãããã¼ã¸æ°ã dirty ããã³ anon
              ã®ãã¼ã¸æ°ã¨ç°ãªãå¤ã®å ´åã«è¡¨ç¤ºãããã

       mapmax=<count>
              ã¹ãã£ã³ä¸ã«æ¤åºãã mapcount (ä¸ã¤ã®ãã¼ã¸ããããã³ã°ãã¦ããããã»ã¹æ°)
              ã®æ大å¤ã ãã®å¤ã¯ã
              ãã®ã¡ã¢ãªã¼é åã§ã©ã®ç¨åº¦ã®å±æãè¡ããã¦ãããã®ææ¨ã¨ãã¦ä½¿ããã¨ãã§ããã

       swapcache=<count>
              ã¹ã¯ããããã¤ã¹ã«å¯¾å¿ããã¨ã³ããªã¼ãåå¨ãããã¼ã¸æ°ã

       active=<pages>
              ã¢ã¯ãã£ããªã¹ãã«å¥ã£ã¦ãããã¼ã¸æ°ã ãã®ãã£ã¼ã«ãã表示ãããã®ã¯ã
              å¤ããã®ã¡ã¢ãªã¼é åã®ãã¼ã¸æ°ã¨ç°ãªãå ´åã ãã§ããããã®ãã£ã¼ã«ãã表示ãããã¨ãããã¨ã¯ã
              ãã®ã¡ã¢ãªã¼é åã«ãã¾ããªãã¹ã¯ãã (swapper)
              ã«ãããã®é åããåé¤ãããå¯è½æ§ããã inactive ãªãã¼ã¸ãåå¨ãããã¨ãæå³ããã

       writeback=<pages>
              ç¾å¨ãã£ã¹ã¯ã«æ¸ãåºããã¦ãããã¼ã¸æ°ã

æºæ
       NUMA ã¤ã³ã¿ã¼ãã§ã¼ã¹ã«ã¤ãã¦è¦å®ãã¦ããæ¨æºã¯ãªãã

注æ
       Linux ã® NUMA ã·ã¹ãã ã³ã¼ã«ã¨ /proc ã¤ã³ã¿ã¼ãã§ã¼ã¹ã¯ãã«ã¼ãã«ã è¨‐
       å®ãªãã·ã§ã³ CONFIG_NUMA ãæå¹ã«ãã¦ä½æããã¦ããå ´åã®ã¿ãå©ç¨ å¯è½ã§ããã

   ã©ã¤ãã©ãªã«ãããµãã¼ã
       ã·ã¹ãã ã³ã¼ã«ã®å®ç¾©ãå¾ãã«ã¯ -lnuma ã§ãªã³ã¯ãããã¨ã libnuma
       ã¨å¿è¦ãªãããã¼ãã¡ã¤ã« <numaif.h> 㯠numactl ããã±ã¼ã¸ã§æä¾ããã¦ããã

       ãã ããã¢ããªã±ã¼ã·ã§ã³ã¯ãããã®ã·ã¹ãã ã³ã¼ã«ãç´æ¥å©ç¨ãã¹ãã§ãªãã
       æ¨å¥¨ãããæ¹æ³ã¯ãnumactl ããã±ã¼ã¸ã® numa(3) ã®é¢æ°ç¾¤ãæä¾ãã
       é«ã¬ãã«ã¤ã³ã¿ã¼ãã§ã¼ã¹ã®å©ç¨ã§ããã numactl ããã±ã¼ã¸ã¯ ⟨ftp://oss.sgi.com
       /www/projects/libnuma/download/⟩ ã§å¥æã§ããã ãã®ããã±ã¼ã¸ãåé²ããã¦ãã Linux
       ãã£ã¹ããªãã¥ã¼ã·ã§ã³ãããã
       ãã£ã¹ããªãã¥ã¼ã·ã§ã³ã«ãã£ã¦ã¯ãéçºç¨ã®ã©ã¤ãã©ãªã¨ãããã¼ãã¡ã¤ã«ã¯
       å¥ããã±ã¼ã¸ numactl-devel ã§æä¾ããã¦ããã

é¢é£é ç®
       get_mempolicy(2), mbind(2), move_pages(2), set_mempolicy(2), numa(3),
       cpuset(7), numactl(8)

ãã®ææ¸ã«ã¤ãã¦
       ãã® man ãã¼ã¸ã¯ Linux man-pages ããã¸ã§ã¯ãã®ãªãªã¼ã¹ 3.79 ã®ä¸é¨
       ã§ãããããã¸ã§ã¯ãã®èª¬æã¨ãã°å ±åã«é¢ããæå ±ã¯
       http://www.kernel.org/doc/man-pages/ ã«æ¸ããã¦ããã



Linux                             2012-08-05                           NUMA(7)