Swapping out paging structures?
Posted: Thu Apr 17, 2008 10:31 pm
Hi all,
Soon I will be trying to implement my first "real step" towards an OS; memory management.
I'm wondering, how do you all store your paging structures? Do you permit them to be swapped out or do they always reside in physical memory?
I understand that they need to be in physical memory when in use, but otherwise the currently unused paging structures could theoretically be swapped out.
Of course, having to swap these structures back into physical memory every time the tasks are run would incur some overhead, possibly a lot of overhead.
This probably wouldn't be such an issue with a 32-bit OS, but in long mode, with 48-bit addresses, an application could theoretically use up a hell of a lot of virtual memory. If such an application's paging structures were permanently stored in physical memory and not permitted to be swapped out, this could vastly reduce the physical memory available to the system, potentially preventing further processes starting etc.
Realistically, such an application is probably unlikely to exist for the near future, but the potential issue is still there and if nothing else, could be exploited by malicious code.
Thoughts / corrections / suggestions would be appreciated
Cheers,
Lee
Soon I will be trying to implement my first "real step" towards an OS; memory management.
I'm wondering, how do you all store your paging structures? Do you permit them to be swapped out or do they always reside in physical memory?
I understand that they need to be in physical memory when in use, but otherwise the currently unused paging structures could theoretically be swapped out.
Of course, having to swap these structures back into physical memory every time the tasks are run would incur some overhead, possibly a lot of overhead.
This probably wouldn't be such an issue with a 32-bit OS, but in long mode, with 48-bit addresses, an application could theoretically use up a hell of a lot of virtual memory. If such an application's paging structures were permanently stored in physical memory and not permitted to be swapped out, this could vastly reduce the physical memory available to the system, potentially preventing further processes starting etc.
Realistically, such an application is probably unlikely to exist for the near future, but the potential issue is still there and if nothing else, could be exploited by malicious code.
Thoughts / corrections / suggestions would be appreciated
Cheers,
Lee