vmm: Use a task_thread cache
authorBarret Rhoden <brho@cs.berkeley.edu>
Mon, 31 Jul 2017 19:33:05 +0000 (15:33 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Mon, 31 Jul 2017 19:50:45 +0000 (15:50 -0400)
commit6cc368cabfe55c785adac2b285cf21b303e57ff3
treeea4a17bc77f4ee5cbb543ed0538606dfba0e35dc
parent82a9875237199c9b54d91a1b0bb03dd045699603
vmm: Use a task_thread cache

We actually run a lot of tasks now - one for every timer tick on every
guest core.  That's a lot of thread creation/destruction - you can see the
mmaps and munmaps with strace, and each munmap involves a tlb_shootdown
broadcast.

With a slab allocator, we can avoid all of that, especially the thread
initialization that involves the stack mmap/munmap.  Object reuse is
basically the lesson of the slab allocator.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
user/vmm/sched.c