From ef5f88c3578682534931b6958f99bdc1a6a33869 Mon Sep 17 00:00:00 2001 From: kib Date: Sun, 5 Jun 2016 17:04:03 +0000 Subject: Get rid of struct proc p_sched and struct thread td_sched pointers. p_sched is unused. The struct td_sched is always co-allocated with the struct thread, except for the thread0. Avoid useless indirection, instead calculate td_sched location using simple pointer arithmetic in td_get_sched(9). For thread0, which is statically allocated, create a structure to emulate layout of the dynamic allocation. Reviewed by: jhb (previous version) Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D6711 --- sys/kern/kern_thread.c | 1 - 1 file changed, 1 deletion(-) (limited to 'sys/kern/kern_thread.c') diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 21f3587..9af377e 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -211,7 +211,6 @@ thread_init(void *mem, int size, int flags) td->td_turnstile = turnstile_alloc(); td->td_rlqe = NULL; EVENTHANDLER_INVOKE(thread_init, td); - td->td_sched = (struct td_sched *)&td[1]; umtx_thread_init(td); td->td_kstack = 0; td->td_sel = NULL; -- cgit v1.1