Print this page
patch remove-dont-swap-flag

*** 758,776 **** /* * segkp_map_red() will check the current frame pointer against the * stack base. If the amount of stack remaining is questionable * (less than red_minavail), then segkp_map_red() will map in the redzone * and return 1. Otherwise, it will return 0. segkp_map_red() can ! * _only_ be called when: ! * ! * - it is safe to sleep on page_create_va(). ! * - the caller is non-swappable. * * It is up to the caller to remember whether segkp_map_red() successfully * mapped the redzone, and, if so, to call segkp_unmap_red() at a later ! * time. Note that the caller must _remain_ non-swappable until after ! * calling segkp_unmap_red(). * * Currently, this routine is only called from pagefault() (which necessarily * satisfies the above conditions). */ #if defined(STACK_GROWTH_DOWN) --- 758,772 ---- /* * segkp_map_red() will check the current frame pointer against the * stack base. If the amount of stack remaining is questionable * (less than red_minavail), then segkp_map_red() will map in the redzone * and return 1. Otherwise, it will return 0. segkp_map_red() can ! * _only_ be called when it is safe to sleep on page_create_va(). * * It is up to the caller to remember whether segkp_map_red() successfully * mapped the redzone, and, if so, to call segkp_unmap_red() at a later ! * time. * * Currently, this routine is only called from pagefault() (which necessarily * satisfies the above conditions). */ #if defined(STACK_GROWTH_DOWN)
*** 780,791 **** uintptr_t fp = STACK_BIAS + (uintptr_t)getfp(); #ifndef _LP64 caddr_t stkbase; #endif - ASSERT(curthread->t_schedflag & TS_DONT_SWAP); - /* * Optimize for the common case where we simply return. */ if ((curthread->t_red_pp == NULL) && (fp - (uintptr_t)curthread->t_stkbase >= red_minavail)) --- 776,785 ----
*** 882,892 **** page_t *pp; caddr_t red_va = (caddr_t)(((uintptr_t)curthread->t_stkbase & (uintptr_t)PAGEMASK) - PAGESIZE); ASSERT(curthread->t_red_pp != NULL); - ASSERT(curthread->t_schedflag & TS_DONT_SWAP); /* * Because we locked the mapping down, we can't simply rely * on page_destroy() to clean everything up; we need to call * hat_unload() to explicitly unlock the mapping resources. --- 876,885 ----