I recently had the following Linux experience:
I was trying to edit a file and do
other work interactively, while running, in
background, a computationally intensive process,
which intermittently used more virtual memory than the
real memory of the machine.
Editing the file and switching between other idle
foreground windows was jerky and annoying because of
the swapping due to the huge process. Renicing the
huge process did not help very much, however renicing
kswapd to a weaker priority did help considerably.
If this experience was not misleading in some way,
then it seems that the swapping, which occurs as a
result of page faults created by a large process
will ordinarily have the priority of the swapper
and not the process responsible. Is this correct?
Would it make sense to have a configuration option
which would allow the functional priority level
of the scheduled swapping to be the priority of
the process causing the real memory page fault?
I suspect there are probably architectural issues
that would make this difficult, but just thought
I would throw it out as a question/suggestion.