APC: An Adaptive Page Prefetching Control Scheme in Virtual Memory System

APC: 가상 메모리 시스템에서 적응적 페이지 선반입 제어 기법

  • 안우현 (광운대학교 컴퓨터소프트웨어학과) ;
  • 양종철 (LG전자 MC사업본부) ;
  • 오재원 (가툴릭대학교 컴퓨터정보공학부)
  • Received : 2010.03.28
  • Accepted : 2010.03.29
  • Published : 2010.06.15

Abstract

Virtual memory systems (VM) reduce disk I/Os caused by page faults using page prefetching, which reads pages together with a desired page at a page fault in a single disk I/O. Operating systems including 4.4BSD attempt to prefetch as many pages as possible at a page fault regardless of page access patterns of applications. However, such an approach increases a disk access time taken to service a page fault when a high portion of the prefetched pages is not referenced. More seriously, the approach can cause the memory pollution, a problem that prefetched pages not to be accessed evict another pages that will be referenced soon. To solve these problems, we propose an adaptive page prefetching control scheme (APC), which periodically monitors access patterns of prefetched pages in a process unit. Such a pattern is represented as the ratio of referenced pages among prefetched ones before they are evicted from memory. Then APC uses the ratio to adjust the number of pages that 4.4BSD VM intends to prefetch at a page fault. Thus APC allows 4.4BSD VM to prefetch a proper number of pages to have a better effect on reducing disk I/Os, though page access patterns of an application vary in runtime. The experiment of our technique implemented in FreeBSD 6.2 shows that APC improves the execution times of SOR, SMM, and FFT benchmarks over 4.4BSD VM by up to 57%.

가상 메모리 시스템(VM)에서 페이지 부재로 발생하는 디스크 I/O를 감소시키기 위해 페이지 선반입 기법을 사용한다. 이 기법은 부재 페이지와 함께 추가적인 페이지들을 한 번의 디스크 I/O로 미리 읽는다. 그런데, 4.4BSD와 같은 운영체제의 VM은 응용 프로그램의 페이지 참조 패턴을 고려하지 않고 항상 가능한 많은 페이지들을 선반입하고자 한다. 이 방법은 선반입된 페이지들 중 일부만 사용하는 참조패턴에서 디스크 참조 시간을 증가시키며, 유용한 페이지들을 메모리에서 내보내는 메모리 오염을 야기한다. 이런 문제를 해결하기 위해 본 논문은 적응적 페이지 선반입 제어 기법(APC)을 제안한다. APC는 선반입 페이지들 중에서 메모리에 존재하는 동안 참조된 페이지들의 비율을 프로세스 단위로 주기적으로 측정하고, 이 비율을 사용하여 4.4BSD VM이 선반입하고자 하는 페이지의 개수를 조절한다. 그래서 실행도중 페이지 참조 패턴이 바뀌더라도 적절한 수의 페이지를 선반입할 수 있다. 성능 검증을 위해 APC를 4.4BSD 기반의 FreeBSD 6.2에 구현하였으며, SOR, SMM, FFT 벤치마크를 통해 성능을 측정하였다. 성능 측정 결과 APC는 기존 BSD VM보다 벤치마크의 실행 시간을 최대 57% 단축하였다.

Keywords

References

  1. R. E. Bryant and D. R, O'Hallaron, Computer Systems: A Programmer's Perspective, pp.447-458, Prentice Hall, 2003.
  2. S. Jiang and X. Zhang, "LIRS: An Efficient Low Inter-Reference Recency Set Replacement Policy to Improve Buffer Cache Performance," In Proc. of the 2002 ACM SIGMETRICS, pp.31-42, 2002.
  3. N. Megiddo and D. S. Modha, "ARC: A Self- Tuning, Low Overhead Replacement Cache," In Proc. of the 2nd USENIX Conference on File and Storage Technologies (FAST 03), pp.115-130, 2003.
  4. S. Bansal and D. Modha, "CAR: Clock with Adaptive Replacement," In Proc. of the 3rd USENIX Conference on File and Storage Technologies (FAST 04), pp.187-200, 2004.
  5. Y. Smaragdakis, S. Kaplan, and P. Wilson, "EELRU: Simple and Effective Adaptive Page Replacement," In Proc. of SIGMETRICS 1999, pp.122-133, 1999.
  6. S. Jiang, F. Chen, and X. Zhang, "CLOCK-Pro: An Effective Improvement of the CLOCK Replacement," In Proc. of USENIX 2005 Annual Technical Conference, pp.323-336, 2005.
  7. R. Cervera, T. Cortes, and Y. Becerra, "Improving Application Performance through Swap Compression," In Proc. of USENIX 1999 Annual Technical Conference, pp.207-218, 1999.
  8. D. Black, J. Carter, G. Feinberg, R. MacDonald, S. Mangalat, E. Sheinbrood, J. V. Sciver, and P. Wang, "OSF/1 Virtual Memory Improvements," In Proc. of USENIX Mach Symposium, pp.87-103, 1991.
  9. J. Yang, W. H. Ahn, J. Oh, "MOC: A Multiple- Object Clustering Scheme for High Performance of Page-out in BSD VM," Journal of KIISE: Computer Systems and Theory, vol.36, no.6, pp.476-487, Dec. 2009 (in Korean)
  10. A. D. Brown and T. C. Mowry, "Compiler-Based I/O Prefetching for Out-of-Core Applications," Journal of ACM Transactions on Computer Systems (TOCS), vol.19, no.2, pp.111-170, 2001. https://doi.org/10.1145/377769.377774
  11. S. Cho and Y. Cho, "Page Fault Behavior and Two Prepaging Schemes," In Proc. of the 1996 IEEE 15th Annual International Phoenix Conference on Computers and Communications, pp.15-21, 1996.
  12. K. S. Trivedi, "Prepaging and applications to array algorithms," IEEE Transactions on Computers, vol.25, no.9, pp.915-921, September 1976.
  13. K. S. Trivedi, "An analysis of prepaging," Computing, vol.22, no.3, pp.191-210, 1979. https://doi.org/10.1007/BF02243562
  14. G. Dini, G. Lettieri, and L. Lopriore, "Caching and Prefetching Algorithms for Programs with Looping Reference Patterns," The Computer Journal, vol.49, no.1, pp.42-61, 2006. https://doi.org/10.1093/comjnl/bxh140
  15. I. Song and Y. Cho, "Page Prefetching Based on Fault History," In Proc. of the 3rd Mach Symposium on USENIX, pp.203-213, 1993.
  16. J.-L. Baer and G. R. Sager, "Dynamic Improvement of Locality in Virtual Memory Systems," IEEE Transactions on Software Engineering, vol.2, no.1, pp.54-62, 1976.
  17. R. N. Horspool and R. M. Huberman, "Analysis and Development of Demand Prepaging Policies," Journal of Systems and Software, vol.7, no.3, pp183-194, 1987. https://doi.org/10.1016/0164-1212(87)90040-9
  18. S. F. Kaplan, L. A. McGeoch, and M. F. Cole, "Adaptive Caching for Demand Prepaging," In Proc. of the 3rd International Symposium on Memory Management (ISMM'02), pp.114-126, 2002.
  19. J. Knapka, Outline of Linux memory management system, http://www.thehackademy.net/madchat/ebooks/Mem_virtuelle/linux-mm/vmoutline.html.
  20. A. Siberschats, P. B. Galvin, and G. Gagne, Operating System Concepts, 8th Ed., pp.405, Wiley, 2008.
  21. M. K. McKusick and G. V. Neville-Neil, The Design and Implementation of the FreeBSD Operating System, pp.183, Addison-Wesley, 2004.
  22. Scimark2 benchmark home page. Web site: http://math.nist.gov/scimark2.
  23. FFT home page. Web site: http://www.fftw.org.
  24. R. H. Patterson, G. A. Gibson, E. Ginting, D. Stodolsky, and J. Zelenka, "Informed Prefetching and Caching," In Proc. of the 15th ACM Symp. on Operating Systems Principles, pp.79-95, 1995.
  25. P. Cao, E. Felten, A. Karlin, and K. Li, "A Study of Integrated Prefetching and Caching Strategies," In Proc. of the 1995 ACM SIGMETRICS, pp.188-197, 1995.
  26. H. Lei and D. Duchamp, "An Analytical Approach to File Prefetching," In Proc. of the USENIX 1997 Annual Technical Conference, pp.275-288, 1997.
  27. E. Shriver, C. Small, and K. A. Smith, "Why Does File System Prefetching Work?," In Proc. of the USENIX 1999 Annual Technical Conference, pp.71-83, 1999.