[Intel-gfx] drm_clflush_pages performance

Dave Airlie airlied at gmail.com
Sun Sep 16 00:06:03 CEST 2012


On Sat, Sep 15, 2012 at 10:41 AM, hank peng <pengxihan at 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.

Dave.



More information about the Intel-gfx mailing list