Linux ATA/IDE development
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	James Bottomley <James.Bottomley@suse.de>,
	David Miller <davem@davemloft.net>,
	jeff@garzik.org, linux-ide@vger.kernel.org, stable@kernel.org,
	tj@kernel.org
Subject: Re: [patch for 2.6.33? 1/1] ata: call flush_dcache_page() around PIO data transfers in libata-aff.c
Date: Wed, 03 Feb 2010 17:49:50 +0000	[thread overview]
Message-ID: <1265219390.1970.84.camel@pc1117.cambridge.arm.com> (raw)
In-Reply-To: <4B69AF42.5050508@pobox.com>

On Wed, 2010-02-03 at 17:15 +0000, Jeff Garzik wrote:
> On 02/03/2010 12:06 PM, Andrew Morton wrote:
> > On Wed, 03 Feb 2010 12:00:58 -0500 Jeff Garzik<jgarzik@pobox.com>  wrote:
> >
> >> On 02/03/2010 11:40 AM, James Bottomley wrote:
> >>> The fix to libata looks to be just that it should kmap all the time
> >>> rather than trying to fiddle with the page to see if its higmem.  For
> >>> kmap on a normal page, we should just return the offset map address and
> >>> do all the flushing.
> >>
> >> libata tests PageHighMem() because it was measurably faster to do things
> >> the current way (which includes local_irq_save/restore, only for
> >> highmem) on boxes where it actually matters.
> >>
> >> It seems more efficient to add a flush where necessary, than
> >> unconditionally punish everyone...
> >
> > kmap_atomic() tests PageHighMem() too - it's pretty lightweight for
> > lowmem pages.
> 
> Note the lack of local_irq_save/restore in our code, though...  These
> PIO xfers are __slow__, from the perspective of a CPU manufactured in
> the past decade; you are definitely disabling local interrupts for a
> long time.  I suppose we could do
> 
>         if (high mem)
>                 local irq save
>                 kmap
>                 xfer
>                 kunmap
>                 local irq restore
>         else
>                 kmap
>                 xfer
>                 kunmap
> 
> does that solve the problem for ARM, for 2.6.33?

No, it doesn't. If the page isn't a highmem one, the kunmap doesn't do
anything to the caches (and I also have highmem disabled). My logic was
based on a statement in cachetlb.txt that flush_dcache_page() should be
called if the kernel writes to a page cache page, hence the patch (as it
was pointed out, the first call to flush_dcache_page() isn't needed).

-- 
Catalin


  parent reply	other threads:[~2010-02-03 17:57 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-02 22:11 [patch for 2.6.33? 1/1] ata: call flush_dcache_page() around PIO data transfers in libata-aff.c akpm
2010-02-02 22:58 ` James Bottomley
2010-02-02 23:05   ` Andrew Morton
2010-02-02 23:14     ` Jeff Garzik
2010-02-02 23:21       ` James Bottomley
2010-02-02 23:21       ` David Miller
2010-02-02 23:30         ` Alan Cox
2010-02-02 23:32         ` James Bottomley
2010-02-02 23:39           ` David Miller
2010-02-03 10:18           ` Catalin Marinas
2010-02-03 16:40             ` James Bottomley
2010-02-03 17:00               ` Jeff Garzik
2010-02-03 17:06                 ` Andrew Morton
2010-02-03 17:15                   ` Jeff Garzik
2010-02-03 17:20                     ` Andrew Morton
2010-02-03 17:29                       ` Jeff Garzik
2010-02-03 17:39                         ` James Bottomley
2010-02-04 14:33                           ` Catalin Marinas
2010-02-04 15:01                             ` James Bottomley
2010-02-04 15:39                               ` Catalin Marinas
2010-02-04 21:36                                 ` James Bottomley
2010-02-03 17:40                     ` Alan Cox
2010-02-03 17:46                     ` Alan Cox
2010-02-03 17:52                       ` Jeff Garzik
2010-02-03 18:00                         ` Alan Cox
2010-02-03 18:12                           ` Jeff Garzik
2010-02-03 17:49                     ` Catalin Marinas [this message]
2010-02-03 17:54                       ` Jeff Garzik
2010-02-03 17:09               ` David Miller
2010-02-02 23:14     ` James Bottomley
2010-02-03 10:07   ` 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=1265219390.1970.84.camel@pc1117.cambridge.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=James.Bottomley@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=jeff@garzik.org \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=stable@kernel.org \
    --cc=tj@kernel.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