Author Topic: Can you allocate non-virtual physical pages to avoid TLB lookup delay?  (Read 10088 times)

Offline Ux

  • Jr. Member
  • *
  • Posts: 12
Hi folks,

I'm using Linux as well as OS/X. I'm curious as to whether I can boost the speed of access to main memory.
I'd like to accessed a fixed-address physical page and avoid the TLB lookup and address calculation delay.
But is such a thing possible from Linux or OS/X user space? And whether done from kernel space or user space, would it really speed things up?

Thanks.

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: Can you allocate non-virtual physical pages to avoid TLB lookup delay?
« Reply #1 on: August 01, 2012, 04:11:27 AM »
Dunno. Almost certainly not from user space. Kernel space... maybe... I doubt that it would be worthwhile unless you've definitely identified TLB lookup as a bottleneck in your program. The "prefetch" instruction might be worth looking into. I'm really not sure...

Best,
Frank


Offline yangbowen1

  • Jr. Member
  • *
  • Posts: 4
Re: Can you allocate non-virtual physical pages to avoid TLB lookup delay?
« Reply #2 on: August 22, 2012, 08:16:02 AM »
1. Since paging is enabled, it will NOT be able to access a page without looking up PDE, PTE and/or TLB EVEN IF the whole linear address space is flat-mapped.
2. Disabling paging in linux will be a lot of works in the linux kernel code and may even require application code changes because it will make great change to the execution.
3. There is a method to avoid TLB lookup. Setting CR0.CD will prevent ALL caching. However, all this will cause is to slow down the speed.

See also: http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html
Volume 3, Chapter 4 Paging