From owner-freebsd-current Tue Jul 9 9:53:41 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 15F5F37B400; Tue, 9 Jul 2002 09:53:38 -0700 (PDT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id BFAB543E4A; Tue, 9 Jul 2002 09:53:37 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.12.5/8.12.4) with ESMTP id g69GrZLA052709; Tue, 9 Jul 2002 09:53:35 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.5/8.12.4/Submit) id g69GrZlw052708; Tue, 9 Jul 2002 09:53:35 -0700 (PDT) (envelope-from dillon) Date: Tue, 9 Jul 2002 09:53:35 -0700 (PDT) From: Matthew Dillon Message-Id: <200207091653.g69GrZlw052708@apollo.backplane.com> To: Peter Wemm , Tor.Egge@cvsup.no.freebsd.org, current@FreeBSD.ORG Subject: Re: [src] cvs commit: src/sys/vm vm_zeroidle.c References: <20020708230916.B5D4637B4AF@hub.freebsd.org> <200207091610.g69GAawX052365@apollo.backplane.com> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG : : critical_enter(); <<<<<<<<< : *CMAP2 = PG_V | PG_RW | phys | PG_A | PG_M; <<<<<<<<< : invltlb_1pg((vm_offset_t)CADDR2); <<<<<<<<< : curthread->td_lazytlb = PCPU_GET(cpumask); <<<<<<<<< : critical_exit(); <<<<<<<<< : :... : : Then we mod the scheduler to check td_lazytlb against PCPU_GET(cpumask) : when it switches a thread in. If the bit is not set it clears the TLB : and sets the bit. : : Now, obviously the above is all just pseudo code. We would want to : properly abstract the API and fields, but I think it solves the problem : quite nicely, at least in concept. : : -Matt Another thing we could do is provide a low-level scheduler callback in the thread. So the lazyzero code would set up a function that invalidates just the CMAP entry it uses on switch-in: curthread->td_swcallback = pmap_lazyzero_tlbinval; void pmap_lazyzero_tlbinval(void) { : invltlb_1pg((vm_offset_t)CADDR2); } This is even better then my first idea. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message