From owner-cvs-src@FreeBSD.ORG Tue Jul 24 10:04:46 2007 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B1CA16A420 for ; Tue, 24 Jul 2007 10:04:46 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.225]) by mx1.freebsd.org (Postfix) with ESMTP id DF8B613C46B for ; Tue, 24 Jul 2007 10:04:43 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by wr-out-0506.google.com with SMTP id i21so1138541wra for ; Tue, 24 Jul 2007 03:04:43 -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=AIj2UKuKAFPFQNKIVHZ4R7XxQGGZobkJykJ7vtbPjPa710P8Bbyq8X0a+5ORyJV3VC61Umqq0qKUcgipQGONHrs6RGvId0GctO6oXOW777Q1CbwGpEEElU0r9AajLrXJ601RHeTNpOEIZMB8GC6lA63nRz6IxWQoLU9vGW37T68= 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=hit+dc//JNG/zbCypRXuTxNJ7FhosWPydKp/6Zass7zwS2Mif6XT5lDWDYzyB90t+w/NYNSBowR/tjP4zUvZCFD8jNDFiSb42krKHCphUN3Lmv1XNYT8RKPc4omIAOEG+Z4UUe6Am9t5qAzG8JJsXX0jAMTXYHWnwL8ylCRwxnE= Received: by 10.78.180.18 with SMTP id c18mr1033046huf.1185271481658; Tue, 24 Jul 2007 03:04:41 -0700 (PDT) Received: by 10.78.120.9 with HTTP; Tue, 24 Jul 2007 03:04:41 -0700 (PDT) Message-ID: <3bbf2fe10707240304l76066c6sede74f72115988d7@mail.gmail.com> Date: Tue, 24 Jul 2007 12:04:41 +0200 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Jung-uk Kim" In-Reply-To: <3bbf2fe10707240303k584be666n5d721ca099c1e490@mail.gmail.com> 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> <3bbf2fe10707240303k584be666n5d721ca099c1e490@mail.gmail.com> X-Google-Sender-Auth: 9083a0a3575daa8e 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-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2007 10:04:46 -0000 2007/7/24, Attilio Rao : > 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. Just for records: it seems that the upcall freeing removal has happened after revision 1.238 (so just after the splitting up of the KSE parts from the rest of the kernel). It is so a long-standing bug, it seems. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein