Hello everyone!
I have some questions regarding the policy for locking pages in memory.
1) Should I assign to each process a constant maximum number pages that it can pin in memory or should it be done dynamically?
2) If the number of pinned pages should change dynamically for each process, how can I control that?
Thank you,
White
Policy for Locking Pages in Memory
-
- Posts: 23
- Joined: Wed Feb 02, 2011 12:30 pm
- Location: Belo Horizonte, Minas Gerais, Brazil
- Contact:
Policy for Locking Pages in Memory
Pedro H. Penna.
Undergraduate student of Computer Engineering.
Current OS Project: http://nanvix.blogspot.com/
Undergraduate student of Computer Engineering.
Current OS Project: http://nanvix.blogspot.com/
Re: Policy for Locking Pages in Memory
It depends on your design.
By the way, an OS may limit the maximum memory can be allocated per user (or per process); and allocate them dynamically (on demand).
By the way, an OS may limit the maximum memory can be allocated per user (or per process); and allocate them dynamically (on demand).
You know when a page is allocated (syscall or page fault), and you can do some kind of bookkeeping.Whitebird wrote:2) If the number of pinned pages should change dynamically for each process, how can I control that?
-
- Posts: 23
- Joined: Wed Feb 02, 2011 12:30 pm
- Location: Belo Horizonte, Minas Gerais, Brazil
- Contact:
Re: Policy for Locking Pages in Memory
Thanks for answering me bluemoon.
I was aware that an OS should dynamically change the number of frames allocated per processor per-user by load control, probably using PFF as reference. But, I'm not sure if I can apply that for page locking.
For the moment, I assign to each process a constant number of pages that it can pin in memory. What do you think about this approach?
Cheers,
White
I was aware that an OS should dynamically change the number of frames allocated per processor per-user by load control, probably using PFF as reference. But, I'm not sure if I can apply that for page locking.
For the moment, I assign to each process a constant number of pages that it can pin in memory. What do you think about this approach?
Cheers,
White
Pedro H. Penna.
Undergraduate student of Computer Engineering.
Current OS Project: http://nanvix.blogspot.com/
Undergraduate student of Computer Engineering.
Current OS Project: http://nanvix.blogspot.com/
Re: Policy for Locking Pages in Memory
It's a matter of policy.
However, IMO, the ability to control / pin some memory (and avoid it being swapped) may impact the system, and should not be abused.
Furthermore, normal application should / would have no idea on the overall system workload and stress, so they could not help in any case by providing hints on memory usage - they usually make it worst.
That leave the only useful case for drivers, that require special treatment on memory (eg. non-swappable buffers, or things that impact performance if swapped); in such cases you may as well provide special API for such allocation.
However, IMO, the ability to control / pin some memory (and avoid it being swapped) may impact the system, and should not be abused.
Furthermore, normal application should / would have no idea on the overall system workload and stress, so they could not help in any case by providing hints on memory usage - they usually make it worst.
That leave the only useful case for drivers, that require special treatment on memory (eg. non-swappable buffers, or things that impact performance if swapped); in such cases you may as well provide special API for such allocation.