Hi,
from the ionice man page [1]:
A program running with idle io priority will only get disk time when no other program has asked for disk io for a defined grace period. The impact of idle io processes on normal system activity should be zero.
I think this app should set its IO priority to idle. I took a look at the source code for ionice [2][3] and it seems like glibc doesn't provide a wrapper for this syscall. However, it would still be nice if you could somehow include some of this.
It looks like you only need this call (despite the syscall wrapper and the constants):
ioprio_set(IOPRIO_WHO_PROCESS, 0, IOPRIO_CLASS_IDLE << IOPRIO_CLASS_SHIFT);
Greetings,
Uli Schlachter
[1]: http://linux.die.net/man/1/ionice
[2]: From the 2.13.1 release: http://git.kernel.org/?p=utils/util-linux-ng/util-linux-ng.git;a=blob;f=schedutils/ionice.c;h=9eb13877b08def5f7c4226e0761674a033cd151f;hb=fd7aa9f529b0dda8099a3ddb35bfcd1f3b79ad87
[3]: Latest trunk (configure checks if SYS_iorio_{get,set} are defined): http://git.kernel.org/?p=utils/util-linux-ng/util-linux-ng.git;a=blob;f=schedutils/ionice.c;h=d41a8fad472175e666b221d487ba9ba23c5e3739;hb=HEAD
I thought that running "ionice -c3 -p `preload process`" would be enough, Isn't it? (well, at least on my case, even with ionice -c3 I still get slow responsiveness while it's preloading at boot time but maybe it works for you... :-/
Thanks