From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: David Miller <davem@davemloft.net>
Cc: ngupta@vflare.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [ARM] force dcache flush if dcache_dirty bit set
Date: Mon, 12 Oct 2009 11:00:23 +0100 [thread overview]
Message-ID: <20091012100023.GC29310@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20091012.023744.157085851.davem@davemloft.net>
On Mon, Oct 12, 2009 at 02:37:44AM -0700, David Miller wrote:
> From: Russell King - ARM Linux <linux@arm.linux.org.uk>
> Date: Mon, 12 Oct 2009 10:07:10 +0100
>
> > On Mon, Oct 12, 2009 at 02:20:23PM +0530, Nitin Gupta wrote:
> >> Same problem exists on mips too.
> >
> > Nice catch. This logic came from sparc64, so I think you'd want to talk
> > to davem about it as well.
> >
> > In the mean time, submitting your fix to the patch system would be great,
> > thanks.
>
> Sparc64 flushes unconditionally when there is no page mapping.
> So, it should be fine here.
Are you sure - I checked the sparc64 code before posting, and we're doing
the same thing.
Sparc64 update_mmu_cache:
page = pfn_to_page(pfn);
if (page && page_mapping(page)) {
pg_flags = page->flags;
if (pg_flags & (1UL << PG_dcache_dirty)) {
/* do lazy flush */
}
}
Sparc64 flush_dcache_page:
mapping = page_mapping(page);
if (mapping && !mapping_mapped(mapping)) {
set_dcache_dirty(page, this_cpu);
}
ARM update_mmu_cache:
page = pfn_to_page(pfn);
mapping = page_mapping(page);
if (mapping) {
int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags);
if (dirty)
/* do lazy flush */
ARM flush_dcache_page:
struct address_space *mapping = page_mapping(page);
if (!PageHighMem(page) && mapping && !mapping_mapped(mapping))
set_bit(PG_dcache_dirty, &page->flags);
It looks identical to me.
The problem which has been identified is that when flush_dcache_page() is
called, there is a mapping, and so the page is marked for lazy flushing.
However, by the time update_mmu_cache() gets called, the mapping has gone
and so update_mmu_cache() does nothing.
next prev parent reply other threads:[~2009-10-12 10:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-12 8:50 Nitin Gupta
2009-10-12 9:07 ` Russell King - ARM Linux
2009-10-12 9:37 ` David Miller
2009-10-12 10:00 ` Russell King - ARM Linux [this message]
2009-10-12 10:16 ` David Miller
2009-10-12 16:09 ` Hugh Dickins
2009-10-12 17:03 ` Russell King
2009-10-12 17:12 ` Nitin Gupta
2009-10-12 18:06 ` Hugh Dickins
2009-10-15 21:48 ` Kyle McMartin
2009-10-13 2:07 ` Paul Mundt
2009-10-14 17:10 ` Catalin Marinas
2009-10-15 11:59 ` Catalin Marinas
2009-10-12 10:28 ` Nitin Gupta
2009-10-12 11:08 ` Russell King - ARM Linux
2009-10-12 11:16 ` Nitin Gupta
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=20091012100023.GC29310@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=davem@davemloft.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ngupta@vflare.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
all inboxes | Powered by JetHome®