From owner-freebsd-current@FreeBSD.ORG Sun May 9 16:58:09 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from green.homeunix.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 4DEE316A4CE; Sun, 9 May 2004 16:58:09 -0700 (PDT) Received: from localhost (green@localhost [127.0.0.1]) by green.homeunix.org (8.12.11/8.12.11) with ESMTP id i49Nw6TJ019581; Sun, 9 May 2004 19:58:06 -0400 (EDT) (envelope-from green@green.homeunix.org) Message-Id: <200405092358.i49Nw6TJ019581@green.homeunix.org> X-Mailer: exmh version 2.6.3 04/04/2003 with nmh-1.0.4 To: Julian Elischer In-Reply-To: Message from Julian Elischer From: Brian Fundakowski Feldman Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 09 May 2004 19:58:06 -0400 Sender: green@green.homeunix.org cc: FreeBSD current users Subject: Re: sparc64 kernel code question.. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 May 2004 23:58:09 -0000 RJulian Elischer wrote: > > in vm_machdep.c the sparc64 code has > void > cpu_sched_exit(struct thread *td) > { > struct vmspace *vm; > struct pcpu *pc; > struct proc *p; > > mtx_assert(&sched_lock, MA_OWNED); > > p = td->td_proc; > vm = p->p_vmspace; > if (vm->vm_refcnt > 1) > return; > SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { > if (pc->pc_vmspace == vm) { > vm->vm_pmap.pm_active &= ~pc->pc_cpumask; > vm->vm_pmap.pm_context[pc->pc_cpuid] = -1; > pc->pc_vmspace = NULL; > } > } > } > > > > This is thw only architecture that has this.. > What does it do? And what does it have to do with the scheduler? It would appear to detach the vmspace in question from other executing CPUs. This makes no sense -- how would other CPUs be executing on that vmspace if it's already single-threaded at that point (also, single-threaded in the rfork(2) sense because of the vm_refcnt check)? -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\