Documentation/cgroups/cpusets.txt 번역입니다.
요즘 cpuset에 대해 읽어보다가, 번역을 시작하게 되었습니다.
그러던 중 갑자기 다른 분들과 내용을 공유하면서 번역을 하면
더 매끄럽게 잘 되지 않을까 싶어서,,여기 글을 올려봅니다.
만일 여러분이 도와주셔서 번역이 잘 되면, KLDP.wiki쪽으로 옮겨볼까도 생각중입니다.
많은 조언 부탁드립니다.
[원문]
1. Cpusets
==========
1.1 What are cpusets ?
----------------------
Cpusets provide a mechanism for assigning a set of CPUs and Memory
Nodes to a set of tasks. In this document "Memory Node" refers to
an on-line node that contains memory.
Cpusets constrain the CPU and Memory placement of tasks to only
the resources within a tasks current cpuset. They form a nested
hierarchy visible in a virtual file system. These are the essential
hooks, beyond what is already present, required to manage dynamic
job placement on large systems.
Cpusets use the generic cgroup subsystem described in
Documentation/cgroups/cgroups.txt.
Requests by a task, using the sched_setaffinity(2) system call to
include CPUs in its CPU affinity mask, and using the mbind(2) and
set_mempolicy(2) system calls to include Memory Nodes in its memory
policy, are both filtered through that tasks cpuset, filtering out any
CPUs or Memory Nodes not in that cpuset. The scheduler will not
schedule a task on a CPU that is not allowed in its cpus_allowed
vector, and the kernel page allocator will not allocate a page on a
node that is not allowed in the requesting tasks mems_allowed vector.
User level code may create and destroy cpusets by name in the cgroup
virtual file system, manage the attributes and permissions of these
cpusets and which CPUs and Memory Nodes are assigned to each cpuset,
specify and query to which cpuset a task is assigned, and list the
task pids assigned to a cpuset.
[번역문]
1.1 What are cpusets?
Cpusets은 CPU와 Memory node로 구성된 집합을 task의 집합에 할당할 수 있는 mechanism이다. 이 document에서 “Memory Node”는 memory를 가지고 있는 on-line node를 의미하는 것이다.
Cpusets은 task가 사용하는 CPU와 Memory를 현재 cpuset내에 있는 자원만 사용하도록 제한할 수 있다. Cpusets은 virtual file system에서 볼 수 있는 중첩되니 계층구조를 형성한다.
이렇게 함으로써 보다 큰 system에서 동적으로 Job을 할당할 수 있다는 것이 기존에 비해 눈에 띄게 매력적인 부분이다.
Cpusets은 Documentation/cgroups/cgroups.txt에서 설명되어 있는 범용의 cgroup subsystem을 이용한다.
Task에 의한 요청들은 task의 cpuset에 의해서 걸러지게 된다. Cpuset은 정의되어 있는 cpuset에 존재하지 않는 CPU나 Memory node들에 대한 요청을 걸러서 처리되지 않도록 한다. 특히 CPU affinity mask에 속해 있는 CPU들을 포함시키기 위해서 “sched_setaffinity(2)” system call이 사용되고, cpuset의 memory policy에 속해있는 Memory node들을 포함하기 위해서 “mbind(2)”와 “set_mempolicy(2)”가 사용된다.
Schedular는 cpus_allowed_vector상에 허용되어 이씨지 않은 CPU상으로 task를 scheduling 하지 않는다. 그리고 kernel page allocator는 요청을 하는 task의 mem_allowed_vector에 허용되어 있지 않은 node상으로 page를 할당하지 않는다.
User level code는 cpusets을 생성하거나 파괴할 수 있으며 이것은 cgroup 이라는 virtual file system에 name을 사용함으로써 가능하다. 그리고 또한 User level code는 이러한 cpusets의 attributes와 permission을 관리할 수 있으며, 어떤 CPU와 Memory node가 어떤 cpuset에 할당되는지도 관리할 수 있다. 그리고 User level code를 사용함으로써 task가 할당되어 있는 cpuset을 명시하거나 조회하는 것이 가능하고, cpuset에 할당되어 있는 task pid들을 나열하는 것도 가능하다.
이해가 안되는 부분이 있어서요 ~
지금 공부하는 이 document를 보니까,,,
Add some cpus:
# /bin/echo 0-7 > cpus
라는 말이 나옵니다.
이건 CPU가 여러개 있는 System에서 8개의 CPU를 현재의 cpuset에 할당하는 것으로 이해가 되는데요.
Add some mems:
# /bin/echo 0-7 > mems
라는 말은 이해가 안되네요.
memory 8byte를 할당한다는 것인지,,아니면 단위가 MB인것인지,,
아니면 어떤 영역별로 나눈다는 것인지,,,
영 이해가 되지 않아서 질문을 남겨봅니다.
조언 부탁드릴게요 ~
메모리 노드 0-7 을 현
메모리 노드 0-7 을 현 프로세스에 할당한다는 말인 듯.
옵테론이나 네할렘
옵테론이나 네할렘 제온같이 프로세서에 메모리컨트롤러가 내장되는 경우에 이게 의미가 있죠.
이것들이 다중 프로세서 시스템을 이룰 때 각 프로세서는 자기들의 메모리컨트롤러에 연결되는 메모리를 독자적으로 가지게 되고,
프로세서는 HT나 QPI 같은 버스로 네트웍을 이루어서 작동하는데
이때 각 프로세서별로 자신에게 연결된 메모리의 데이터가 필요하다면 바로 멤컨에서 뽑아 쓸 수 있지만
다른프로세서에 연결된 메모리에서 데이터를 가져와야 한다면
QPI나 HT로 다른 프로세서에 요구하면 그쪽 프로세서에서 메모리 데이터를 뽑아서 전송해주어야 합니다.
이게 시스템 성능에 상당한 타격을 줍니다.
그래서 메모리 할당할때 특별한 처리를 해서 이걸 최소화하거나 아예 없애겠다는 뜻으로 보시면 됩니다.
우리가 쓰는 단일 프로세서 시스템에서는 거의 의미 없습니다. (극소수 옵테론/네할렘 제온 DP/MP시스템 쓰시는 분들은 꼭 필요합니다만)
Written By the Black Knight of Destruction
Written By the Black Knight of Destruction
Core2Duo Quad Core System은 어떨까요?
지금 사용하는 System이 Core2Duo QuadCore System인데요,
이 경우에도 의미가 없는걸까요?
조언 감사합니다.
네. C2D계열은 멤컨이
네. C2D계열은 멤컨이 노스에 있습니다. DP/MP 시스템이라도 노스 한개로 메모리를 공유하는 형태.
Written By the Black Knight of Destruction
Written By the Black Knight of Destruction
메모리는 의미없습니다.
NUMA 시스템이 아니라면 메모리 관련 설정은 의미없을 것입니다.
완료되면 아래 페이지에 링크걸어 주세요.. ^^
http://wiki.kldp.org/wiki.php/LinuxKernelDocEn2Kr