Usually pages that are used by the kernel are marked as "forced resident" or "swappable" or "cache".
Let's say the kernel uses some memory to cache the contents of a file or directory. The purpose is to avoid reading the file or directory again. Swapping this memory would be absolutely pointless. Just remember that it doesn't contain any cached data anymore. (Well, not 100% pointless for files on a very old and slow hard drive with swapping to a super fast SSD drive).
Your I/O buffers most likely must be in RAM while I/O happens, because the device performing the I/O will be set up to read from that RAM address, and cannot communicate with your OS at all. So if you swapped out the buffer, and allocated something else at that address, your hardware would happily keep reading/writing from that RAM address, creating absolute chaos.
Then there is everything that is needed to swap anything. For example the software that reads from the swap file. If that gets swapped out, you can't read it back in because you'd need to read it back in before you could use it to read it back in. Similar to leaving your car keys in your locked car. That kind of data would be "forced resident". And anything where some hardware thinks it must be in RAM would be "forced resident".