NASM - The Netwide Assembler

NASM Forum => Programming with NASM => Topic started by: Ux on July 31, 2012, 08:54:03 PM

Title: Can you allocate non-virtual physical pages to avoid TLB lookup delay?
Post by: Ux on July 31, 2012, 08:54:03 PM
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.
Title: Re: Can you allocate non-virtual physical pages to avoid TLB lookup delay?
Post by: Frank Kotler 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

Title: Re: Can you allocate non-virtual physical pages to avoid TLB lookup delay?
Post by: yangbowen1 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