mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Eric Anholt <eric@anholt.net>
Cc: Dave Airlie <airlied@gmail.com>,
	linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Export kmap_atomic_pfn for DRM-GEM.
Date: Thu, 28 Aug 2008 10:22:14 +1000	[thread overview]
Message-ID: <200808281022.14296.nickpiggin@yahoo.com.au> (raw)
In-Reply-To: <1219855961.4994.6.camel@vonnegut.anholt.net>

On Thursday 28 August 2008 02:52, Eric Anholt wrote:
> On Wed, 2008-08-27 at 23:36 +1000, Nick Piggin wrote:
> > On Wednesday 27 August 2008 05:43, Eric Anholt wrote:
> > > The driver would like to map IO space directly for copying data in when
> > > appropriate, to avoid CPU cache flushing for streaming writes.
> > > kmap_atomic_pfn lets us avoid IPIs associated with ioremap for this
> > > process.
> > >
> > > Signed-off-by: Eric Anholt <eric@anholt.net>
> > > ---
> > >  arch/x86/mm/highmem_32.c |    1 +
> > >  1 files changed, 1 insertions(+), 0 deletions(-)
> > >
> > > diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c
> > > index 165c871..d52e91d 100644
> > > --- a/arch/x86/mm/highmem_32.c
> > > +++ b/arch/x86/mm/highmem_32.c
> > > @@ -137,6 +137,7 @@ void *kmap_atomic_pfn(unsigned long pfn, enum
> > > km_type type)
> > >
> > >  	return (void*) vaddr;
> > >  }
> > > +EXPORT_SYMBOL(kmap_atomic_pfn);
> > >
> > >  struct page *kmap_atomic_to_page(void *ptr)
> > >  {
> >
> > I wonder if you ever tested my vmap rework patches with this issue? It
> > seems somewhat x86 specific and also not conceptually so clean to use
> > kmap_atomic_pfn for this. vmap may not be used by all architectures but
> > I think it might be able to cover some of them.
> >
> > As I said, there are some other possible improvements that can be made
> > to my vmap rewrite if performance isn't good enough, but I simply have
> > not seen numbers...
>
> The consumer of this is a driver for Intel platforms, so being
> x86-specific is not a worry this patch series.

It would help verify and improve the new vmap code, and it would be
"doing the right thing" to begin with. It would avoid some nasty
ifdefery in your driver too. And what about 64 bit x86 that doesn't
have kmap_atomic_pfn? Or x86 builds without highmem?


> However, when other DRM drivers get around to doing memory management,
> I'm sure they'll also be interested in an ioremap_wc that doesn't eat
> ipi costs.  For us, the ipis for flushing were eating over 10% of CPU
> time.  If your patch series cuts that cost, we could drop this piece at
> that point.

It can cut the cost quite significantly on normal vmap/vunmap loads I
tested. Whether it will work as well on your workload, I don't know
but I would have liked to find out. I raised this issue quite a while
back, so I'm disappointed it had not been tried...


  reply	other threads:[~2008-08-28  0:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-26 19:43 [resubmit] Add GEM to i915 DRM driver Eric Anholt
2008-08-26 19:43 ` [PATCH] Export shmem_file_setup for DRM-GEM Eric Anholt
2008-08-26 19:43   ` [PATCH] Export kmap_atomic_pfn " Eric Anholt
2008-08-26 19:43     ` [PATCH] drm: Add GEM ("graphics execution manager") to i915 driver Eric Anholt
2008-08-27 13:36     ` [PATCH] Export kmap_atomic_pfn for DRM-GEM Nick Piggin
2008-08-27 16:52       ` Eric Anholt
2008-08-28  0:22         ` Nick Piggin [this message]
2008-09-22 17:59           ` Jesse Barnes
2008-09-23 16:32             ` Eric Anholt

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=200808281022.14296.nickpiggin@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=airlied@gmail.com \
    --cc=eric@anholt.net \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.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

all inboxes | Powered by JetHome®