I just learned the existence of nice (and ionice) which seems to be really interesting.
I just want to launch a process 'p_low' with less priority than my ususal one 'p_normal'.
What I was able to get from the wiki page (only source which shows me how the resource is distributed), is that:
a process run with nice +15 will receive 25% of the CPU time allocated to a normal-priority process: (20 − 15)/(20 − 0) = 0.25
So based on that I can provide 10% of the CPU time to my p_low process if "nice -18 p_low"
This is perfect IF MY 'p_normal' IS RUNING.
So question: is there a way to tell the scheduler to use the default niceness value, and only -18 when there is something else running?
In the worst case I can make a script which check if anything else is running, and "renice" my process, but it doesn't seem to be the best option to me...
ANSWER: As pointed out by @jilliagre in the comments below his answer:
if nothing else is running the command will get 100% of the CPU whatever the niceness given (-18, 0, +18, ...)