From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] drm/i915: Batch copy_from_user for relocation processing Date: Mon, 26 Mar 2012 09:59:55 +0200 Message-ID: <20120326075955.GD4014@phenom.ffwll.local> References: <20120324123301.GB5914@phenom.ffwll.local> <1332619973-5127-1-git-send-email-chris@chris-wilson.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-we0-f177.google.com (mail-we0-f177.google.com [74.125.82.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 1C2EE9F69C for ; Mon, 26 Mar 2012 00:59:11 -0700 (PDT) Received: by werp11 with SMTP id p11so4905336wer.36 for ; Mon, 26 Mar 2012 00:59:11 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1332619973-5127-1-git-send-email-chris@chris-wilson.co.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Chris Wilson Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Sat, Mar 24, 2012 at 08:12:53PM +0000, Chris Wilson wrote: > Originally the code tried to allocate a large enough array to perform > the copy using vmalloc, performance wasn't great and throughput was > improved by processing each individual relocation entry separately. > This too is not as efficient as one would desire. A compromise would be > to allocate a single page, or to allocate a few entries on the stack, > and process the copy in batches. The latter gives simpler code and more > consistent performance due to a lack of heuristic. > > x11perf -copywinwin10: n450/pnv i3-330m i5-2520m (cpu) > before: 249000 785000 1280000 (80%) > page: 264000 896000 1280000 (65%) > on-stack: 264000 902000 1280000 (67%) > > v2: Use 512-bytes of stack for batching rather than allocate a page. > v3: Tidy the code slightly with more descriptive variable names > > Signed-off-by: Chris Wilson Reviewed-by: Daniel Vetter ... and also queued up for -next, thanks for the patch. -Daniel -- Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48