From owner-cvs-all@FreeBSD.ORG Mon Jul 23 22:14:51 2007 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 346DE16A417; Mon, 23 Jul 2007 22:14:51 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from anuket.mj.niksun.com (gwnew.niksun.com [65.115.46.162]) by mx1.freebsd.org (Postfix) with ESMTP id DCE8213C45B; Mon, 23 Jul 2007 22:14:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from niksun.com (anuket [10.70.0.5]) by anuket.mj.niksun.com (8.13.6/8.13.6) with ESMTP id l6NLogvF022823; Mon, 23 Jul 2007 17:50:42 -0400 (EDT) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Doug Barton Date: Mon, 23 Jul 2007 17:50:30 -0400 User-Agent: KMail/1.6.2 References: <200707231452.l6NEqMot074554@repoman.freebsd.org> <46A4F893.20609@FreeBSD.org> <46A515B9.6060608@FreeBSD.org> In-Reply-To: <46A515B9.6060608@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200707231750.34776.jkim@FreeBSD.org> X-Virus-Scanned: ClamAV 0.90.2/3745/Mon Jul 23 17:01:34 2007 on anuket.mj.niksun.com X-Virus-Status: Clean Cc: Marcus Alves Grando , Attilio Rao , src-committers@FreeBSD.org, cvs-all@FreeBSD.org, cvs-src@FreeBSD.org Subject: Re: cvs commit: src/sys/kern kern_kse.c kern_thread.c src/sys/sys proc.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2007 22:14:51 -0000 On Monday 23 July 2007 04:55 pm, Doug Barton wrote: > Marcus Alves Grando wrote: > > Attilio Rao wrote: > >> attilio 2007-07-23 14:52:22 UTC > >> > >> FreeBSD src repository > >> > >> Modified files: > >> sys/kern kern_kse.c kern_thread.c > >> sys/sys proc.h Log: > >> Actually, KSE kernel bits locking is broken and can lead > >> likely to dangerous races. > >> Fix this problems adding correct locking for the members of > >> 'struct kse_upcall' and other struct proc/struct thread related > >> members. For the moment, just leave ku_mflag and ku_flags "lazy" > >> locked. While here, cleanup the code removing the function > >> kse_GC() (unused), and merging upcall_link(), upcall_unlink(), > >> upcall_stash() in their respective callers (static functions, > >> very short and only called in one place). > >> Reported by: pav > >> Tested by: pav (on some pointyhat cluster nodes) > >> Approved by: jeff > >> Approved by: re > >> Sponsorized by: NGX Italy (http://www.ngx.it) > >> Revision Changes Path > >> 1.232 +69 -82 src/sys/kern/kern_kse.c > >> 1.251 +2 -0 src/sys/kern/kern_thread.c > >> 1.488 +0 -1 src/sys/sys/proc.h > >> _______________________________________________ > >> cvs-src@freebsd.org mailing list > >> http://lists.freebsd.org/mailman/listinfo/cvs-src > >> To unsubscribe, send any mail to > >> "cvs-src-unsubscribe@freebsd.org" > >> > >> ------------------------------------------------------ > >> http://www.FreeBSD.org/cgi/cvsweb.cgi/src/sys/kern/kern_kse.c.di > >>ff?&r1=1.231&r2=1.232 > >> > >> http://www.FreeBSD.org/cgi/cvsweb.cgi/src/sys/kern/kern_thread.c > >>.diff?&r1=1.250&r2=1.251 > >> > >> http://www.FreeBSD.org/cgi/cvsweb.cgi/src/sys/sys/proc.h.diff?&r > >>1=1.487&r2=1.488 > > > > Wno-pointer-sign -fformat-extensions -nostdinc -I. > > -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL > > -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common > > -finline-limit=8000 --param inline-unit-growth=100 --param > > large-function-growth=1000 -mno-align-long-strings > > -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse > > -mno-sse2 -mno-sse3 -ffreestanding -Werror > > /usr/src/sys/kern/kern_kse.c > > cc1: warnings being treated as errors > > /usr/src/sys/kern/kern_kse.c:87: warning: 'upcall_free' defined > > but not used > > *** Error code 1 > > Me Too. Removing the prototype and the function definition got the > kernel to compile, but I'm a little scared to boot it. :) Probably it should be something like this? @@ -60,9 +60,6 @@ extern struct mtx kse_lock; -TAILQ_HEAD(, kse_upcall) zombie_upcalls = - TAILQ_HEAD_INITIALIZER(zombie_upcalls); - static int thread_update_usr_ticks(struct thread *td); static void thread_alloc_spare(struct thread *td); static struct thread *thread_schedule_upcall(struct thread *td, struct kse_upcall *ku); @@ -106,7 +103,7 @@ td->td_upcall->ku_owner = NULL; TAILQ_REMOVE(&td->td_upcall->ku_proc->p_upcalls, td->td_upcall, ku_link); - TAILQ_INSERT_HEAD(&zombie_upcalls, td->td_upcall, ku_link); + upcall_free(td->td_upcall); mtx_unlock_spin(&kse_lock); td->td_upcall = NULL; } --------------------- Jung-uk Kim