[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

vm_privilege for swapin thread



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();


Reply to: