From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lauri Kasanen Subject: Re: [PATCH] drm/radeon: Inline r100_mm_rreg Date: Fri, 11 Apr 2014 10:52:01 +0300 Message-ID: <20140411105201.57ea4a1b.cand@gmx.com> References: <20140410160817.5275493d.cand@gmx.com> <20140410214634.ba440af5.cand@gmx.com> <5346F13B.6060604@vodafone.de> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 0A7C76ED32 for ; Fri, 11 Apr 2014 00:50:45 -0700 (PDT) In-Reply-To: <5346F13B.6060604@vodafone.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Christian =?ISO-8859-15?Q?K=F6nig?= Cc: "dri-devel@lists.freedesktop.org" List-Id: dri-devel@lists.freedesktop.org On Thu, 10 Apr 2014 21:30:03 +0200 Christian K=F6nig wrote: > >>> Quick thought from someone entirely unfamiliar with the hardware: > >>> perhaps you can get the performance benefit without the size increase > >>> by moving the else portion into a non-inline function? I'm guessing > >>> that most accesses happen in the "if" branch. > >> The function call overhead is about equal to branching overhead, so > >> splitting it would only help about half that. It's called from many > >> places, and a lot of calls per sec. > = > Actually direct register access shouldn't be necessary so often. Apart = > from page flips, write/read pointer updates and irq processing there = > shouldn't be so many of them. Could you clarify a bit more what issue = > you are seeing here? Too much cpu usage for such a simple function. 2% makes it #2 in top-10 radeon.ko functions, right after evergreen_cs_parse. For reference, #3 (radeon_cs_packet_parse) is only 0.5%, one fourth of this function's usage. As proved by the perf increase, it's called often enough that getting rid of the function call overhead (and compiling the if out compile-time) helps measurably. - Lauri