Tomasz Wendlandt

Avatar

Tech blog

page cache on Linux 2.6.27

Miesiąc temu wydano kernel 2.6.27, m.in. usprawniono w nim obsługę page cache’u dla systemów wieloprocesorowych. Ciekawe jak bardzo nowa funkcja get_user_pages_fast() potrafi poprawić wydajność systemu, może ktoś już to testował?

The page cache is the place where the kernel keeps in RAM a copy of a file to improve performance by avoiding disk I/O when the data that needs to be read is already on RAM. Each “mapping”, which is the data structure that keeps track of the correspondence between a file and the page cache, is SMP-safe thanks to its own lock. So when different processes in different CPUs access different files, there’s no lock contention, but if they access the same file (shared libraries or shared data files for example), they can hit some contention on that lock. In 2.6.27, thanks to some rules on how the page cache can be used and the usage of RCU, the page cache will be able to do lookups (ie., “read” the page cache) without needing to take the mapping lock, and hence improving scalability. But it will only be noticeable on systems with lots of cpus (page fault speedup of 250x on a 64 way system have been measured).

In 2.6.27, a new get_user_pages_fast() function has been introduced, which does the same work that get_user_pages() does, but its simplified to speed up the most common workloads that exercise those paths within the same address space. This new function can avoid taking the mmap_sem semaphore and the page table locks in those cases. Benchmarks showed a 10% speedup running a OLTP workload with a IBM DB2 database in a quad-core system.

Źródło.

One Comment, Comment or Ping

Reply to “page cache on Linux 2.6.27”

Poznań

  • Cloud and Visibility OK
  • Temperature: 12°C
  • Visibility: 10km
  • Clouds: Cloud and Visibility OK
  • Wind: E at 7 km/h
  • Barometer: 1014 hPa
  • Humidity: 76.5%
  • Sunrise: 8:53 GMT+2
  • Sunset: 21:00 GMT+2