Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: David Daney <ddaney@avtrex.com>
To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: linux-mips@linux-mips.org, jschmidt@avtrex.com, sfrancis@avtrex.com
Subject: Re: O_DIRECT file access and cache aliasing...
Date: Tue, 28 Aug 2007 21:07:11 -0700	[thread overview]
Message-ID: <46D4F0EF.5030009@avtrex.com> (raw)
In-Reply-To: <20070829.115949.75427319.nemoto@toshiba-tops.co.jp>

Atsushi Nemoto wrote:
> On Tue, 28 Aug 2007 18:04:28 -0700, David Daney <ddaney@avtrex.com> wrote:
>   
>> When we write files that were opened with O_DIRECT set, we observe that 
>> there are many 16 byte chunks of data in the files that contain all 
>> zeros instead of the correct data.
>>
>> My understanding is that the cache is virtually indexed.  So I think 
>> what is happening is that when data is written to memory by a user 
>> application that does an O_DIRECT write, the IDE driver is given a list 
>> of pages to transfer to the disk.  The driver then does a 
>> dma_cache_wback() on the KSEG0 address of the pages before initiating 
>> the DMA operation.  Since the KSEG0 address and the USEG address of the 
>> physical memory are different, the data is never flushed to memory 
>> resulting in incorrect data being written to disk.
>>     
>
> I think get_user_pages() should flush user data for O_DIRECT.
>
> The get_user_pages() uses flush_anon_page() to do it, and MIPS
> flush_anon_page() was added on Mar 2007.  Does your kernel have this
> fix?
>   
I doubt it.  We are currently using 2.6.15.

We will look at either moving to a recent kernel or back-porting the 
patch you mention.

Thanks for the help,
David Daney

  reply	other threads:[~2007-08-29  4:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-29  1:04 O_DIRECT file access and cache aliasing David Daney
2007-08-29  2:59 ` Atsushi Nemoto
2007-08-29  4:07   ` David Daney [this message]
     [not found] <5DF100B598199744B111FCEA5222E78A02826C5D@sigma-exch1.sdesigns.com>
2007-08-29  4:03 ` David Daney

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=46D4F0EF.5030009@avtrex.com \
    --to=ddaney@avtrex.com \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=jschmidt@avtrex.com \
    --cc=linux-mips@linux-mips.org \
    --cc=sfrancis@avtrex.com \
    /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