https://access.redhat.com/site/solutions/67175
What happened to the vm.pagecache kernel tunable in RHEL 5?
역) RHEL5에서 튜닝 가능한 커널 vm.pagecache에 무슨 변화가 일어났는가?
문제
It seems that at some point in the kernel's lifetime, the documentation in /usr/share/doc/kernel-*/Documenation/filesystems/proc.txt in section 2.4 dropped the bit about /proc/sys/vm/pagecache, which still exists.
역) 커널 일생의 어떤 시점에서, 2.4 섹션에 있는 /usr/share/doc/kernel-*/Documenation/filesystems/proc.txt 의 문서는 /proc/sys/vm/pagecache 에 대한 것을 drop했는데, /proc/sys/vm/pagecache는 여전히 존재합니다.
In RHEL3, /proc/sys/vm/pagecache was a tunable with three parameters: min, borrow, and max. But in RHEL5 it looks like it just has one value:
역) RHEL3에서 /proc/sys/vm/pagecache는 3개 파라미터(min. borrow, max)로 튜닝 가능했습니다. 그러나 RHEL5에서 그것은 단지 1개 value만 갖는 것으로 보입니다.
# cat /proc/sys/vm/pagecache
100
100
and without documentation in the kernel-doc RPM, we have no idea what this value means.
역) 그리고 the kernel-doc RPM의 문서에도 없어, 이 value의 의미가 무엇인지 아는 바가 없습니다.
환경
• Red Hat Enterprise Linux (RHEL) 5
해결
The tunable vm.pagecache was used to set a limit on system's pagecache, and it was dropped in the 2.6 kernel series in favor of the vm.swappiness mechanism.
역) 튜닝 가능한 vm.pagecache는 시스템의 pagecache 제한 설정에 사용됩니다. 그리고 vm.pagecache는 vm.swappiness 메커니즘 선호 경향에 의해 2.6 커널 시리즈에서 drop되었습니다.
After noticing a couple of scalability issues in RHEL4 (2.6.9 series), Red Hat reinserted the vm.pagecache knob in a slightly different fashion. Now it takes just one parameter that represents a percentage of total RAM which represents a pagecache threshold. When that threshold is lowered, the system favors reclaiming unmapped pagecache memory over mapped memory. The default is 100 so if they don't set this new parameter the kernel won't do anything new. RHEL5 also bears the same Red Hat vm.pagecache insertion.
역) RHEL4(2.6.9 시리즈)의 확장성 이슈가 알려진 후, 레드햇은 vm.pagecache 를 약간 다른 방식으로 삽입하였습니다. 이제 그것은 pagecache 임계치를 나타내는 전체 램에서 차지하는 퍼센티지를 나타내는 하나의 파라미터를 다룹니다. 임계치가 낮으면, 시스템은 매핑되지 않은 pagecache 메모리에 이어 매핑된 메모리까지 reclaim하는 것을 선호합니다. 기본값은 100이므로 이 새로운 파라미터를 설정하지 않으면 커널은 아무 것도 하지 않습니다. RHEL5은 또한 같은 레드햇 vm.pagecache 삽입을 갖습니다.
While reclaiming pages, the kernel checks out if the page cache is over a max threshold given by the following macro, found at include/linux/swap.h:
역) page를 reclaim하는 동안, include/linux/swap.h에서 확인되는 아래 macro에 의해 주어진 최대 임계치를 page cache가 넘었는지 커널이 체크합니다.
extern int pagecache_maxpercent;
#define pagecache_over_max() \
(global_page_state(NR_FILE_PAGES) - total_swapcache_pages) > \
(totalram_pages * pagecache_maxpercent / 100)
#define pagecache_over_max() \
(global_page_state(NR_FILE_PAGES) - total_swapcache_pages) > \
(totalram_pages * pagecache_maxpercent / 100)
So, vm.pagecache helps to render the above calculation telling to the kernel how many (percentage-wise) pages are considered the MAX threshold for page cache.
역) 그러므로 얼마나 많은 page가 page cache 임계값으로 고려되는지를 커널에 말하는 위 계산식을 세우는 것을 vm.pagecache가 도와줍니다.
So, when the system is short on memory and reclaiming - if pagecache is above that percentage, then the system will prefer to reclaim from unmapped pagecache memory, otherwise it will attempt reclaiming from mapped memory, and anonymous pages (i.e. making the system swap).
역) 따라서 시스템 메모리가 고갈되어 reclaim될 때 - pagecache가 퍼센티지 범위 내라면, 매핑되지 않은 pagecache memory로부터 reclaim하는 것을 시스템은 선호합니다. 그렇지 않으면 매핑된 memory와 anonymous page를 reclaim합니다(시스템 swap을 만들며).