vm_privilege for swapin thread

Michael Kelly <[email protected]>
Newsgroups gmane.linux.debian.ports.hurd
Message-ID <[email protected]>
Memory allocation is suspended when free memory is low in a memory 
segment. I observed a number of occasions during recent stress testing 
when the kernel effectively froze because a different thread could not 
be swapped in. The swapin thread was suspended awaiting memory for stack 
allocation.

I didn't think it was unreasonable to promote the swapin_thread to 
having vm_privilege to help overcome those situations but perhaps there 
is a reason not to?

Mike.

diff --git a/kern/thread_swap.c b/kern/thread_swap.c
index bfb39239..7bf734f8 100644
--- a/kern/thread_swap.c
+++ b/kern/thread_swap.c
@@ -193,6 +193,7 @@ static void __attribute__((noreturn)) 
swapin_thread_continue(void)

  void swapin_thread(void)
  {
+       current_thread()->vm_privilege = 1;
         stack_privilege(current_thread());

         swapin_thread_continue();
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.