Trace

Still requires a few fixes, but the main part is done.
I think you can do it much simpler. I really don't like linked lists of ints on top of arrays.

You need:

struct kt_thr_pool_s {
	kt_cache_t		cache;
	list_head		quarantine;
	int			quarantine_size;
	spinlock_t		lock;
};

To allocate a thread:
if quarantine_size > N, pop from quarantine list
otherwise allocate from cache

To deallocate a thread:
push it into quarantine list