From owner-freebsd-arm@FreeBSD.ORG Tue Jul 13 20:24:31 2010 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 128C21065674; Tue, 13 Jul 2010 20:24:31 +0000 (UTC) (envelope-from marktinguely@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id BC1EB8FC16; Tue, 13 Jul 2010 20:24:30 +0000 (UTC) Received: by iwn35 with SMTP id 35so7661366iwn.13 for ; Tue, 13 Jul 2010 13:24:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=UlV0F5MxXwcDPMpzV8FBsIz/bJc5+y5WcFLDsGM7CFE=; b=neFhd4+R1jNWtSeqt/x2NSTdu80HRLYn+3R0gZgM+peXzwKWmrNYSmKs2JIZvjf4Eg DH+3SJykfh70zKKVC7wRtbuaXG11n5Blnk4M1ZjR6gj8l+7v3BP3TfSvDVQeDEOMurqr 41FziK4wDxMZ/sv4hP5sAhhaBbUOrq9C8a1os= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=JfOh8kpl1xn2A0xQ9ndsdvjCNqVWENzO5hs6xI++IBQtv+rfW6/6O5tyg5Lm7JOI2r Z6cHtcG6Vs8EGBy+tjK8Ok45vs/6oyzYHbwRSTzagxeFCX26zLSNi830B+6X6do877Ne DD9nQ0bCv4XQxnJVI6pyNyPE2bwbysV0tqT1I= Received: by 10.42.1.81 with SMTP id 17mr5292094icf.88.1279052670089; Tue, 13 Jul 2010 13:24:30 -0700 (PDT) Received: from [192.168.0.3] (71-38-38-10.frgo.qwest.net [71.38.38.10]) by mx.google.com with ESMTPS id 34sm26562169ibi.0.2010.07.13.13.24.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 13 Jul 2010 13:24:29 -0700 (PDT) Message-ID: <4C3CCB79.8050708@gmail.com> Date: Tue, 13 Jul 2010 15:24:25 -0500 From: Mark Tinguely User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Alan Cox References: <4C3C7B4E.604@gmail.com> <4C3CB61A.1030905@cs.rice.edu> In-Reply-To: <4C3CB61A.1030905@cs.rice.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: alc@freebsd.org, freebsd-arm@freebsd.org Subject: Re: Revision 209887 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jul 2010 20:24:31 -0000 Alan Cox wrote: > Mark Tinguely wrote: >> pmap_qenter() is pretty expensive on the ARM processor with VIPT >> caches, because remapping a KVA can potentially cause the shared >> mappings to have their cache turned back on and then immediately >> turned back off and force a cache flush. Revision 209887 makes >> amd64/i386 pmap_qenter() make smart decisions on the remapping which >> would help the ARM. >> >> Looking at the buffer code 2 or 3 weeks ago, and noticed that most >> of the pmap_qenter() calls were done wisely. At that time, I was >> wondering if we could/should fix the few places that involved a page >> by page loop doing bogus_page substitutions and then calling >> pmap_qenter() for a full buffer re-map instead of the changed page. >> It appeared to me that we call pmap_qenter() L*B times where L is the >> number of pages in the buffer and B is the number of bogus pages in >> the buffer. We only need to change B pages. I can understand it would >> not be worth the change if typically the number of pages in a buffer >> and the number of bogus pages in the buffer is small. > > I think that vfs_unbusy_pages(), which is used exclusively by NFS, is > the only remaining case. I see no reason not to change it. Go for it. > > Alan Gee thanks :) I will do a complete search of pmap_qenter(). Unless I am reading it wrong, a quick example is a B_VMIO case in routine bufdone_finish() in source file sys/kern/vfs_bio.c: for (i = 0; i < bp->b_npages; i++) { if (bogus_page) { find/substitution page pmap_qenter() the entire buffer rather than just the single page } other page operations } --Mark