Date: Tue, 6 Aug 2002 23:00:04 +1000 (EST) From: Bruce Evans <bde@zeta.org.au> To: Luigi Rizzo <rizzo@icir.org> Cc: Jake Burkholder <jake@locore.ca>, Peter Wemm <peter@wemm.org>, Terry Lambert <tlambert2@mindspring.com>, <smp@FreeBSD.ORG> Subject: Re: how to create per-cpu variables in SMP kernels ? Message-ID: <20020806222506.N1391-100000@gamplex.bde.org> In-Reply-To: <20020806013231.A27897@iguana.icir.org>
index | next in thread | previous in thread | raw e-mail
On Tue, 6 Aug 2002, Luigi Rizzo wrote: > On Tue, Aug 06, 2002 at 02:38:17AM -0400, Jake Burkholder wrote: > ... > > This doesn't work because the page directory is per-process, not per-cpu. > > To implement this you would need a fixed page directory entry which pointed > > to a different page table page on each cpu, which mapped the different > > per-cpu pages to the same virtual address. If 2 processes which shared > > page directories were running concurrently on 2 cpus, they would both > > see the same per-cpu data (one of then would get the wrong struct pcpu). > > Basically the struct pcpu's cannot all be mapped to the same virtual > > address. > > so how does the use of %fs solve the problem ? %fs is per-cpu, so it can (and does) index a cpu-dependent segment descriptor despite the index value being cpu-independent. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the messagehome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020806222506.N1391-100000>
