'memory'에 해당되는 글 3건

  1. 2015.05.26 Persistent memory and page structures
  2. 2015.05.21 Memory protection keys
  3. 2013.03.21 kernel 3.8 is out!

Persistent memory and page structures

Personal Computer/Linux 2015. 5. 26. 23:15 posted by tolkien

http://lwn.net/Articles/644079/


persistent memory(or non-volatile memory), 쉽게 NOR flash를 생각하면될 것같습니다. SSD에 대해서 direct-access를 하는 경우도 있을지도.

어쨌든 이 유형의 h/w는 cpu에서 직접 접근가능하다.라는 이점이 있어서 이것을 이용할 수 있는 방법에 대한 논의를 간단히 다룬 내용입니다.

단순하게 ROM처럼 page로 분할해서 mapping해버리면 1TB가 넘는 경우, 관리하는 데만많은 memory를 사용하므로 좋지 않습니다. 이에...
1. persistent memory에 대해서 Page Frame Number(PFN)을 사용.
 - http://lwn.net/Articles/643437/ - by Dan Williams
 - page structure를 손대서 persistent memory인 경우, page가 아닌 PFN을 사용
2. Directly mapped persistent memory page cache
 - http://lwn.net/Articles/644114/ - by Ingo Molnar
 - page structure를 일반 memory가 아닌 persistent memory에 저장

아직 어떤 방법도 code로 다 구현되어 있지 않고, 논의중입니다.

Memory protection keys

Personal Computer/Linux 2015. 5. 21. 10:42 posted by tolkien

http://lwn.net/Articles/643797/

https://lkml.org/lkml/2015/5/7/764 - patch set.


linux system call중에서 mprotect() 가 있다.

할당받은 memory에 대해서 read/write/execute를 제어한다. 이는 s/w로 구현되어 있다.

그런데, intel에서 차세대 64bit CPU에서는 MPK(Memory Protection Key)라는 기능을 제공하겠다고 한다. 

별도 register를 제공하는 형태가 될 듯. 이에 대해서 기존 system call 구현으로 충분한데, 굳이 h/w 구현까지 신경써야 하는 의견에 대해서 Alan Cox의 답변은 

"here is real-world demand for the ability to change protection on gigabytes of memory at a time, and that mprotect() is simply too slow."

kernel 3.8 is out!

Personal Computer/Linux 2013. 3. 21. 11:17 posted by tolkien
linux에서 각 app별로 memory 사용량을 파악하는 것은 어렵습니다.
더욱이 현재 남아 있는 physical memory가 얼마인지 아는 것은 더욱 더 어렵죠.
Two approaches to kernel memory usage accounting
http://lwn.net/Articles/485593/

이번에 3.8에서 memory control group에 대해서 좀 더 나은 시도를 하고 있다고 합니다.
Improving kernel-memory accounting for memory cgroups
http://lwn.net/Articles/528078/

이번 시도는 TCP buffer에 대해서 먼저 시도를 해봤고,
그게 괜찮으니까 memory system 전체로 확장하려고 하고 있습니다.
Per-cgroup TCP buffer limits
http://lwn.net/Articles/470656/

잘 되면 이런저런 응용이 될 수 있을 것같습니다.
당장 응용을 하려는 곳은 OpenVZ라고 하는 container 방식의 virtualization입니다.
이른바 OS level의 가상화인데, 쉽게 말하면 한 pc에서 여러개 web server를 운영하는데,
각 web server를 마치 별도의 pc에서 실행되는 것처럼 제공하는 방식입니다.
virtualbox나 vmware는 machine level에서 가상화를 제공하지만,
OpenVZ는 OS level에서 제공하기 때문에 overhead가 적다고 합니다.

문제는 각 virtual machine에게 필요한 memory를 배타적으로 제공하는데,
이것을 memory control group을 통해서 제공하는데,
아직은 memory cgroup으로 여유있게 제공해야 한다고 합니다.
3.8에서 시도하는 것이 어느 정도 잘 되면 좀 더 알뜰하게 memory를 제공할 수 있겠죠.