System Programming
Contents
Disk I/O
- Durable I/O
- Ensuring Data Reaches Disk by Jeff Moyer, Sep 2011
- Eat My Data: How Everybody Gets File IO Wrong (Video)
- linux-aio wants O_DIRECT and has undetectable performance degradation problems due to automatic fallback: (kvm)Re: linux-aio usable
Memory vs. Disk Caching
POSIX
Misc
MIPS ABI Additions for NPTL (TLS)
uClibc NPTL Sparc32 Porting Patch
Implementing LLVM Atomics
Pulse Audio and Userspace Soft Realtime
- Re: Some pulseaudio questions... Lennart Poettering: posix_madvise(POSIX_MADV_WILLNEED).
- "running "pulseaudio -vvvvv" in a terminal might give you a hint what might be going wrong."
- "Disable timer scheduled playback (use sound card interrupts) with "passing "tsched=0" to module-hal-detect in /etc/pulse/default.pa." Then restart PA.
- Re: Some pulseaudio questions... Lennart Poettering "We verify all timing related data we get from the driver as far as
possible. i.e. everything returned by snd_pcm_delay() and snd_pcm_avail() is checked whether it is in specific bounds ... search for "snd_pcm_delay"/"snd_pcm_avail"/"snd_pcm_update_avail" in bugzilla."
New ISA in Qemu
- RE: (Qemu-devel) Support for new target emulator Atmel looking to add AVR32 emulation to Qemu, Oct 2009
- (Qemu-devel) (PATCH 00/12) S/390 support, Oct 2009
Linux Glibc Dynamic Linking
- How To Write Shared Libraries Ulrich Drepper
- prelink effects on startup time and memory use: Re: prelink: is it worth it?(1), (2)
LD_DEBUG=statistics /lib64/libreoffice/program/swriter # with prelink LD_USE_LOAD_BIAS=0 LD_DEBUG=statistics /lib64/libreoffice/program/swriter # without
- STT_GNU_IFUNC: Tom Horsley (tom.horsley@att.net) 2009-11-20 17:35:04: "If you do an 'nm' on libc.so, you will see the functions that gdb cannot call have an 'i' printed in front of the symbol.
If you disassemble the code at &strlen, you find no code that could possibly take an argument and return a string length.
If you follow these clues around for several hours of google searching, you will find the STT_GNU_IFUNC symbol type and the assembler directive .type @gnu_indirect_function in various patches applied to the glibc code.
In those patches, you will also find that glibc now has 47,621 different versions of strlen, each optimized for a different architecture variation, because, after all, it is vital to provide a 1 nanosecond speed improvement in routines that typical programs spend 0.001% of their time in at the cost of complicating the maintenance of glibc and debuggers by a factor of at least 100.
Anyway, it seems like the dynamic linker checks for these indirect function entries when it is looking up symbols to resolve .plt entries, and when it finds one, rather than stashing the symbol value as the address of the function,it *calls* the funtion, which returns a pointer to the best version of of the 47,621 alternate strlens to use on the current architecture.
So the symbol named "strlen" is indeed a function, but it is a function of no arguments which returns a pointer to another function (the one you really want). God help us all when the security boys get wind of this dynamic linker feature - then they can randomly pick different implementations of all the glibc functions at runtime :-)."
- Generic System V Application Binary Interface Group: STT_IFUNC is added to GNU binutils Options
- Ulrich Drepper's Blog: glibc 2.10 news: Automatic use of optimized function
- David S. Miller Sparc support for STT_GNU_IFUNC
- Re: (google)(4.7)Using CPU mocks to test code coverage of multiversioned functions by Alan Modra
- See also: Linkders and Loaders
LD: linker arguments positions, --as-needed, --copy-dt-needed-entries(--add-needed)
GCC: -{g,f}record-gcc-switches
- gcc -grecord-gcc-switches stores them in the .debug_info section (output modified to reduce line length)
$ gcc -O2 -grecord-gcc-switches -g -o hello hello.c $ readelf --debug-dump hello | grep DW_AT_producer <c> DW_AT_producer GNU C 4.6.2 20111027 (Red Hat 4.6.2-1) -mtune=generic -march=x86-64 -g -O2
- -g seams to imply -grecord-gcc-switches
- gcc -frecord-gcc-switches stores them in a new .GCC.command.line section
$ gcc -O2 -frecord-gcc-switches -g -o hello hello.c $ readelf -p .GCC.command.line hello String dump of section '.GCC.command.line': [ 0] hello.c [ 8] -mtune=generic [ 17] -g [ 1a] -O2 [ 1e] -frecord-gcc-switches
See Also
- Shared Memory Concurrency
- GCC Extensions
- Debuggers
- Linkers and Loaders
- Profiling
- Tracing
- Windows Linux System Call Comparison
- Windows Programming
- Memory Management
- Pádraig Brady has a lot of interesting content at pixelbeat.org
- fio: "an I/O tool meant to be used both for benchmark and stress/hardware verification. It has support for 13 different types of I/O engines (sync, mmap, libaio, posixaio, SG v3, splice, null, network, syslet, guasi, solarisaio, and more), I/O priorities (for newer Linux kernels), rate I/O, forked or threaded jobs, and much more."