From: Tejun Heo <htejun@gmail.com>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: Russell King <rmk@arm.linux.org.uk>,
James Steward <james.steward@dynamicratings.com>,
"linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>
Subject: Re: [PATCH] ide: add dcache flushing after PIO
Date: Thu, 22 Dec 2005 01:00:26 +0900 [thread overview]
Message-ID: <43A97C1A.1090503@gmail.com> (raw)
In-Reply-To: <58cb370e0512210757n25ddd614p33f3d70c8ff813cd@mail.gmail.com>
Bartlomiej Zolnierkiewicz wrote:
> On 12/21/05, Tejun Heo <htejun@gmail.com> wrote:
>> Russell King wrote:
>>> On Wed, Dec 21, 2005 at 11:00:22PM +0900, Tejun Heo wrote:
>>>
>>>> Block drivers are responsible for cache coherency before and after IO.
>>>> When using DMA, DMA API takes care of it but drivers should do manual
>>>> flushing with PIO.
>>>
>>> Are you sure you need the ones in the write path? No other driver
>>> seems to do this.
>>>
>> Unfortunately, I'm not. I was trying to be on the safe side.
>>
>> Are the page caches guaranteed to have no dirty alias on entry to block
>> layer for write? I can see that aliases are handled for read(2)s and
>> write(2)s but I don't know much about mmap writebacks.
>>
>> Another question is whether or not it's guaranteed that there's no
>> user-mapped dirty cachelines on entry to block layer for read. DMA API
>
> It seems to be guaranteed for read() and write() but not for mmap().
>
>> clears all cpu caches before IO and, as DMA IO doesn't touch any cpu
>> caches, it doesn't do anything after IO. The previous patch adds a
>> flush_dcache_page after IO which makes sure that the kernel cache line
>> is gone, but it doesn't do anything to make sure that there's no dirty
>> user-mapped cachelines hanging around before IO.
>>
>> I couldn't find an exemplary driver doing this kind of things with page
>> caches. Most other flush_dcache_page usages I looked at didn't deal
>> with user mapped page caches.
>
> After reading excellent explanation by rmk I think that it should be
> fixed at VM layer (filemap_nopage() perhaps).
>
> Could you move the discussion to LKML (with some generic "subject")
> so we can get some help from MM hackers?
>
> Bartlomiej
Hi, Bartlomiej.
I'll post a new message to LKML first thing tomorrow. :-)
--
tejun
next prev parent reply other threads:[~2005-12-21 16:00 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-19 0:47 Execute from CF causes segmentation faults James Steward
2005-12-20 12:52 ` Tejun Heo
2005-12-20 16:23 ` Bartlomiej Zolnierkiewicz
2005-12-21 9:48 ` Tejun Heo
2005-12-21 14:00 ` [PATCH] ide: add dcache flushing after PIO Tejun Heo
2005-12-21 14:03 ` Russell King
2005-12-21 14:43 ` Tejun Heo
2005-12-21 15:57 ` Bartlomiej Zolnierkiewicz
2005-12-21 16:00 ` Tejun Heo [this message]
2005-12-21 17:54 ` Russell King
2006-01-07 17:06 ` Russell King
2006-01-07 20:17 ` Bartlomiej Zolnierkiewicz
2006-01-07 21:22 ` Russell King
2006-01-07 22:41 ` Bartlomiej Zolnierkiewicz
2006-01-08 0:50 ` james
2006-01-09 9:08 ` Russell King
2006-01-09 9:16 ` Tejun Heo
2005-12-21 15:01 ` Execute from CF causes segmentation faults Russell King
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=43A97C1A.1090503@gmail.com \
--to=htejun@gmail.com \
--cc=bzolnier@gmail.com \
--cc=james.steward@dynamicratings.com \
--cc=linux-ide@vger.kernel.org \
--cc=rmk@arm.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).