mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Anholt <eric@anholt.net>
To: Andi Kleen <andi@firstfloor.org>
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.sourceforge.net
Subject: Re: DRM lock ordering fix series
Date: Fri, 27 Mar 2009 13:10:29 -0700	[thread overview]
Message-ID: <1238184629.625.44.camel@gaiman.anholt.net> (raw)
In-Reply-To: <20090327181018.GC11935@one.firstfloor.org>

[-- Attachment #1: Type: text/plain, Size: 1724 bytes --]

On Fri, 2009-03-27 at 19:10 +0100, Andi Kleen wrote:
> On Fri, Mar 27, 2009 at 09:36:45AM -0700, Eric Anholt wrote:
> > > > You are aware that there is a fast path now (get_user_pages_fast) which
> > > > is significantly faster? (but has some limitations)
> > > 
> > > In the code I have, get_user_pages_fast is just a wrapper that calls the
> > > get_user_pages in the way that I'm calling it from the DRM.
> > 
> > Ah, I see: that's a weak stub, and there is a real implementation.  I
> > didn't know we could do weak stubs.
> 
> The main limitation is that it only works for your current process,
> not another one. For more details you can check the git changelog
> that added it (8174c430e445a93016ef18f717fe570214fa38bf)
> 
> And yes it's only faster for architectures that support it, that's
> currently x86 and ppc.

OK.  I'm not too excited here -- 10% of 2% of the CPU time doesn't get
me to the 10% loss that the slow path added up to.  Most of the cost is
in k{un,}map_atomic of the returned pages.  If the gup somehow filled in
the user's PTEs, I'd be happy and always use that (since then I'd have
the mapping already in place and just use that).  But I think I can see
why that can't be done.

I suppose I could rework this so that we get_user_pages_fast outside the
lock, then walk doing copy_from_user_inatomic, and fall back to
kmap_atomic of the page list if we fault on the user's address.  It's
still going to be a cost in our hot path, though, so I'd rather not.

I'm working on a set of tests and microbenchmarks for GEM, so other
people will be able to play with this easily soon.

-- 
Eric Anholt
eric@anholt.net                         eric.anholt@intel.com



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2009-03-27 20:12 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-25 21:45 Eric Anholt
2009-03-25 21:45 ` [PATCH 1/6] drm/i915: Fix lock order reversal in GTT pwrite path Eric Anholt
2009-03-25 21:45   ` [PATCH 2/6] drm/i915: Make GEM object's page lists refcounted instead of get/free Eric Anholt
2009-03-25 21:45     ` [PATCH 3/6] drm/i915: Fix lock order reversal in shmem pwrite path Eric Anholt
2009-03-25 21:45       ` [PATCH 4/6] drm/i915: Fix lock order reversal in shmem pread path Eric Anholt
2009-03-25 21:45         ` [PATCH 5/6] drm/i915: Fix lock order reversal with cliprects and cmdbuf in non-DRI2 paths Eric Anholt
2009-03-25 21:45           ` [PATCH 6/6] drm/i915: Fix lock order reversal in GEM relocation entry copying Eric Anholt
2009-03-30 10:00             ` [PATCH 6/6] drm/i915: Fix lock order reversal in GEM relocation entry copying. -- makes X hang Florian Mickler
2009-03-31 19:36               ` Eric Anholt
2009-04-01  0:12                 ` Florian Mickler
2009-03-27  0:52           ` [PATCH 5/6] drm/i915: Fix lock order reversal with cliprects and cmdbuf in non-DRI2 paths Jesse Barnes
2009-03-25 23:30         ` [PATCH 4/6] drm/i915: Fix lock order reversal in shmem pread path Dave Airlie
2009-03-26  4:03           ` Keith Packard
2009-03-27  0:50         ` Jesse Barnes
2009-03-27  0:50       ` [PATCH 3/6] drm/i915: Fix lock order reversal in shmem pwrite path Jesse Barnes
2009-03-25 22:52     ` [PATCH 2/6] drm/i915: Make GEM object's page lists refcounted instead of get/free Dave Airlie
2009-03-26 19:59       ` Eric Anholt
2009-03-27  0:47     ` Jesse Barnes
2009-03-27  0:43   ` [PATCH 1/6] drm/i915: Fix lock order reversal in GTT pwrite path Jesse Barnes
2009-03-27 16:56     ` Eric Anholt
2009-03-27 17:07       ` Jesse Barnes
2009-03-28  0:54     ` Peter Zijlstra
2009-03-28  2:35       ` Jesse Barnes
2009-03-28  5:22         ` Dave Airlie
2009-03-27  9:34 ` DRM lock ordering fix series Andi Kleen
2009-03-27 16:19   ` Eric Anholt
2009-03-27 16:36     ` Eric Anholt
2009-03-27 18:10       ` Andi Kleen
2009-03-27 20:10         ` Eric Anholt [this message]
2009-03-27 21:05           ` Andi Kleen
2009-03-28  0:58           ` Peter Zijlstra
2009-03-28  1:29             ` Peter Zijlstra
2009-03-30  6:29               ` Eric Anholt
2009-03-28  8:46             ` Brice Goglin
2009-03-28 10:48               ` Peter Zijlstra
2009-03-28 12:22                 ` [RFC] x86: gup_fast() batch limit (was: DRM lock ordering fix series) Peter Zijlstra
2009-03-28 12:46                   ` Peter Zijlstra
2009-04-02 11:19                     ` Nick Piggin
2009-06-24 13:46                       ` [RFC] x86: gup_fast() batch limit Brice Goglin
2009-06-24 17:07                         ` Peter Zijlstra
2009-06-24 19:55                         ` Peter Zijlstra

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=1238184629.625.44.camel@gaiman.anholt.net \
    --to=eric@anholt.net \
    --cc=andi@firstfloor.org \
    --cc=dri-devel@lists.sourceforge.net \
    --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®