public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V1] ARM: mm: lazy cache flushing on non-mapped pages
Date: Thu, 30 May 2013 16:40:47 +0100	[thread overview]
Message-ID: <20130530154047.GW7483@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <1369839416-27817-1-git-send-email-ming.lei@canonical.com>

On Wed, May 29, 2013 at 03:56:56PM +0100, Ming Lei wrote:
> Currently flush_dcache_page() thinks pages as non-mapped if
> mapping_mapped(mapping) return false. This approach is very
> coase:
> 	- mmap on part of file may cause all pages backed on
> 	the file being thought as mmaped
> 
> 	- file-backed pages aren't mapped into user space actually
> 	if the memory mmaped on the file isn't accessed
> 
> This patch uses page_mapped() to decide if the page has been
> mapped.

[...]

> diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c
> index 0d473cc..008af99 100644
> --- a/arch/arm/mm/flush.c
> +++ b/arch/arm/mm/flush.c
> @@ -286,8 +286,8 @@ void flush_dcache_page(struct page *page)
>  
>  	mapping = page_mapping(page);
>  
> -	if (!cache_ops_need_broadcast() &&
> -	    mapping && !mapping_mapped(mapping))
> +	if (!cache_ops_need_broadcast() && mapping &&
> +		(!mapping_mapped(mapping) || !page_mapped(page)))
>  		clear_bit(PG_dcache_clean, &page->flags);
>  	else {
>  		__flush_dcache_page(mapping, page);

Does the page_mapped test make the mapping_mapped test redundant? It sounds
strange if it's possible to get a non-zero mapcount for a page when its
address space isn't mapped.

Will

  reply	other threads:[~2013-05-30 15:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-29 14:56 [PATCH V1] ARM: mm: lazy cache flushing on non-mapped pages Ming Lei
2013-05-30 15:40 ` Will Deacon [this message]
2013-05-31  4:31   ` Ming Lei
2013-05-31  8:47     ` Will Deacon
2013-05-31  9:10       ` Ming Lei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130530154047.GW7483@mudshark.cambridge.arm.com \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox