Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F141051235
D18486.id51848.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D18486.id51848.diff
View Options
Index: head/sys/kern/kern_thread.c
===================================================================
--- head/sys/kern/kern_thread.c
+++ head/sys/kern/kern_thread.c
@@ -197,7 +197,7 @@
td = (struct thread *)mem;
td->td_state = TDS_INACTIVE;
- td->td_oncpu = NOCPU;
+ td->td_lastcpu = td->td_oncpu = NOCPU;
td->td_tid = tid_alloc();
Index: head/sys/x86/x86/mp_x86.c
===================================================================
--- head/sys/x86/x86/mp_x86.c
+++ head/sys/x86/x86/mp_x86.c
@@ -1071,9 +1071,23 @@
/* NOTREACHED */
}
-/*******************************************************************
- * local functions and data
- */
+static void
+smp_after_idle_runnable(void *arg __unused)
+{
+ struct thread *idle_td;
+ int cpu;
+
+ for (cpu = 1; cpu < mp_ncpus; cpu++) {
+ idle_td = pcpu_find(cpu)->pc_idlethread;
+ while (idle_td->td_lastcpu == NOCPU &&
+ idle_td->td_oncpu == NOCPU)
+ cpu_spinwait();
+ kmem_free((vm_offset_t)bootstacks[cpu], kstack_pages *
+ PAGE_SIZE);
+ }
+}
+SYSINIT(smp_after_idle_runnable, SI_SUB_SMP, SI_ORDER_ANY,
+ smp_after_idle_runnable, NULL);
/*
* We tell the I/O APIC code about all the CPUs we want to receive
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 1, 5:46 AM (16 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27430604
Default Alt Text
D18486.id51848.diff (1 KB)
Attached To
Mode
D18486: Free bootstacks after AP startup.
Attached
Detach File
Event Timeline
Log In to Comment