Date: Tue, 13 Jul 2010 15:55:15 -0500 From: Alan Cox <alc@cs.rice.edu> To: Mark Tinguely <marktinguely@gmail.com> Cc: alc@freebsd.org, freebsd-arm@freebsd.org Subject: Re: Revision 209887 Message-ID: <4C3CD2B3.4070302@cs.rice.edu> In-Reply-To: <4C3CCB79.8050708@gmail.com> References: <4C3C7B4E.604@gmail.com> <4C3CB61A.1030905@cs.rice.edu> <4C3CCB79.8050708@gmail.com>
index | next in thread | previous in thread | raw e-mail
Mark Tinguely wrote:
> 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:
>
I thought that I already fixed bufdone_finish() to do at most one call
to pmap_qenter() in HEAD..., but vfs_unbusy_pages() still looks like
what you describe below.
> 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
> }
>
Alan
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C3CD2B3.4070302>
