public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joerg.roedel@amd.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	tom.leiming@gmail.com, fujita.tomonori@lab.ntt.co.jp,
	linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Subject: Re: [PATCH][RFC] asm-generic:remove calling flush_write_buffers() in dma_sync_*_for_cpu
Date: Mon, 29 Jun 2009 20:47:06 +0200	[thread overview]
Message-ID: <20090629184706.GA9401@amd.com> (raw)
In-Reply-To: <200906291845.16335.arnd@arndb.de>

On Mon, Jun 29, 2009 at 06:45:15PM +0200, Arnd Bergmann wrote:
> On Monday 29 June 2009, Alan Cox wrote:
> > > Wouldn't it be better to put the flush_write_buffer in the specific
> > > operation (swiotlb_sync_*_for_*) rather than the multiplexer?
> > > 
> > > Maybe in that case, smp_wmb() would be more appropriate because
> > > it is defined on all architectures.
> > 
> > smp_wmb() is stronger and it would slow down x86 if we did that (we'd go
> > from no-op on a coherent platform to using mfence/lfence etc)
> > 
> Really? In my copy of system.h, I read
> 
> #ifdef CONFIG_SMP
> # ifdef CONFIG_X86_OOSTORE
> #  define smp_wmb()      wmb()
> # else
> #  define smp_wmb()      barrier()
> # endif
> #else
> # define smp_wmb()       barrier()
> #endif

With that definition an smp_wmb() would do the right job on x86. If thats also
true for other architectures using this generic header we can remove
flush_write_buffer().

> 
> That actually looks weaker than flush_write_buffer, as it would turn into
> a barrier() in case of !SMP or !X86_OOSTORE, and into an sfence instead of
> lock addl on all modern CPUs in case of SMP && X86_OOSTORE.

X86_OOSTORE is defined for (MWINCHIP3D || MWINCHIPC6) && MTRR. I am not sure if
these chips have sfence.
It would also help to know what OOSTORE exactly means in the context of that
chip.

	Joerg

-- 
           | Advanced Micro Devices GmbH
 Operating | Karl-Hammerschmidt-Str. 34, 85609 Dornach bei München
 System    | 
 Research  | Geschäftsführer: Thomas M. McCoy, Giuliano Meroni
 Center    | Sitz: Dornach, Gemeinde Aschheim, Landkreis München
           | Registergericht München, HRB Nr. 43632


  parent reply	other threads:[~2009-06-29 18:47 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-28 14:39 [PATCH][RFC] asm-generic:remove calling flush_write_buffers() in dma_sync_*_for_cpu tom.leiming
2009-06-28 15:34 ` Arnd Bergmann
2009-06-29 12:31   ` Joerg Roedel
2009-06-29 13:51     ` Ming Lei
2009-06-29 14:45       ` Joerg Roedel
2009-06-29 14:54         ` Ming Lei
2009-06-29 15:44           ` Joerg Roedel
2009-06-29 16:22     ` Arnd Bergmann
2009-06-29 16:31       ` Alan Cox
2009-06-29 16:45         ` Arnd Bergmann
2009-06-29 17:16           ` Alan Cox
2009-06-30 12:34             ` Arnd Bergmann
2009-06-30 12:40               ` Alan Cox
2009-06-30 12:48                 ` Arnd Bergmann
2009-06-30 13:09                   ` Alan Cox
2009-06-30 13:38                     ` Arnd Bergmann
2009-07-07  1:54                       ` Ming Lei
2009-07-07  7:48                         ` Russell King - ARM Linux
2009-07-07 13:43                           ` Ming Lei
2009-07-07 14:06                             ` Arnd Bergmann
2009-07-07 14:55                               ` Ming Lei
2009-07-07 15:30                                 ` Arnd Bergmann
2009-07-07 17:36                               ` Russell King - ARM Linux
2009-07-07 17:33                             ` Russell King - ARM Linux
2009-06-29 18:47           ` Joerg Roedel [this message]
2009-06-29 19:10             ` Alan Cox
2009-06-29 19:24               ` Joerg Roedel
2009-06-29 18:48       ` Joerg Roedel

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=20090629184706.GA9401@amd.com \
    --to=joerg.roedel@amd.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arnd@arndb.de \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tom.leiming@gmail.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