From: Alan Swanson Subject: Re: r600g: Trying to remove the busywait for fence completion, but hitting inexplicable behaviour Date: Tue, 31 Jan 2012 15:38:52 +0000 Message-ID: <1328024332.7997.13.camel@trillian.infiniteimprobability.net> References: <201201311316.46745.simon.farnsworth@onelan.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail.ukfsn.org (mail.ukfsn.org [77.75.108.3]) by gabe.freedesktop.org (Postfix) with ESMTP id EEC6C9E848 for ; Tue, 31 Jan 2012 08:10:50 -0800 (PST) In-Reply-To: <201201311316.46745.simon.farnsworth@onelan.co.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Simon Farnsworth Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Tue, 2012-01-31 at 13:16 +0000, Simon Farnsworth wrote: > Hello, > > When profiling my workload on an AMD E-350 (PALM GPU) to see why it still > wasn't performing well with Jerome's WIP macrotiling patches, I noticed that > r600_fence_finish was taking 10% of my CPU time. I determined experimentally > that changing from sched_yield() to os_time_sleep(10) fixed this and > resolved my last performance issue on AMD Fusion as compared to Intel Atom, > but felt that this was hacky. No, you were right the first time, sched_yield should definitely not be being used in this busy wait under Linux (even with its preceding few spins). Back in 2003 when Linux 2.5 changed sched_yield to move processes from run queue to the expired queue instead, its use was discussed on the DRI devel list. http://lwn.net/Articles/31462/ http://thread.gmane.org/gmane.comp.video.dri.devel/5455/focus=6779 There stills seems to be five uses that should be checked. src/gallium/drivers/r600/r600_pipe.c src/gallium/drivers/nouveau/nouveau_fence.c src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c src/gallium/winsys/radeon/drm/radeon_drm_bo.c (*2) -- Alan.