All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, Intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 08/10] drm/i915: Expose per-engine client busyness
Date: Wed, 18 Mar 2020 14:15:31 +0000	[thread overview]
Message-ID: <aec5ec90-0c1d-e1cb-f7c4-ff5b2112a005@linux.intel.com> (raw)
In-Reply-To: <158454005479.6873.4857418466512127070@build.alporthouse.com>


On 18/03/2020 14:00, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2020-03-18 12:11:37)
>> +static u64
>> +pphwsp_busy_add(struct i915_gem_context *ctx, unsigned int class)
>> +{
>> +       struct i915_gem_engines *engines = rcu_dereference(ctx->engines);
>> +       struct i915_gem_engines_iter it;
>> +       struct intel_context *ce;
>> +       u64 total = 0;
>> +
>> +       for_each_gem_engine(ce, engines, it) {
>> +               if (ce->engine->uabi_class == class)
>> +                       total += ce->runtime.total;
>> +       }
>> +
>> +       return total;
>> +}
>> +
>> +static ssize_t
>> +show_client_busy(struct device *kdev, struct device_attribute *attr, char *buf)
>> +{
>> +       struct i915_engine_busy_attribute *i915_attr =
>> +               container_of(attr, typeof(*i915_attr), attr);
>> +       unsigned int class = i915_attr->engine_class;
>> +       struct i915_drm_client *client = i915_attr->client;
>> +       u64 total = atomic64_read(&client->past_runtime[class]);
>> +       struct list_head *list = &client->ctx_list;
>> +       struct i915_gem_context *ctx;
>> +
>> +       rcu_read_lock();
>> +       list_for_each_entry_rcu(ctx, list, client_link) {
>> +               total += atomic64_read(&ctx->past_runtime[class]);
>> +               total += pphwsp_busy_add(ctx, class);
> 
> Hmm. I would like to have some GEM context agnosticism here. At the
> moment, all I have to offer is
> 
> struct client_runtime {
> 	struct list_head client_link;
> 	atomic64_t past_runtime;
> 	u64 (*cur_runtime)(struct client_runtime *);
> };

What exactly do you mean here? Who keeps a list and of what and what 
does the vfunc do?

Regards,

Tvrtko


_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-03-18 14:15 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-18 12:11 [Intel-gfx] [PATCH 00/10] Per client engine busyness Tvrtko Ursulin
2020-03-18 12:11 ` [Intel-gfx] [PATCH 01/10] drm/i915: Expose list of clients in sysfs Tvrtko Ursulin
2020-03-18 12:11 ` [Intel-gfx] [PATCH 02/10] drm/i915: Update client name on context create Tvrtko Ursulin
2020-03-18 12:11 ` [Intel-gfx] [PATCH 03/10] drm/i915: Make GEM contexts track DRM clients Tvrtko Ursulin
2020-03-18 13:47   ` Chris Wilson
2020-03-18 12:11 ` [Intel-gfx] [PATCH 04/10] drm/i915: Use explicit flag to mark unreachable intel_context Tvrtko Ursulin
2020-03-18 13:49   ` Chris Wilson
2020-03-18 13:55     ` Tvrtko Ursulin
2020-03-18 12:11 ` [Intel-gfx] [PATCH 05/10] drm/i915: Track runtime spent in unreachable intel_contexts Tvrtko Ursulin
2020-03-18 13:55   ` Chris Wilson
2020-03-18 14:13     ` Tvrtko Ursulin
2020-03-18 14:32       ` Chris Wilson
2020-03-18 14:38         ` Tvrtko Ursulin
2020-03-18 14:48           ` Chris Wilson
2020-03-18 15:07             ` Chris Wilson
2020-03-18 12:11 ` [Intel-gfx] [PATCH 06/10] drm/i915: Track runtime spent in closed GEM contexts Tvrtko Ursulin
2020-03-18 13:57   ` Chris Wilson
2020-03-18 12:11 ` [Intel-gfx] [PATCH 07/10] drm/i915: Track all user contexts per client Tvrtko Ursulin
2020-03-18 12:11 ` [Intel-gfx] [PATCH 08/10] drm/i915: Expose per-engine client busyness Tvrtko Ursulin
2020-03-18 14:00   ` Chris Wilson
2020-03-18 14:15     ` Tvrtko Ursulin [this message]
2020-03-18 14:34       ` Chris Wilson
2020-04-15 10:19         ` Tvrtko Ursulin
2020-03-18 12:11 ` [Intel-gfx] [PATCH 09/10] drm/i915: Track context current active time Tvrtko Ursulin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aec5ec90-0c1d-e1cb-f7c4-ff5b2112a005@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=chris@chris-wilson.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.