From owner-cvs-all Sun Feb 9 0:40:50 2003 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 44A6E37B401; Sun, 9 Feb 2003 00:40:49 -0800 (PST) Received: from rwcrmhc51.attbi.com (rwcrmhc51.attbi.com [204.127.198.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id BFF9343F75; Sun, 9 Feb 2003 00:40:48 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org (12-232-168-4.client.attbi.com[12.232.168.4]) by rwcrmhc51.attbi.com (rwcrmhc51) with ESMTP id <20030209084042051007bivse>; Sun, 9 Feb 2003 08:40:43 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id AAA34573; Sun, 9 Feb 2003 00:40:41 -0800 (PST) Date: Sun, 9 Feb 2003 00:40:40 -0800 (PST) From: Julian Elischer To: Tim Robbins Cc: Bruce Evans , Julian Elischer , cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/sys proc.h src/sys/kern kern_clock.c In-Reply-To: <20030209192134.A10064@dilbert.robbins.dropbear.id.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, 9 Feb 2003, Tim Robbins wrote: > On Sat, Feb 08, 2003 at 10:06:46PM -0800, Julian Elischer wrote: > > [...] > > So it turns out the code is correct. > > Thanks for the explanation. It seems reasonable now. My other concern > is protecting addupc_{intr,task}() from profil() and also protecting > addupc_task() from itself. There is LOTS of room for improvement. We are just trying to get thing working in a threaded world. > > There's an splstatclock() call in profil() which was presumably there to > stop profil() from interfering with p_stats->p_prof while addupc_* were > running. Maybe we could have a spinlock in struct uprof to synchronise > access to it... that is one possibilty. > > I'm not entirely comfortable about this piece of code in the presence > of multiple threads, either. It looks like it could lose ticks. yes, on an MP machine it can. David and I discussed this but we decided that the problem is not high enough for us to work on yet.. (if ever :-) > addr = prof->pr_base + i; > if (copyin(addr, &v, sizeof(v)) == 0) { > v += ticks; > if (copyout(&v, addr, sizeof(v)) == 0) > > > Tim > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message