From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 3 19:18:40 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 03DBD1065858 for ; Tue, 3 Apr 2012 19:18:40 +0000 (UTC) (envelope-from marktinguely@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id C77A48FC18 for ; Tue, 3 Apr 2012 19:18:39 +0000 (UTC) Received: by pbcwz17 with SMTP id wz17so224311pbc.13 for ; Tue, 03 Apr 2012 12:18:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=4JXOk3Ng9m6BIaI5nnGEalpghZC0tFZCHxXxZu1spEI=; b=wkmNdqmJjE45CHpOewBWT+D+c1AtG80lm81R640bz6FTLZxoNxpK2XA1zShlCK0VMI EAAFqDCjyfPPTEr9zsLMSaOGkC22jt4PJzeCzvSInzb1G2AS+GOoitxzUS2Ai+e+LgUg K0u5utk1w04bPo5lr8ajyTWCQTVnrqYo6NBkr1rztABtPeGgwF40JTisNsLhIM+PEBH/ nq1+YIvfT7WeIZWT9Tb/bF9HBNsHYMZWnlFj3gMQza6XobbfngNPOYkCvQCm7V6Dsf01 +BD01Rem39i56IgiN6bjgykD7r2kaCtDw05eMacduV00ZIncxK1Lez+9ei/p8fXQ+izW xgKw== MIME-Version: 1.0 Received: by 10.68.240.65 with SMTP id vy1mr8235831pbc.131.1333480719177; Tue, 03 Apr 2012 12:18:39 -0700 (PDT) Received: by 10.68.189.69 with HTTP; Tue, 3 Apr 2012 12:18:39 -0700 (PDT) In-Reply-To: References: Date: Tue, 3 Apr 2012 14:18:39 -0500 Message-ID: From: Mark Tinguely To: vasanth rao naik sabavat Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: question about amd64 pagetable page allocation. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2012 19:18:40 -0000 On Tue, Apr 3, 2012 at 1:52 PM, vasanth rao naik sabavat wrote: > Hello Mark, > > I think pmap_remove_pages() is executed only for the current process. > > =A0=A0 2549 #ifdef PMAP_REMOVE_PAGES_CURPROC_ONLY > =A0=A0 2550 =A0=A0=A0 if (pmap !=3D vmspace_pmap(curthread->td_proc->p_vm= space)) { > =A0=A0 2551 =A0=A0=A0 =A0=A0=A0 printf("warning: pmap_remove_pages called= with non-current > pmap\n"); > =A0=A0 2552 =A0=A0=A0 =A0=A0=A0 return; > =A0=A0 2553 =A0=A0=A0 } > =A0=A0 2554 #endif > > I dont still get it why this was removed? > > Thanks, > Vasanth That is pretty old code. Newer code does not make that assumption. Without the assumption that the pages are from the current map, then you have to use the direct physical -> virtual mapping: 2547 #ifdef PMAP_REMOVE_PAGES_CURPROC_ONLY 2548 pte =3D vtopte(pv->pv_va); 2549 #else 2550 pte =3D pmap_pte(pmap, pv->pv_va); 2551 #endif --Mark Tinguely.