From owner-cvs-all Fri Jan 12 10:37:54 2001 Delivered-To: cvs-all@freebsd.org Received: from front7m.grolier.fr (front7m.grolier.fr [195.36.216.57]) by hub.freebsd.org (Postfix) with ESMTP id DE11637B402; Fri, 12 Jan 2001 10:37:28 -0800 (PST) Received: from nas1-106.cgy.club-internet.fr (nas1-106.cgy.club-internet.fr [195.36.197.106]) by front7m.grolier.fr (8.9.3/No_Relay+No_Spam_MGC990224) with ESMTP id TAA28732; Fri, 12 Jan 2001 19:37:24 +0100 (MET) Date: Fri, 12 Jan 2001 18:36:52 +0100 (CET) From: =?ISO-8859-1?Q?G=E9rard_Roudier?= X-Sender: groudier@linux.local To: John Baldwin Cc: Bruce Evans , cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, Jake Burkholder Subject: Re: cvs commit: src/sys/alpha/alpha interrupt.c machdep.c mp_mac In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 11 Jan 2001, John Baldwin wrote: > When the kernel becomes pre-emptive (a pre-emptive kernel is already stab= le on > UP) the locking rules for most per-cpu variables will change (with the > exception of curproc, curpcb, and things tied to the current thread of > execution). You will no longer be able to cache and use per-cpu variable= s > unless you hold a spin lock to prevent yourself from being pre-empted, si= nce > otherwise there is nothing to prevent an interrupt coming in and pre-empt= ing > your CPU and you end up running on some other CPU later. We want people = to know > that they are messing with a per-cpu variable that needs special treatmen= t. I missed the effect of migrating a thread/process to another CPU. Thanks for fixing me. Indeed programmer must be aware about coherency when accessing these variables. G=E9rard. PS: Using ugly macros may well discourage from accessing these variables when it is not actually needed, and, in some way, it can be considered as a good point. :-) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message