Fast System Call support

David Mosberger-Tang created a mechanism for performing system calls into the IA64 kernel without doing a full user to kernel context switch. The system call ends up running in a mode with kernel privileges but user address space.

As currently (2.5.64) implemented, a fast system call has severe restrictions on what it can do. In particular, it must not cause the register stack engine to operate, must not sleep, and must not cause a page fault.

The result is that the range of things that a fast system call can do is severely limited.

There are currently three fast system calls implemented:

  1.  getpid() 

  2.  gettid() 

  3.  gettimeofday() 

All these can be implemented lock-free and without sleeping. The most complicated is  gettimeofday().

Library Support

Library support requires minimal changes, and is being integrated with glibc and nptl.

The guts of making a syscall via the fast system call support looks like this

.prologue;                              
adds r2 = SYSINFO_OFFSET, r13;;         
ld8 r2 = [r2];                          
.save ar.pfs, r11;                      
mov r11 = ar.pfs;;                      
.body;                                  
mov r15 = num;                        
mov b7 = r2;                          
br.call.sptk.many b6 = b7;;             
.restore sp;                            
mov ar.pfs = r11

The sysinfo address is passed to the loader via the kernel aux vector, and stored in the TLS area of processes at SYSINFO_OFFSET (remember r13 is the per thread data pointer). You put your system call number in r15 and simply branch to that address to make your system call. If the call is supported as a fast system call it will proceed as such, otherwise will fall back to the slower break method in the fast system call handler.

Library support for fast system calls is coming fast; debian packages of glibc cvs and nptl are available here. You can add

deb http://www.gelato.unsw.edu.au/~ianw/libc-nptl/ ./

to your /etc/apt/sources.list and simply apt-get upgrade libc6.1. The debian glibc maintainers have stated they will offically support NPTL when gcc 3.3 becomes available %

IA64wiki: FastSystemCalls (last edited 2009-12-10 03:13:39 by localhost)

Gelato@UNSW is sponsored by
the University of New South Wales National ICT Australia The Gelato Federation Hewlett-Packard Company Australian Research Council
Please contact us with any questions or comments.