[fuse-devel] Re: [parisc-linux] [PATCH] Fixs to work on ARM and PARIC platforms.

James Bottomley James.Bottomley at SteelEye.com
Tue Apr 4 01:23:20 MDT 2006


On Mon, 2006-04-03 at 15:21 +0200, Miklos Szeredi wrote:
>   flush_dcache_page():
>      - The kernel address is flushed regardless whether the page is
>        anonymous or not

Not quite ... if the page is file backed but has no user mappings, on
the page dirty bit will be set (the kernel view won't be flushed).

>      - If the page is file backed, then all user addresses refering to
>        the page are flushed

Yes, that's what it does.

> Why this discrepancy between anonymous and file backed pages?
> Wounldn't it be enough for file backed pages too to flush only one
> user address?

Not necessarily ... you're getting deep into how VIPT and VIVT caches
work.  VIVT and non-CAM based VIPT caches need every alias flushed
(well, that's not congruent, anyway ... we try to keep congruence in
parisc, but it's not always possible).  Usually a page is either file
backed or anonymous, so for an anonymous page, we wouldn't know the user
address to flush even if it were congruent.

> Added to the mix are copy_to/from_user_page() which already seem to do
> the above, and are used in combination with get_user_pages() which
> results in multiple redundant cache flushes.  Not too clean, is it?

I don't see that they do.  If flush_dcache_page() also does anon pages,
then the arch implementation of flush_anon_page() will be empty.  If it
doesn't, then the flush_anon_page() and flush_dcache_page() are mutually
exclusive, anyway (because they both check the anon flag).

James





More information about the parisc-linux mailing list