From owner-p4-projects@FreeBSD.ORG Mon Jul 3 05:34:35 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5BD3716A407; Mon, 3 Jul 2006 05:34:35 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1EA4816A416 for ; Mon, 3 Jul 2006 05:34:35 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA86843D48 for ; Mon, 3 Jul 2006 05:34:34 +0000 (GMT) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k635YYBw034704 for ; Mon, 3 Jul 2006 05:34:34 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k635YW4r034701 for perforce@freebsd.org; Mon, 3 Jul 2006 05:34:32 GMT (envelope-from kmacy@freebsd.org) Date: Mon, 3 Jul 2006 05:34:32 GMT Message-Id: <200607030534.k635YW4r034701@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 100459 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jul 2006 05:34:35 -0000 http://perforce.freebsd.org/chv.cgi?CH=100459 Change 100459 by kmacy@kmacy_storage:sun4v_work_stable on 2006/07/03 05:33:59 integrate bike_sched branch - Initially bike_sched was interesting to sun4v in that it simplifies scheduling - facilitating the fine-grained locking we'll need to scale past 4 cpus - A much bigger benefit is in fact that signals now appear to work reliably - without bike_sched thread processes almost uniformly become unkillable when sent a signal Affected files ... .. //depot/projects/kmacy_sun4v_stable/src/sys/amd64/amd64/machdep.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/amd64/amd64/trap.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/amd64/amd64/vm_machdep.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/arm/arm/trap.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/arm/arm/vm_machdep.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/arm/at91/kb920x_machdep.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/arm/sa11x0/assabet_machdep.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/arm/xscale/i80321/iq31244_machdep.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/boot/sparc64/loader/main.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/conf/files#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/conf/options#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/ddb/db_ps.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/dev/ata/ata-all.h#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/dev/em/if_em.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/dev/isp/isp_pci.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/dev/mpt/mpt_pci.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/dev/ofw/openfirm.h#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/dev/pci/pci_pci.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/dev/pci/pcireg.h#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/dev/usb/ohci_pci.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/i386/i386/intr_machdep.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/i386/i386/local_apic.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/i386/i386/machdep.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/i386/i386/sys_machdep.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/i386/i386/trap.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/i386/i386/vm_machdep.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/i386/include/apicvar.h#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/i386/include/intr_machdep.h#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/i386/isa/atpic.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/ia64/ia64/machdep.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/ia64/ia64/trap.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/init_main.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/init_sysent.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/kern_clock.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/kern_fork.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/kern_idle.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/kern_intr.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/kern_kse.c#2 delete .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/kern_mutex.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/kern_poll.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/kern_proc.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/kern_resource.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/kern_sig.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/kern_subr.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/kern_switch.c#3 edit .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/kern_synch.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/kern_thr.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/kern_thread.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/sched_4bsd.c#5 edit .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/sched_core.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/sched_ule.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/subr_bus.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/subr_rman.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/subr_trap.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/sys_process.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/syscalls.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/syscalls.master#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/kern/tty.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/pc98/pc98/machdep.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/posix4/ksched.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/powerpc/powerpc/machdep.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/powerpc/powerpc/trap.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/sparc64/sparc64/machdep.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/sparc64/sparc64/trap.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/sun4v/machdep.c#3 edit .. //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/sun4v/trap.c#2 edit .. //depot/projects/kmacy_sun4v_stable/src/sys/sys/bus.h#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/sys/lock.h#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/sys/mutex.h#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/sys/proc.h#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/sys/rtprio.h#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/sys/sched.h#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/sys/syscall.h#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/sys/syscall.mk#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/sys/sysproto.h#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/ufs/ffs/ffs_vfsops.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/vm/swap_pager.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/vm/vm_glue.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/vm/vm_meter.c#4 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/vm/vm_pageq.c#3 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/vm/vm_zeroidle.c#2 integrate Differences ... ==== //depot/projects/kmacy_sun4v_stable/src/sys/amd64/amd64/machdep.c#3 (text+ko) ==== @@ -1137,7 +1137,7 @@ * This may be done better later if it gets more high level * components in it. If so just link td->td_proc here. */ - proc_linkup(&proc0, &ksegrp0, &thread0); + proc_linkup(&proc0, &thread0); preload_metadata = (caddr_t)(uintptr_t)(modulep + KERNBASE); preload_bootstrap_relocate(KERNBASE); ==== //depot/projects/kmacy_sun4v_stable/src/sys/amd64/amd64/trap.c#3 (text+ko) ==== @@ -301,8 +301,6 @@ case T_PAGEFLT: /* page fault */ addr = frame.tf_addr; - if (td->td_pflags & TDP_SA) - thread_user_enter(td); i = trap_pfault(&frame, TRUE); if (i == -1) goto userout; @@ -753,8 +751,6 @@ td->td_frame = &frame; if (td->td_ucred != p->p_ucred) cred_update_thread(td); - if (p->p_flag & P_SA) - thread_user_enter(td); params = (caddr_t)frame.tf_rsp + sizeof(register_t); code = frame.tf_rax; orig_tf_rflags = frame.tf_rflags; ==== //depot/projects/kmacy_sun4v_stable/src/sys/amd64/amd64/vm_machdep.c#2 (text+ko) ==== @@ -244,8 +244,7 @@ * Initialize machine state (pcb and trap frame) for a new thread about to * upcall. Put enough state in the new thread's PCB to get it to go back * userret(), where we can intercept it again to set the return (upcall) - * Address and stack, along with those from upcals that are from other sources - * such as those generated in thread_userret() itself. + * Address and stack, along with those from upcals that are from other sources. */ void cpu_set_upcall(struct thread *td, struct thread *td0) @@ -302,24 +301,14 @@ } /* - * Set that machine state for performing an upcall that has to - * be done in thread_userret() so that those upcalls generated - * in thread_userret() itself can be done as well. + * Modify the machine state created by cpu_set_upcall() to arrange + * for the new thread to make a specific call as its first act. */ void cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg, stack_t *stack) { - /* - * Do any extra cleaning that needs to be done. - * The thread may have optional components - * that are not present in a fresh thread. - * This may be a recycled thread so make it look - * as though it's newly allocated. - */ - cpu_thread_clean(td); - /* * Set the trap frame to point at the beginning of the uts * function. ==== //depot/projects/kmacy_sun4v_stable/src/sys/arm/arm/trap.c#2 (text+ko) ==== @@ -264,8 +264,6 @@ td->td_frame = tf; if (td->td_ucred != td->td_proc->p_ucred) cred_update_thread(td); - if (td->td_pflags & TDP_SA) - thread_user_enter(td); } /* Grab the current pcb */ @@ -731,8 +729,6 @@ td->td_frame = tf; if (td->td_ucred != td->td_proc->p_ucred) cred_update_thread(td); - if (td->td_proc->p_flag & P_SA) - thread_user_enter(td); } fault_pc = tf->tf_pc; if (td->td_md.md_spinlock_count == 0) { @@ -1004,8 +1000,6 @@ td->td_frame = frame; td->td_pticks = 0; - if (td->td_proc->p_flag & P_SA) - thread_user_enter(td); /* * Make sure the program counter is correctly aligned so we * don't take an alignment fault trying to read the opcode. ==== //depot/projects/kmacy_sun4v_stable/src/sys/arm/arm/vm_machdep.c#3 (text+ko) ==== @@ -256,8 +256,7 @@ * Initialize machine state (pcb and trap frame) for a new thread about to * upcall. Put enough state in the new thread's PCB to get it to go back * userret(), where we can intercept it again to set the return (upcall) - * Address and stack, along with those from upcals that are from other sources - * such as those generated in thread_userret() itself. + * Address and stack, along with those from upcals that are from other sources. */ void cpu_set_upcall(struct thread *td, struct thread *td0) @@ -283,9 +282,8 @@ } /* - * Set that machine state for performing an upcall that has to - * be done in thread_userret() so that those upcalls generated - * in thread_userret() itself can be done as well. + * Modify the machine state created by cpu_set_upcall() to arrange + * for the new thread to make a specific call as its first act. */ void cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg, ==== //depot/projects/kmacy_sun4v_stable/src/sys/arm/at91/kb920x_machdep.c#3 (text+ko) ==== @@ -398,7 +398,7 @@ undefined_handler_address = (u_int)undefinedinstruction_bounce; undefined_init(); - proc_linkup(&proc0, &ksegrp0, &thread0); + proc_linkup(&proc0, &thread0); thread0.td_kstack = kernelstack.pv_va; thread0.td_pcb = (struct pcb *) (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; ==== //depot/projects/kmacy_sun4v_stable/src/sys/arm/sa11x0/assabet_machdep.c#3 (text+ko) ==== @@ -423,7 +423,7 @@ /* Set stack for exception handlers */ - proc_linkup(&proc0, &ksegrp0, &thread0); + proc_linkup(&proc0, &thread0); thread0.td_kstack = kernelstack.pv_va; thread0.td_pcb = (struct pcb *) (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; ==== //depot/projects/kmacy_sun4v_stable/src/sys/arm/xscale/i80321/iq31244_machdep.c#3 (text+ko) ==== @@ -427,7 +427,7 @@ undefined_handler_address = (u_int)undefinedinstruction_bounce; undefined_init(); - proc_linkup(&proc0, &ksegrp0, &thread0); + proc_linkup(&proc0, &thread0); thread0.td_kstack = kernelstack.pv_va; thread0.td_pcb = (struct pcb *) (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; ==== //depot/projects/kmacy_sun4v_stable/src/sys/boot/sparc64/loader/main.c#2 (text+ko) ==== ==== //depot/projects/kmacy_sun4v_stable/src/sys/conf/files#3 (text+ko) ==== @@ -1283,7 +1283,6 @@ kern/kern_idle.c standard kern/kern_intr.c standard kern/kern_jail.c standard -kern/kern_kse.c standard kern/kern_kthread.c standard kern/kern_ktr.c optional ktr kern/kern_ktrace.c standard ==== //depot/projects/kmacy_sun4v_stable/src/sys/conf/options#3 (text+ko) ==== ==== //depot/projects/kmacy_sun4v_stable/src/sys/ddb/db_ps.c#2 (text+ko) ==== @@ -295,7 +295,6 @@ db_printf("Thread %d at %p:\n", td->td_tid, td); db_printf(" proc (pid %d): %p ", td->td_proc->p_pid, td->td_proc); - db_printf(" ksegrp: %p\n", td->td_ksegrp); if (td->td_name[0] != '\0') db_printf(" name: %s\n", td->td_name); db_printf(" flags: %#x ", td->td_flags); ==== //depot/projects/kmacy_sun4v_stable/src/sys/dev/ata/ata-all.h#3 (text+ko) ==== ==== //depot/projects/kmacy_sun4v_stable/src/sys/dev/em/if_em.c#3 (text+ko) ==== ==== //depot/projects/kmacy_sun4v_stable/src/sys/dev/isp/isp_pci.c#3 (text+ko) ==== ==== //depot/projects/kmacy_sun4v_stable/src/sys/dev/mpt/mpt_pci.c#3 (text+ko) ==== ==== //depot/projects/kmacy_sun4v_stable/src/sys/dev/ofw/openfirm.h#2 (text+ko) ==== ==== //depot/projects/kmacy_sun4v_stable/src/sys/dev/pci/pci_pci.c#2 (text+ko) ==== ==== //depot/projects/kmacy_sun4v_stable/src/sys/dev/pci/pcireg.h#3 (text+ko) ==== ==== //depot/projects/kmacy_sun4v_stable/src/sys/dev/usb/ohci_pci.c#3 (text+ko) ==== ==== //depot/projects/kmacy_sun4v_stable/src/sys/i386/i386/intr_machdep.c#2 (text+ko) ==== @@ -60,9 +60,10 @@ typedef void (*mask_fn)(void *); static int intrcnt_index; -static struct intsrc *interrupt_sources[NUM_IO_INTS]; static struct mtx intr_table_lock; +struct intsrc *interrupt_sources[NUM_IO_INTS]; + #ifdef SMP static int assign_cpu; @@ -166,12 +167,12 @@ } void -intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame) +intr_execute_handlers(struct intsrc *isrc, u_int vector, struct trapframe *frame) { struct thread *td; struct intr_event *ie; struct intr_handler *ih; - int error, vector, thread; + int error, thread; td = curthread; @@ -190,7 +191,6 @@ * XXX: We assume that IRQ 0 is only used for the ISA timer * device (clk). */ - vector = isrc->is_pic->pic_vector(isrc); if (vector == 0) clkintr_pending = 1; ==== //depot/projects/kmacy_sun4v_stable/src/sys/i386/i386/local_apic.c#2 (text+ko) ==== @@ -601,10 +601,11 @@ { struct intsrc *isrc; - if (vector == -1) - panic("Couldn't get vector from ISR!"); - isrc = intr_lookup_source(apic_idt_to_irq(vector)); - intr_execute_handlers(isrc, &frame); + KASSERT(vector >= APIC_IO_INTS && vector != IDT_SYSCALL && + vector <= APIC_IO_INTS + APIC_NUM_IOINTS, + ("Vector %u does not map to an IRQ line", vector)); + isrc = interrupt_sources[ioint_irqs[vector - APIC_IO_INTS]]; + intr_execute_handlers(isrc, vector, &frame); } void @@ -740,17 +741,6 @@ mtx_unlock_spin(&icu_lock); } -/* Map an IDT vector (APIC) to an IRQ (interrupt source). */ -u_int -apic_idt_to_irq(u_int vector) -{ - - KASSERT(vector >= APIC_IO_INTS && vector != IDT_SYSCALL && - vector <= APIC_IO_INTS + APIC_NUM_IOINTS, - ("Vector %u does not map to an IRQ line", vector)); - return (ioint_irqs[vector - APIC_IO_INTS]); -} - #ifdef DDB /* * Dump data about APIC IDT vector mappings. ==== //depot/projects/kmacy_sun4v_stable/src/sys/i386/i386/machdep.c#3 (text+ko) ==== @@ -2071,7 +2071,7 @@ * This may be done better later if it gets more high level * components in it. If so just link td->td_proc here. */ - proc_linkup(&proc0, &ksegrp0, &thread0); + proc_linkup(&proc0, &thread0); metadata_missing = 0; if (bootinfo.bi_modulep) { ==== //depot/projects/kmacy_sun4v_stable/src/sys/i386/i386/sys_machdep.c#2 (text+ko) ==== @@ -233,9 +233,6 @@ 0 /* granularity */ }; - if (td->td_proc->p_flag & P_SA) - return (EINVAL); /* XXXKSE */ -/* XXXKSE All the code below only works in 1:1 needs changing */ ext = (struct pcb_ext *)kmem_alloc(kernel_map, ctob(IOPAGES+1)); if (ext == 0) return (ENOMEM); ==== //depot/projects/kmacy_sun4v_stable/src/sys/i386/i386/trap.c#3 (text+ko) ==== @@ -348,9 +348,6 @@ break; case T_PAGEFLT: /* page fault */ - if (td->td_pflags & TDP_SA) - thread_user_enter(td); - i = trap_pfault(&frame, TRUE, eva); #if defined(I586_CPU) && !defined(NO_F00F_HACK) if (i == -2) { @@ -937,8 +934,6 @@ td->td_frame = &frame; if (td->td_ucred != p->p_ucred) cred_update_thread(td); - if (p->p_flag & P_SA) - thread_user_enter(td); params = (caddr_t)frame.tf_esp + sizeof(int); code = frame.tf_eax; orig_tf_eflags = frame.tf_eflags; ==== //depot/projects/kmacy_sun4v_stable/src/sys/i386/i386/vm_machdep.c#3 (text+ko) ==== @@ -370,8 +370,7 @@ * Initialize machine state (pcb and trap frame) for a new thread about to * upcall. Put enough state in the new thread's PCB to get it to go back * userret(), where we can intercept it again to set the return (upcall) - * Address and stack, along with those from upcals that are from other sources - * such as those generated in thread_userret() itself. + * Address and stack, along with those from upcals that are from other sources. */ void cpu_set_upcall(struct thread *td, struct thread *td0) @@ -439,9 +438,8 @@ } /* - * Set that machine state for performing an upcall that has to - * be done in thread_userret() so that those upcalls generated - * in thread_userret() itself can be done as well. + * Modify the machine state created by cpu_set_upcall() to arrange + * for the new thread to make a specific call as its first act. */ void cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg, ==== //depot/projects/kmacy_sun4v_stable/src/sys/i386/include/apicvar.h#2 (text+ko) ==== @@ -176,7 +176,6 @@ u_int apic_alloc_vector(u_int irq); void apic_enable_vector(u_int vector); void apic_free_vector(u_int vector, u_int irq); -u_int apic_idt_to_irq(u_int vector); void apic_register_enumerator(struct apic_enumerator *enumerator); void *ioapic_create(uintptr_t addr, int32_t id, int intbase); int ioapic_disable_pin(void *cookie, u_int pin); ==== //depot/projects/kmacy_sun4v_stable/src/sys/i386/include/intr_machdep.h#2 (text+ko) ==== @@ -109,6 +109,8 @@ u_int is_enabled:1; }; +extern struct intsrc *interrupt_sources[NUM_IO_INTS]; + struct trapframe; extern struct mtx icu_lock; @@ -128,7 +130,8 @@ void *arg, enum intr_type flags, void **cookiep); int intr_config_intr(int vector, enum intr_trigger trig, enum intr_polarity pol); -void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame); +void intr_execute_handlers(struct intsrc *isrc, u_int vector, + struct trapframe *frame); struct intsrc *intr_lookup_source(int vector); int intr_register_source(struct intsrc *isrc); int intr_remove_handler(void *cookie); ==== //depot/projects/kmacy_sun4v_stable/src/sys/i386/isa/atpic.c#2 (text+ko) ==== @@ -580,7 +580,7 @@ if ((isr & IRQ_MASK(7)) == 0) return; } - intr_execute_handlers(isrc, &frame); + intr_execute_handlers(isrc, vector, &frame); } #ifdef DEV_ISA ==== //depot/projects/kmacy_sun4v_stable/src/sys/ia64/ia64/machdep.c#3 (text+ko) ==== @@ -775,7 +775,7 @@ msgbufp = (struct msgbuf *)pmap_steal_memory(MSGBUF_SIZE); msgbufinit(msgbufp, MSGBUF_SIZE); - proc_linkup(&proc0, &ksegrp0, &thread0); + proc_linkup(&proc0, &thread0); /* * Init mapping for kernel stack for proc 0 */ ==== //depot/projects/kmacy_sun4v_stable/src/sys/ia64/ia64/trap.c#3 (text+ko) ==== @@ -975,8 +975,6 @@ td->td_pticks = 0; if (td->td_ucred != p->p_ucred) cred_update_thread(td); - if (p->p_flag & P_SA) - thread_user_enter(td); if (p->p_sysent->sv_prepsyscall) { /* (*p->p_sysent->sv_prepsyscall)(tf, args, &code, ¶ms); */ ==== //depot/projects/kmacy_sun4v_stable/src/sys/kern/init_main.c#2 (text+ko) ==== @@ -95,7 +95,6 @@ static struct pgrp pgrp0; struct proc proc0; struct thread thread0 __aligned(8); -struct ksegrp ksegrp0; struct vmspace vmspace0; struct proc *initproc; @@ -249,6 +248,30 @@ } #endif +#if defined(VERBOSE_SYSINIT) + if ((*sipp)->subsystem > last) { + verbose = 1; + last = (*sipp)->subsystem; + printf("subsystem %x\n", last); + } + if (verbose) { +#if defined(DDB) + const char *name; + c_db_sym_t sym; + db_expr_t offset; + + sym = db_search_symbol((vm_offset_t)(*sipp)->func, + DB_STGY_PROC, &offset); + db_symbol_values(sym, &name, NULL); + if (name != NULL) + printf(" %s(%p)... ", name, (*sipp)->udata); + else +#endif + printf(" %p(%p)... ", (*sipp)->func, + (*sipp)->udata); + } +#endif + /* Call function */ (*((*sipp)->func))((*sipp)->udata); #if 0 @@ -261,6 +284,11 @@ printf("done.\n"); #endif +#if defined(VERBOSE_SYSINIT) + if (verbose) + printf("done.\n"); +#endif + /* Check off the one we're just done */ (*sipp)->subsystem = SI_SUB_DONE; @@ -369,12 +397,10 @@ struct proc *p; unsigned i; struct thread *td; - struct ksegrp *kg; GIANT_REQUIRED; p = &proc0; td = &thread0; - kg = &ksegrp0; /* * Initialize magic number. @@ -382,14 +408,14 @@ p->p_magic = P_MAGIC; /* - * Initialize thread, process and ksegrp structures. + * Initialize thread and process structures. */ procinit(); /* set up proc zone */ - threadinit(); /* set up thead, upcall and KSEGRP zones */ + threadinit(); /* set up UMA zones */ /* * Initialise scheduler resources. - * Add scheduler specific parts to proc, ksegrp, thread as needed. + * Add scheduler specific parts to proc, thread as needed. */ schedinit(); /* scheduler gets its house in order */ /* @@ -426,8 +452,8 @@ STAILQ_INIT(&p->p_ktr); p->p_nice = NZERO; td->td_state = TDS_RUNNING; - kg->kg_pri_class = PRI_TIMESHARE; - kg->kg_user_pri = PUSER; + td->td_pri_class = PRI_TIMESHARE; + td->td_user_pri = PUSER; td->td_priority = PVM; td->td_base_pri = PUSER; td->td_oncpu = 0; ==== //depot/projects/kmacy_sun4v_stable/src/sys/kern/init_sysent.c#2 (text+ko) ==== @@ -2,8 +2,8 @@ * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/kern/init_sysent.c,v 1.211 2006/03/23 08:48:37 davidxu Exp $ - * created from FreeBSD: src/sys/kern/syscalls.master,v 1.213 2006/03/23 08:46:41 davidxu Exp + * $FreeBSD$ + * created from FreeBSD: src/sys/kern/syscalls.master,v 1.215 2006/03/28 14:32:37 des Exp */ #include "opt_compat.h" @@ -408,11 +408,11 @@ { SYF_MPSAFE | AS(eaccess_args), (sy_call_t *)eaccess, AUE_EACCESS }, /* 376 = eaccess */ { 0, (sy_call_t *)nosys, AUE_NULL }, /* 377 = afs_syscall */ { AS(nmount_args), (sy_call_t *)nmount, AUE_NMOUNT }, /* 378 = nmount */ - { SYF_MPSAFE | 0, (sy_call_t *)kse_exit, AUE_NULL }, /* 379 = kse_exit */ - { SYF_MPSAFE | AS(kse_wakeup_args), (sy_call_t *)kse_wakeup, AUE_NULL }, /* 380 = kse_wakeup */ - { SYF_MPSAFE | AS(kse_create_args), (sy_call_t *)kse_create, AUE_NULL }, /* 381 = kse_create */ - { SYF_MPSAFE | AS(kse_thr_interrupt_args), (sy_call_t *)kse_thr_interrupt, AUE_NULL }, /* 382 = kse_thr_interrupt */ - { SYF_MPSAFE | AS(kse_release_args), (sy_call_t *)kse_release, AUE_NULL }, /* 383 = kse_release */ + { 0, (sy_call_t *)nosys, AUE_NULL }, /* 379 = kse_exit */ + { 0, (sy_call_t *)nosys, AUE_NULL }, /* 380 = kse_wakeup */ + { 0, (sy_call_t *)nosys, AUE_NULL }, /* 381 = kse_create */ + { 0, (sy_call_t *)nosys, AUE_NULL }, /* 382 = kse_thr_interrupt */ + { 0, (sy_call_t *)nosys, AUE_NULL }, /* 383 = kse_release */ { SYF_MPSAFE | AS(__mac_get_proc_args), (sy_call_t *)__mac_get_proc, AUE_NULL }, /* 384 = __mac_get_proc */ { SYF_MPSAFE | AS(__mac_set_proc_args), (sy_call_t *)__mac_set_proc, AUE_NULL }, /* 385 = __mac_set_proc */ { SYF_MPSAFE | AS(__mac_get_fd_args), (sy_call_t *)__mac_get_fd, AUE_NULL }, /* 386 = __mac_get_fd */ @@ -469,7 +469,7 @@ { SYF_MPSAFE | AS(extattr_list_fd_args), (sy_call_t *)extattr_list_fd, AUE_NULL }, /* 437 = extattr_list_fd */ { SYF_MPSAFE | AS(extattr_list_file_args), (sy_call_t *)extattr_list_file, AUE_NULL }, /* 438 = extattr_list_file */ { SYF_MPSAFE | AS(extattr_list_link_args), (sy_call_t *)extattr_list_link, AUE_NULL }, /* 439 = extattr_list_link */ - { SYF_MPSAFE | AS(kse_switchin_args), (sy_call_t *)kse_switchin, AUE_NULL }, /* 440 = kse_switchin */ + { 0, (sy_call_t *)nosys, AUE_NULL }, /* 440 = kse_switchin */ { SYF_MPSAFE | AS(ksem_timedwait_args), (sy_call_t *)lkmressys, AUE_NULL }, /* 441 = ksem_timedwait */ { SYF_MPSAFE | AS(thr_suspend_args), (sy_call_t *)thr_suspend, AUE_NULL }, /* 442 = thr_suspend */ { SYF_MPSAFE | AS(thr_wake_args), (sy_call_t *)thr_wake, AUE_NULL }, /* 443 = thr_wake */ ==== //depot/projects/kmacy_sun4v_stable/src/sys/kern/kern_clock.c#3 (text+ko) ==== @@ -202,21 +202,17 @@ */ mtx_lock_spin_flags(&sched_lock, MTX_QUIET); sched_tick(); - if (p->p_flag & P_SA) { - /* XXXKSE What to do? */ - } else { - pstats = p->p_stats; - if (usermode && - timevalisset(&pstats->p_timer[ITIMER_VIRTUAL].it_value) && - itimerdecr(&pstats->p_timer[ITIMER_VIRTUAL], tick) == 0) { - p->p_sflag |= PS_ALRMPEND; - td->td_flags |= TDF_ASTPENDING; - } - if (timevalisset(&pstats->p_timer[ITIMER_PROF].it_value) && - itimerdecr(&pstats->p_timer[ITIMER_PROF], tick) == 0) { - p->p_sflag |= PS_PROFPEND; - td->td_flags |= TDF_ASTPENDING; - } + pstats = p->p_stats; + if (usermode && + timevalisset(&pstats->p_timer[ITIMER_VIRTUAL].it_value) && + itimerdecr(&pstats->p_timer[ITIMER_VIRTUAL], tick) == 0) { + p->p_sflag |= PS_ALRMPEND; + td->td_flags |= TDF_ASTPENDING; + } + if (timevalisset(&pstats->p_timer[ITIMER_PROF].it_value) && + itimerdecr(&pstats->p_timer[ITIMER_PROF], tick) == 0) { + p->p_sflag |= PS_PROFPEND; + td->td_flags |= TDF_ASTPENDING; } mtx_unlock_spin_flags(&sched_lock, MTX_QUIET); @@ -414,8 +410,6 @@ /* * Charge the time as appropriate. */ - if (p->p_flag & P_SA) - thread_statclock(1); td->td_uticks++; if (p->p_nice > NZERO) cp_time[CP_NICE]++; @@ -439,8 +433,6 @@ td->td_iticks++; cp_time[CP_INTR]++; } else { - if (p->p_flag & P_SA) - thread_statclock(0); td->td_pticks++; td->td_sticks++; if (td != PCPU_GET(idlethread)) ==== //depot/projects/kmacy_sun4v_stable/src/sys/kern/kern_fork.c#3 (text+ko) ==== @@ -204,7 +204,6 @@ struct filedesc *fd; struct filedesc_to_leader *fdtol; struct thread *td2; - struct ksegrp *kg2; struct sigacts *newsigacts; int error; @@ -475,7 +474,6 @@ * then copy the section that is copied directly from the parent. */ td2 = FIRST_THREAD_IN_PROC(p2); - kg2 = FIRST_KSEGRP_IN_PROC(p2); /* Allocate and switch to an alternate kstack if specified. */ if (pages != 0) @@ -488,15 +486,11 @@ __rangeof(struct proc, p_startzero, p_endzero)); bzero(&td2->td_startzero, __rangeof(struct thread, td_startzero, td_endzero)); - bzero(&kg2->kg_startzero, - __rangeof(struct ksegrp, kg_startzero, kg_endzero)); bcopy(&p1->p_startcopy, &p2->p_startcopy, __rangeof(struct proc, p_startcopy, p_endcopy)); bcopy(&td->td_startcopy, &td2->td_startcopy, __rangeof(struct thread, td_startcopy, td_endcopy)); - bcopy(&td->td_ksegrp->kg_startcopy, &kg2->kg_startcopy, - __rangeof(struct ksegrp, kg_startcopy, kg_endcopy)); td2->td_sigstk = td->td_sigstk; td2->td_sigmask = td->td_sigmask; ==== //depot/projects/kmacy_sun4v_stable/src/sys/kern/kern_idle.c#3 (text+ko) ==== @@ -79,7 +79,7 @@ td = FIRST_THREAD_IN_PROC(p); TD_SET_CAN_RUN(td); atomic_set_int(&td->td_flags, TDF_IDLETD); - sched_class(td->td_ksegrp, PRI_IDLE); + sched_class(td, PRI_IDLE); sched_prio(td, PRI_MAX_IDLE); mtx_unlock_spin(&sched_lock); PROC_UNLOCK(p); ==== //depot/projects/kmacy_sun4v_stable/src/sys/kern/kern_intr.c#2 (text+ko) ==== @@ -296,7 +296,7 @@ panic("kthread_create() failed with %d", error); td = FIRST_THREAD_IN_PROC(p); /* XXXKSE */ mtx_lock_spin(&sched_lock); - td->td_ksegrp->kg_pri_class = PRI_ITHD; + td->td_pri_class = PRI_ITHD; TD_SET_IWAIT(td); mtx_unlock_spin(&sched_lock); td->td_pflags |= TDP_ITHREAD; @@ -531,7 +531,7 @@ CTR3(KTR_INTR, "%s: schedule pid %d (%s)", __func__, p->p_pid, p->p_comm); TD_CLR_IWAIT(td); - setrunqueue(td, SRQ_INTR); + sched_run_ithread(td); } else { CTR5(KTR_INTR, "%s: pid %d (%s): it_need %d, state %d", __func__, p->p_pid, p->p_comm, it->it_need, td->td_state); ==== //depot/projects/kmacy_sun4v_stable/src/sys/kern/kern_mutex.c#3 (text+ko) ==== ==== //depot/projects/kmacy_sun4v_stable/src/sys/kern/kern_poll.c#2 (text+ko) ==== @@ -581,7 +581,7 @@ rtp.prio = RTP_PRIO_MAX; /* lowest priority */ rtp.type = RTP_PRIO_IDLE; mtx_lock_spin(&sched_lock); - rtp_to_pri(&rtp, td->td_ksegrp); + rtp_to_pri(&rtp, td); mtx_unlock_spin(&sched_lock); for (;;) { ==== //depot/projects/kmacy_sun4v_stable/src/sys/kern/kern_proc.c#3 (text+ko) ==== @@ -142,9 +142,6 @@ { struct proc *p; struct thread *td; -#ifdef INVARIANTS - struct ksegrp *kg; -#endif /* INVARIANTS checks go here */ p = (struct proc *)mem; @@ -152,10 +149,7 @@ #ifdef INVARIANTS KASSERT((p->p_numthreads == 1), ("bad number of threads in exiting process")); - KASSERT((p->p_numksegrps == 1), ("free proc with > 1 ksegrp")); KASSERT((td != NULL), ("proc_dtor: bad thread pointer")); - kg = FIRST_KSEGRP_IN_PROC(p); - KASSERT((kg != NULL), ("proc_dtor: bad kg pointer")); KASSERT(STAILQ_EMPTY(&p->p_ktr), ("proc_dtor: non-empty p_ktr")); #endif @@ -178,17 +172,14 @@ { struct proc *p; struct thread *td; - struct ksegrp *kg; p = (struct proc *)mem; p->p_sched = (struct p_sched *)&p[1]; td = thread_alloc(); - kg = ksegrp_alloc(); bzero(&p->p_mtx, sizeof(struct mtx)); mtx_init(&p->p_mtx, "process lock", NULL, MTX_DEF | MTX_DUPOK); p->p_stats = pstats_alloc(); - proc_linkup(p, kg, td); - sched_newproc(p, kg, td); + proc_linkup(p, td); return (0); } @@ -204,7 +195,6 @@ p = (struct proc *)mem; pstats_free(p->p_stats); - ksegrp_free(FIRST_KSEGRP_IN_PROC(p)); thread_free(FIRST_THREAD_IN_PROC(p)); mtx_destroy(&p->p_mtx); if (p->p_ksi != NULL) @@ -760,7 +750,6 @@ static void fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp) { - struct ksegrp *kg; struct proc *p; p = td->td_proc; @@ -800,14 +789,6 @@ kp->ki_stat = SIDL; } - kg = td->td_ksegrp; - - /* things in the KSE GROUP */ - kp->ki_estcpu = kg->kg_estcpu; - kp->ki_slptime = kg->kg_slptime; - kp->ki_pri.pri_user = kg->kg_user_pri; - kp->ki_pri.pri_class = kg->kg_pri_class; - /* Things in the thread */ kp->ki_wchan = td->td_wchan; kp->ki_pri.pri_level = td->td_priority; @@ -820,6 +801,10 @@ kp->ki_pcb = td->td_pcb; kp->ki_kstack = (void *)td->td_kstack; kp->ki_pctcpu = sched_pctcpu(td); + kp->ki_estcpu = td->td_estcpu; + kp->ki_slptime = td->td_slptime; + kp->ki_pri.pri_class = td->td_pri_class; + kp->ki_pri.pri_user = td->td_user_pri; /* We can't get this anymore but ps etc never used it anyway. */ kp->ki_rqindex = 0; ==== //depot/projects/kmacy_sun4v_stable/src/sys/kern/kern_resource.c#2 (text+ko) ==== @@ -292,7 +292,7 @@ { struct proc *curp; struct proc *p; - struct ksegrp *kg; + struct thread *tdp; struct rtprio rtp; int cierror, error; @@ -328,14 +328,14 @@ * as leaving it zero. */ if (uap->pid == 0) { - pri_to_rtp(td->td_ksegrp, &rtp); + pri_to_rtp(td, &rtp); } else { struct rtprio rtp2; rtp.type = RTP_PRIO_IDLE; rtp.prio = RTP_PRIO_MAX; - FOREACH_KSEGRP_IN_PROC(p, kg) { - pri_to_rtp(kg, &rtp2); + FOREACH_THREAD_IN_PROC(p, tdp) { + pri_to_rtp(tdp, &rtp2); if (rtp2.type < rtp.type || (rtp2.type == rtp.type && rtp2.prio < rtp.prio)) { @@ -378,18 +378,17 @@ /* * If we are setting our own priority, set just our - * KSEGRP but if we are doing another process, - * do all the groups on that process. If we + * thread but if we are doing another process, + * do all the threads on that process. If we * specify our own pid we do the latter. */ mtx_lock_spin(&sched_lock); if (uap->pid == 0) { - error = rtp_to_pri(&rtp, td->td_ksegrp); + error = rtp_to_pri(&rtp, td); } else { - FOREACH_KSEGRP_IN_PROC(p, kg) { - if ((error = rtp_to_pri(&rtp, kg)) != 0) { + FOREACH_THREAD_IN_PROC(p, td) { + if ((error = rtp_to_pri(&rtp, td)) != 0) break; - } } } mtx_unlock_spin(&sched_lock); @@ -403,7 +402,7 @@ } int -rtp_to_pri(struct rtprio *rtp, struct ksegrp *kg) +rtp_to_pri(struct rtprio *rtp, struct thread *td) { mtx_assert(&sched_lock, MA_OWNED); @@ -411,43 +410,42 @@ return (EINVAL); switch (RTP_PRIO_BASE(rtp->type)) { case RTP_PRIO_REALTIME: - kg->kg_user_pri = PRI_MIN_REALTIME + rtp->prio; + td->td_user_pri = PRI_MIN_REALTIME + rtp->prio; break; case RTP_PRIO_NORMAL: - kg->kg_user_pri = PRI_MIN_TIMESHARE + rtp->prio; + td->td_user_pri = PRI_MIN_TIMESHARE + rtp->prio; break; case RTP_PRIO_IDLE: - kg->kg_user_pri = PRI_MIN_IDLE + rtp->prio; + td->td_user_pri = PRI_MIN_IDLE + rtp->prio; break; default: return (EINVAL); } - sched_class(kg, rtp->type); - if (curthread->td_ksegrp == kg) { - sched_prio(curthread, kg->kg_user_pri); /* XXX dubious */ - } + sched_class(td, rtp->type); /* XXX fix */ + if (curthread == td) + sched_prio(curthread, td->td_user_pri); /* XXX dubious */ return (0); } void -pri_to_rtp(struct ksegrp *kg, struct rtprio *rtp) +pri_to_rtp(struct thread *td, struct rtprio *rtp) { mtx_assert(&sched_lock, MA_OWNED); - switch (PRI_BASE(kg->kg_pri_class)) { + switch (PRI_BASE(td->td_pri_class)) { case PRI_REALTIME: - rtp->prio = kg->kg_user_pri - PRI_MIN_REALTIME; + rtp->prio = td->td_user_pri - PRI_MIN_REALTIME; break; case PRI_TIMESHARE: - rtp->prio = kg->kg_user_pri - PRI_MIN_TIMESHARE; + rtp->prio = td->td_user_pri - PRI_MIN_TIMESHARE; break; case PRI_IDLE: - rtp->prio = kg->kg_user_pri - PRI_MIN_IDLE; + rtp->prio = td->td_user_pri - PRI_MIN_IDLE; break; default: break; } - rtp->type = kg->kg_pri_class; + rtp->type = td->td_pri_class; } >>> TRUNCATED FOR MAIL (1000 lines) <<<