From: lethal@linux-sh.org (Paul Mundt)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH] ARM: Assume new page cache pages have dirty D-cache
Date: Fri, 5 Mar 2010 10:28:23 +0900 [thread overview]
Message-ID: <20100305012823.GD26618@linux-sh.org> (raw)
In-Reply-To: <20100304214435.GJ13417@n2100.arm.linux.org.uk>
On Thu, Mar 04, 2010 at 09:44:35PM +0000, Russell King - ARM Linux wrote:
> On Thu, Mar 04, 2010 at 06:36:42PM +0000, Catalin Marinas wrote:
> > ARM: Assume new page cache pages have dirty D-cache
> >
> > From: Catalin Marinas <catalin.marinas@arm.com>
> >
> > There are places in Linux where writes to newly allocated page cache
> > pages happen without a subsequent call to flush_dcache_page() (several
> > PIO drivers including USB HCD). This patch changes the meaning of
> > PG_arch_1 to be PG_dcache_clean and always flush the D-cache for a newly
> > mapped page in update_mmu_cache().
> >
> > The patch also sets the PG_arch_1 bit in the DMA cache maintenance
> > function to avoid additional cache flushing in update_mmu_cache().
>
> As I just realised, this is going to subject all pages placed into
> userspace with a D cache flush - even anonymous pages, and those
> which we've been careful to deal with the cache issues already (eg,
> via the COW page copying code.)
>
> I think all the copypage functions need to set PG_dcache_clean on the
> new pages once their copy has completed.
>
> I wonder if there's any other anonymous page creating functions which
> could do with a similar treatment...
In the anonymous page case, flush_anon_page() is always called prior to
flush_dcache_page(), so flush_anon_page() could just set PG_dcache_clean
to work around that. That would handle get_user_pages(), too.
WARNING: multiple messages have this Message-ID (diff)
From: Paul Mundt <lethal@linux-sh.org>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
James Bottomley <James.Bottomley@HansenPartnership.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: Re: [RFC PATCH] ARM: Assume new page cache pages have dirty D-cache
Date: Fri, 5 Mar 2010 10:28:23 +0900 [thread overview]
Message-ID: <20100305012823.GD26618@linux-sh.org> (raw)
In-Reply-To: <20100304214435.GJ13417@n2100.arm.linux.org.uk>
On Thu, Mar 04, 2010 at 09:44:35PM +0000, Russell King - ARM Linux wrote:
> On Thu, Mar 04, 2010 at 06:36:42PM +0000, Catalin Marinas wrote:
> > ARM: Assume new page cache pages have dirty D-cache
> >
> > From: Catalin Marinas <catalin.marinas@arm.com>
> >
> > There are places in Linux where writes to newly allocated page cache
> > pages happen without a subsequent call to flush_dcache_page() (several
> > PIO drivers including USB HCD). This patch changes the meaning of
> > PG_arch_1 to be PG_dcache_clean and always flush the D-cache for a newly
> > mapped page in update_mmu_cache().
> >
> > The patch also sets the PG_arch_1 bit in the DMA cache maintenance
> > function to avoid additional cache flushing in update_mmu_cache().
>
> As I just realised, this is going to subject all pages placed into
> userspace with a D cache flush - even anonymous pages, and those
> which we've been careful to deal with the cache issues already (eg,
> via the COW page copying code.)
>
> I think all the copypage functions need to set PG_dcache_clean on the
> new pages once their copy has completed.
>
> I wonder if there's any other anonymous page creating functions which
> could do with a similar treatment...
In the anonymous page case, flush_anon_page() is always called prior to
flush_dcache_page(), so flush_anon_page() could just set PG_dcache_clean
to work around that. That would handle get_user_pages(), too.
next prev parent reply other threads:[~2010-03-05 1:28 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-02 17:34 [RFC PATCH] ARM: Assume new page cache pages have dirty D-cache Catalin Marinas
2010-03-02 17:34 ` Catalin Marinas
2010-03-04 16:44 ` Russell King - ARM Linux
2010-03-04 16:44 ` Russell King - ARM Linux
2010-03-04 17:27 ` Catalin Marinas
2010-03-04 17:27 ` Catalin Marinas
2010-03-04 18:36 ` Catalin Marinas
2010-03-04 18:36 ` Catalin Marinas
2010-03-04 21:44 ` Russell King - ARM Linux
2010-03-04 21:44 ` Russell King - ARM Linux
2010-03-05 1:28 ` Paul Mundt [this message]
2010-03-05 1:28 ` Paul Mundt
2010-03-05 4:46 ` Benjamin Herrenschmidt
2010-03-05 4:46 ` Benjamin Herrenschmidt
2010-03-05 4:32 ` Benjamin Herrenschmidt
2010-03-05 4:32 ` Benjamin Herrenschmidt
2010-03-05 16:52 ` Catalin Marinas
2010-03-05 16:52 ` Catalin Marinas
2010-03-05 21:16 ` Russell King - ARM Linux
2010-03-05 21:16 ` Russell King - ARM Linux
2010-03-06 10:00 ` Catalin Marinas
2010-03-06 10:00 ` Catalin Marinas
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=20100305012823.GD26618@linux-sh.org \
--to=lethal@linux-sh.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.