From owner-freebsd-smp Sat Feb 15 15: 7:34 2003 Delivered-To: freebsd-smp@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9AF1B37B401; Sat, 15 Feb 2003 15:07:33 -0800 (PST) Received: from k6.locore.ca (k6.locore.ca [198.96.117.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id BDB7F43F75; Sat, 15 Feb 2003 15:07:32 -0800 (PST) (envelope-from jake@k6.locore.ca) Received: from k6.locore.ca (jake@localhost.locore.ca [127.0.0.1]) by k6.locore.ca (8.12.6/8.12.6) with ESMTP id h1FNAfNk074596; Sat, 15 Feb 2003 18:10:41 -0500 (EST) (envelope-from jake@k6.locore.ca) Received: (from jake@localhost) by k6.locore.ca (8.12.6/8.12.6/Submit) id h1FNAfBH074595; Sat, 15 Feb 2003 18:10:41 -0500 (EST) Date: Sat, 15 Feb 2003 18:10:41 -0500 From: Jake Burkholder To: Tim Robbins Cc: freebsd-smp@FreeBSD.ORG Subject: Re: Locking down itimers Message-ID: <20030215181041.K63597@locore.ca> References: <20030215154024.A53601@dilbert.robbins.dropbear.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20030215154024.A53601@dilbert.robbins.dropbear.id.au>; from tjr@FreeBSD.ORG on Sat, Feb 15, 2003 at 03:40:24PM +1100 Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Apparently, On Sat, Feb 15, 2003 at 03:40:24PM +1100, Tim Robbins said words to the effect of; > This patch protects p_realtimer with the proc mutex instead of Giant, > and obtains sched_lock around accesses to p_stats->p_timer[] to avoid > a potential race with hardclock. It makes getitimer(), setitimer() > and the realitexpire() callout MP-safe. > > It was necessary to restructure setitimer() a bit to guarantee that > the swap: > ovalue = p_realtimer, p_realtimer = value; > occurs atomically with respect to other threads in the same process > calling setitimer() and the callout. > > Does the patch seem reasonable? Any comments? Looks reasonable to me. Jake To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message