From owner-p4-projects Fri May 3 7:52: 7 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5C39037B405; Fri, 3 May 2002 07:51:57 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 8724737B400 for ; Fri, 3 May 2002 07:51:56 -0700 (PDT) Received: (from perforce@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g43Epu600512 for perforce@freebsd.org; Fri, 3 May 2002 07:51:56 -0700 (PDT) (envelope-from mini@freebsd.org) Date: Fri, 3 May 2002 07:51:56 -0700 (PDT) Message-Id: <200205031451.g43Epu600512@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to mini@freebsd.org using -f From: Jonathan Mini Subject: PERFORCE change 10740 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=10740 Change 10740 by mini@mini_stylus on 2002/05/03 07:51:09 - Change thread_get(void) -> thread_alloc(void) to keep from conflicting with thread_get(struct proc *) in sys/kerne/kern_proc.c. - uma_zalloc(,M_WAITOK) will never return NULL, so don't bother testing for it. Affected files ... ... //depot/projects/kse/sys/kern/kern_fork.c#62 edit ... //depot/projects/kse/sys/kern/kern_thread.c#43 edit ... //depot/projects/kse/sys/sys/proc.h#97 edit Differences ... ==== //depot/projects/kse/sys/kern/kern_fork.c#62 (text+ko) ==== @@ -346,7 +346,7 @@ thread_single_end(); return (EAGAIN); } - td2 = thread_get(); + td2 = thread_alloc(); if (td2 == NULL) { uma_zfree(proc_zone, p2); nprocs--; ==== //depot/projects/kse/sys/kern/kern_thread.c#43 (text+ko) ==== @@ -142,7 +142,7 @@ * create one from the zone as per normal */ struct thread * -thread_get(void) +thread_alloc(void) { struct thread *td; @@ -155,15 +155,10 @@ } else { /* allocate the thread structure itself */ td = uma_zalloc(thread_zone, M_WAITOK); - - /* assuming we got one, allocate pages for the stack it needs */ - if (td) { - allocated_threads++; - pmap_new_thread(td); - cpu_thread_setup(td); - } else { - return (NULL); - } + + allocated_threads++; + pmap_new_thread(td); + cpu_thread_setup(td); } /* may need to set some stuff here.. re state? */ /* Make sure the zero'd section is in fact zero'd */ @@ -319,7 +314,7 @@ { struct thread *td2; - td2 = thread_get(); + td2 = thread_alloc(); if (td2) { CTR3(KTR_PROC, "thread_schedule_upcall: thread %p (pid %d, %s)", td, td->td_proc->p_pid, td->td_proc->p_comm); ==== //depot/projects/kse/sys/sys/proc.h#97 (text+ko) ==== @@ -797,7 +797,7 @@ int cpu_coredump(struct thread *, struct vnode *, struct ucred *); /* new in KSE */ -struct thread *thread_get(void); +struct thread *thread_alloc(void); void thread_free(struct thread *td); int cpu_export_context(struct thread *td); void cpu_free_kse_mdstorage(struct kse *kse); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message