From: Daniel Vetter Subject: Re: [PATCH 1/3] drm/i915: Keep track of request counts Date: Sat, 29 Oct 2011 11:35:13 +0200 Message-ID: <20111029093513.GA2932@phenom.ffwll.local> References: <1319867729-8676-1-git-send-email-ben@bwidawsk.net> <1319867729-8676-2-git-send-email-ben@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wy0-f177.google.com (mail-wy0-f177.google.com [74.125.82.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 956B99E7E9 for ; Sat, 29 Oct 2011 02:34:22 -0700 (PDT) Received: by wyg8 with SMTP id 8so5745343wyg.36 for ; Sat, 29 Oct 2011 02:34:21 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1319867729-8676-2-git-send-email-ben@bwidawsk.net> 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: Ben Widawsky Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Fri, Oct 28, 2011 at 10:55:27PM -0700, Ben Widawsky wrote: > There is already a list of requests outstanding for a given client. > Keeping a count is easy, and will give some information necessary to > enable a more fair throttling scheme. > > For now a client is uniquely identified by its file descriptor, however > this may change in the future with new process APIs. > > Signed-off-by: Ben Widawsky > --- > drivers/gpu/drm/i915/i915_drv.h | 1 + > drivers/gpu/drm/i915/i915_gem.c | 8 ++++++++ > 2 files changed, 9 insertions(+), 0 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h > index 06a37f4..a251d22 100644 > --- a/drivers/gpu/drm/i915/i915_drv.h > +++ b/drivers/gpu/drm/i915/i915_drv.h > @@ -919,6 +919,7 @@ struct drm_i915_file_private { > struct { > struct spinlock lock; > struct list_head request_list; > + atomic_t outstanding_requests; Here's your bikeshed: Is the spinlock not sufficient to protect the count? I'm asking because atomic_ts are pretty hard to extend to more fancy scheme (e.g. taking actual gpu time into account or comparing this with other processes outstanding_request to make better decisions). -Daniel -- Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48