From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lauri Kasanen Subject: Re: [PATCH] drm/radeon: Inline r100_mm_rreg Date: Thu, 10 Apr 2014 21:46:34 +0300 Message-ID: <20140410214634.ba440af5.cand@gmx.com> References: <20140410160817.5275493d.cand@gmx.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by gabe.freedesktop.org (Postfix) with ESMTP id 54D1F6E2B8 for ; Thu, 10 Apr 2014 11:45:19 -0700 (PDT) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Ilia Mirkin Cc: "dri-devel@lists.freedesktop.org" List-Id: dri-devel@lists.freedesktop.org On Thu, 10 Apr 2014 12:19:10 -0400 Ilia Mirkin wrote: > > +static inline uint32_t r100_mm_rreg(struct radeon_device *rdev, uint32_t reg, > > + bool always_indirect) > > +{ > > + if (reg < rdev->rmmio_size && !always_indirect) > > + return readl(((void __iomem *)rdev->rmmio) + reg); > > 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. Of course the future kernel LTO will all make this go away, but that's probably two years in the future before it's stable. - Lauri