본문 바로가기

Research Log

(26)
cgroups cgroups? 프로세스 kernfs kernfs는 pseudo file systems를 생성하는데 필요한 기능들을 제공하는 함수 모음이다. 예를 들어 sysfs 는 하드웨어 장치와 관련된 디바이스 드라이버를 커널의 디바이스 모델에서 유저 스페이스로 노출하는 virtual file을 제공한다. kernfs는 sysfs가 사용하던 일부 로직을 분리하여 것이다. 대표적으로 cgroup에서 kernfs을 사용한다.
HPC Container Troubleshoot (Sloved) Problem - Docker docker stack deploy 혹은 docker service 를 시작할 때 Solution /usr/local/ 경로에 있는 파일은 권한이 없다고 실행하지 못한다. /usr 경로에서 실행하면 된다. (Semi-Solved) Problem - Docker docker swarm 에서 static ip가 현재 구현되어 있지 않는 듯 하다. Solution docker network create 로 attachable한 외부의 네트워크를 만들어서 subnet, gateway 등의 설정을 해준다. docker-compose에서 만든 네트워크로 서비스를 붙인다. docker inspect $containers 에서 IPv4Address를 파싱하여 hosts 파..
Offcore Response Event Event number 0B7H support offcore response monitoring using an associated configuration MSR, MSR_OFFCORE_RSP0 (address 1A6H) in conjunction with umask value 01H or MSR_OFFCORE_RSP1 (address 1A7H) in conjunction with umask value 02H. Table 18-14 lists the event code, mask value and additional off-core configuration MSR that must be programmed to count off-core response events using IA32_PMCx. The..
Intel PMU There are a finite number of performance event select MSRs (IA32_PERFEVTSELx MSRs). The result of a performance monitoring event is reported in a performance monitoring counter (IA32_PMCx MSR). 두 register는 아래의 사항을 따른다. IA32_PERFEVTSELx의 bit field layout은 모든 microarchitecture들이 동일하다. IA32_PERFEVTSELx MSRs의 주소와 IA32_PMC MSRs의 주소는 모든 microarchitecture들이 동일하다. 모든 logical processor는 IA32_PERFEVTSELx ..
Advanced profiling topics. PEBS and LBR. multiplexing and scaling events If there are more events than counters, the kernel uses time multiplexing(switch frequency = HZ, generally 100 or 1000) to give each event a chance to access the monitoring hardware. Multiplexing only applies to PMU events. Multiplexing을 사용하면 event 들이 매번 측정되지 않는다. 실행의 마지막에 tool이 따로 계산을 수행한다. final_count = raw_count * time_enabled/time_running. 그러므로 workload에 따라 bl..
IOPS Are A Scam Introduction IOPS란 Input/Output Operations Per Second로써, 디바이스에서 1초에 얼마나 많은 물리적인 read/write 동작이 수행가 능한지를 나타내는 척도이다. 많은 벤더들이 이러한 메트릭을 통해서 자신의 상품들을 광고한다. 하지만 사실 7,000 IOPS 스펙을 가진 디바이스와 300 IOPS 스펙의 디바이스 중 항상 7,000 IOPS 디바이스가 빠르다고 장담할 수는 없다. Background Latency vs IOPS Latency는 하나의 요청(request)이 발생하고 그에 대한 응답(response)을 받기까지 걸린 시간이다. Latency는 스토리지 디바이스의 성능을 나타내기 위한 하나의 중요한 메트릭이다. HDD의 동작 구조를 알고 있다면, 물..
[20 CCF Tran HPC] APMT: an automatic hardware counter‑based performance modeling tool for HPC applications Abstract HPC 어플리케이션과 컴퓨터 구조의 복잡도가 늘어가면서 어플리케이션의 동작을 이해하는 노력에 대한 비용 또한 점차 증가하고 있다. 이 논문에서는 performance를 효율적으로 이해하고 예측하기 위한 APMT(Automatic Performance Modeling Tool)을 소개한다. APMT에서는 hardware counter 기반 프로파일링을 사용하여 key kernel 과 non-scalable kernel를 구분하여 performance model을 만든다. 또한, CPI(Cycles-Per-Instruction)을 더욱 자세하게 계산하기 위해 선택적 개선 모델링 프레임워크(optional refinement modeling framwork)를 제공한다. APMT는 몇 가지 소..
The PMCs of EC2: Measuring IPC ... as with the increasing scale of processors and speed of storage devices, the common bottleneck is moving from disks to the memory subsystem. CPU caches, the MMU, memory busses, and CPU interconnects. These can only be analyzed with PMCs. PMC Usage PMC는 Counting, Sampling 두개의 방법으로 사용될 수 있다. Counting: 발생하는 개수를 집계 Sampling: 이벤트의 개수를 기반으로 인터럽트를 발생시킴 (Interrupt는 stack trace, PC(Program Counter) s..
Perf Events Counter, MSRs - model specific registers https://easyperf.net/blog/2018/06/01/PMU-counters-and-profiling-basics Counting vs. Sampling Counting - disable counting - set all the counters to 0 - configure evenst that we want to measure - enable counting - run the application - disable counting - read the values of the counters Sampling - set counter to 0 - enable counting - wait for the overflow an..
CPU cycle에 대한 고찰 What is retired instruction? Modern processors execute much more instructions that the program flow needs. This is called a speculative execution. Instructions that were “proven” as indeed needed by the program execution flow are “retired”. What is reference cycle? Having a snippet A to run in 100 core clocks and a snippet B in 200 core clocks means that B is slower in general (it takes double t..