From owner-cvs-all@FreeBSD.ORG Tue Jul 24 10:03:08 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 89AA616A46B for ; Tue, 24 Jul 2007 10:03:08 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from ik-out-1112.google.com (ik-out-1112.google.com [66.249.90.177]) by mx1.freebsd.org (Postfix) with ESMTP id D6B8B13C46C for ; Tue, 24 Jul 2007 10:03:07 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by ik-out-1112.google.com with SMTP id c21so1536619ika for ; Tue, 24 Jul 2007 03:03:06 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=opXKh9OOiIBm4K5/mk9CUc5XjNePQ8ZNmlbttq+fHHcP6zOYuFMoD3H32/fhLPE7mVpkrs0qmyrhIbPZ8NIq2gVKPVEJ3NudPcc7rtm0W5Z/8mAO+h4WubBXhFKqTSEi8Byx9D8+IXVhVSL1hM92+3TIb8Fuzcv04I9j42wcWvs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=EgIeRO+gZbZ1lN7hb06JXbTVytXbpzjLMBtdHI3HqQq5SIrf2tDSvTqvxwMzXOFEAFTiLjOkKKMD0GP7x9PGruFhAE/I+hJM3qvd+9W3NNUr+F7fMiv56mRLMkCymEBIUQZElIsBwen4d9KqIEtK9qe33b7RwECFxmasJRdEuV4= Received: by 10.78.183.8 with SMTP id g8mr1030528huf.1185271386120; Tue, 24 Jul 2007 03:03:06 -0700 (PDT) Received: by 10.78.120.9 with HTTP; Tue, 24 Jul 2007 03:03:06 -0700 (PDT) Message-ID: <3bbf2fe10707240303k584be666n5d721ca099c1e490@mail.gmail.com> Date: Tue, 24 Jul 2007 12:03:06 +0200 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Jung-uk Kim" In-Reply-To: <200707231750.34776.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200707231452.l6NEqMot074554@repoman.freebsd.org> <46A4F893.20609@FreeBSD.org> <46A515B9.6060608@FreeBSD.org> <200707231750.34776.jkim@FreeBSD.org> X-Google-Sender-Auth: 9d482d051600439d Cc: Marcus Alves Grando , cvs-src@freebsd.org, Doug Barton , src-committers@freebsd.org, cvs-all@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: Tue, 24 Jul 2007 10:03:08 -0000 2007/7/23, Jung-uk Kim : > > 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; > } This patch is not going to work as you call upcall_free (which uses uma_zfree()) with necessary a spinlock held (td_upcall is thread spinlock protected). UMA has its own locking stuffs in it (as sleepable locks) so this will create locks mismatches. Even if you could avoid it with rearrangement (probailly) I'm going to ripristinate the old way of cleaning up stuffs in thread_reap() through an ad-hoc upcall_reap() function. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein