Page swapping - mmm, I think you might need to (further) refine your terminology.
If it was simple everyone would be fixing it.
The (Linux) mm code is ubiquitous and wide ranging.
Perhaps you should start here
- as for diving into the code, it has cost me copious amounts of alcohol trying to stay sane ...