fix cpu affinity and stack to mmap