All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Dave Airlie <airlied@gmail.com>, hank peng <pengxihan@gmail.com>
Cc: intel-gfx <intel-gfx@lists.freedesktop.org>
Subject: Re: drm_clflush_pages performance
Date: Sun, 16 Sep 2012 08:12:46 +0100	[thread overview]
Message-ID: <051c15$4aplnv@AZSMGA002.ch.intel.com> (raw)
In-Reply-To: <CAPM=9tzECvuDx6miWC2y2SvfjJrMrNS+j1BghV3+OWXTLgMh1A@mail.gmail.com>

On Sat, 15 Sep 2012 18:06:03 -0400, Dave Airlie <airlied@gmail.com> wrote:
> On Sat, Sep 15, 2012 at 10:41 AM, hank peng <pengxihan@gmail.com> wrote:
> > I noticed that drm_clflush_pages function will first choose clfush
> > instead of wbinvd, its code like this:
> >
> > void
> > drm_clflush_pages(struct page *pages[], unsigned long num_pages)
> > {
> >
> > #if defined(CONFIG_X86)
> >         if (cpu_has_clflush) {
> >                 drm_cache_flush_clflush(pages, num_pages);
> >                 return;
> >         }
> >
> >         if (on_each_cpu(drm_clflush_ipi_handler, NULL, 1) != 0)
> >                 printk(KERN_ERR "Timed out waiting for cache flush.\n");
> >
> >
> > I think using clfush will be slower than using wbinvd, so I wonder if
> > I use wbinvd first, what else impact will it bring?
> 
> clflush is faster than wbinvd for a lot use cases,
> 
> There may be a threshold point where it makes sense to wbinvd, but it
> will affect all processes using the cache not just ones using the
> specific pages.

The other factor is that on recent machines the cost of
smp_function_call() outweighs the cost of flushing the cache to memory.
I made the unfortunate mistake of accidentally enabling the wbinvd path
recently...
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

  reply	other threads:[~2012-09-16  7:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-15 14:41 drm_clflush_pages performance hank peng
2012-09-15 22:06 ` Dave Airlie
2012-09-16  7:12   ` Chris Wilson [this message]
2012-09-17 17:17     ` Ben Widawsky

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='051c15$4aplnv@AZSMGA002.ch.intel.com' \
    --to=chris@chris-wilson.co.uk \
    --cc=airlied@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=pengxihan@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 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.