All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH i-g-t] intel_gpu_top: Hide unused clients
Date: Mon, 01 Feb 2021 08:49:32 +0000	[thread overview]
Message-ID: <161216937277.30865.15090400644839237744@build.alporthouse.com> (raw)
In-Reply-To: <abe2678a-f798-d625-0f59-f6ebf1ef5e4f@linux.intel.com>

Quoting Tvrtko Ursulin (2021-02-01 08:36:04)
> 
> On 01/02/2021 08:21, Chris Wilson wrote:
> > Quoting Tvrtko Ursulin (2021-02-01 08:14:45)
> >>
> >> On 31/01/2021 03:11, Chris Wilson wrote:
> >>> Keep new clients hidden until they utilise the GPU.
> >>>
> >>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> >>> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> >>> ---
> >>>    tools/intel_gpu_top.c | 5 ++++-
> >>>    1 file changed, 4 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
> >>> index 60ff62d28..66a8effa6 100644
> >>> --- a/tools/intel_gpu_top.c
> >>> +++ b/tools/intel_gpu_top.c
> >>> @@ -828,8 +828,11 @@ static void update_client(struct client *c, unsigned int pid, char *name)
> >>>                c->last[i] = val[i];
> >>>        }
> >>>    
> >>> -     c->samples++;
> >>> +     if (!c->total_runtime)
> >>> +             return;
> >>> +
> >>>        c->status = ALIVE;
> >>> +     c->samples++;
> >>>    }
> >>>    
> >>>    static void
> >>>
> >>
> >> Not sure we need to do it at this level and not instead at presentation
> >> time.
> > 
> > My goal was just presentation :(
> 
> Something like this would be presentation time:
> 
> diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
> index 60ff62d28e5d..f7c5cc3bf19f 100644
> --- a/tools/intel_gpu_top.c
> +++ b/tools/intel_gpu_top.c
> @@ -1942,6 +1942,9 @@ print_client(struct client *c, struct engines 
> *engines, double t, int lines,
>          unsigned int i;
> 
>          if (output_mode == INTERACTIVE) {
> +               if (!c->total_runtime) /* make a key toggle? */
> +                       return;
> +
>                  lines++;
> 
>                  printf("%6u %17s ", c->pid, c->print_name);
> 
> But it worries me a bit to do it by default.

I was about to argue then remembered top behaves the same (although a
process cannot exist without consuming at least some CPU resources,
whereas a client can never touch the GPU or allocate GPU memory).

But if we are borrow ideas for filtering the view from top... :)

For top, it's 'i' and there's o%CPU>x

> >> Plus, in default sort mode they would be at the end of the list,
> >> so behind the more active clients. Or you go into sort by id and they
> >> annoy you there?
> > 
> > No. I had a bunch of "Xorg" when launching steam which never became
> > anything. So I guess just a bunch of dlopen("libgl") spawing a bunch of
> > clients that we never used for anything more than gl[X]GetString, but
> > leaked the fd.
> 
> But they were at the end, so potentially even cut of if enough 
> interesting clients? Or you actually sorted by id? Or something else is 
> broken?

But they were there! Unwanted DRI3 fd, abandoned, left homeless before
being used. Even if they are used, there's still a window where we would
see "Xorg" become "realname" (granted there's still a window as we
sample pidname before totalruntime), it irks me.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

WARNING: multiple messages have this Message-ID (diff)
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] intel_gpu_top: Hide unused clients
Date: Mon, 01 Feb 2021 08:49:32 +0000	[thread overview]
Message-ID: <161216937277.30865.15090400644839237744@build.alporthouse.com> (raw)
In-Reply-To: <abe2678a-f798-d625-0f59-f6ebf1ef5e4f@linux.intel.com>

Quoting Tvrtko Ursulin (2021-02-01 08:36:04)
> 
> On 01/02/2021 08:21, Chris Wilson wrote:
> > Quoting Tvrtko Ursulin (2021-02-01 08:14:45)
> >>
> >> On 31/01/2021 03:11, Chris Wilson wrote:
> >>> Keep new clients hidden until they utilise the GPU.
> >>>
> >>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> >>> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> >>> ---
> >>>    tools/intel_gpu_top.c | 5 ++++-
> >>>    1 file changed, 4 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
> >>> index 60ff62d28..66a8effa6 100644
> >>> --- a/tools/intel_gpu_top.c
> >>> +++ b/tools/intel_gpu_top.c
> >>> @@ -828,8 +828,11 @@ static void update_client(struct client *c, unsigned int pid, char *name)
> >>>                c->last[i] = val[i];
> >>>        }
> >>>    
> >>> -     c->samples++;
> >>> +     if (!c->total_runtime)
> >>> +             return;
> >>> +
> >>>        c->status = ALIVE;
> >>> +     c->samples++;
> >>>    }
> >>>    
> >>>    static void
> >>>
> >>
> >> Not sure we need to do it at this level and not instead at presentation
> >> time.
> > 
> > My goal was just presentation :(
> 
> Something like this would be presentation time:
> 
> diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
> index 60ff62d28e5d..f7c5cc3bf19f 100644
> --- a/tools/intel_gpu_top.c
> +++ b/tools/intel_gpu_top.c
> @@ -1942,6 +1942,9 @@ print_client(struct client *c, struct engines 
> *engines, double t, int lines,
>          unsigned int i;
> 
>          if (output_mode == INTERACTIVE) {
> +               if (!c->total_runtime) /* make a key toggle? */
> +                       return;
> +
>                  lines++;
> 
>                  printf("%6u %17s ", c->pid, c->print_name);
> 
> But it worries me a bit to do it by default.

I was about to argue then remembered top behaves the same (although a
process cannot exist without consuming at least some CPU resources,
whereas a client can never touch the GPU or allocate GPU memory).

But if we are borrow ideas for filtering the view from top... :)

For top, it's 'i' and there's o%CPU>x

> >> Plus, in default sort mode they would be at the end of the list,
> >> so behind the more active clients. Or you go into sort by id and they
> >> annoy you there?
> > 
> > No. I had a bunch of "Xorg" when launching steam which never became
> > anything. So I guess just a bunch of dlopen("libgl") spawing a bunch of
> > clients that we never used for anything more than gl[X]GetString, but
> > leaked the fd.
> 
> But they were at the end, so potentially even cut of if enough 
> interesting clients? Or you actually sorted by id? Or something else is 
> broken?

But they were there! Unwanted DRI3 fd, abandoned, left homeless before
being used. Even if they are used, there's still a window where we would
see "Xorg" become "realname" (granted there's still a window as we
sample pidname before totalruntime), it irks me.
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2021-02-01  8:49 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-31  3:11 [Intel-gfx] [PATCH i-g-t] intel_gpu_top: Hide unused clients Chris Wilson
2021-01-31  3:11 ` [igt-dev] " Chris Wilson
2021-01-31  3:46 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2021-01-31  4:48 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-02-01  8:14 ` [Intel-gfx] [PATCH i-g-t] " Tvrtko Ursulin
2021-02-01  8:14   ` [igt-dev] " Tvrtko Ursulin
2021-02-01  8:21   ` [Intel-gfx] " Chris Wilson
2021-02-01  8:21     ` [igt-dev] " Chris Wilson
2021-02-01  8:36     ` [Intel-gfx] " Tvrtko Ursulin
2021-02-01  8:36       ` [igt-dev] " Tvrtko Ursulin
2021-02-01  8:49       ` Chris Wilson [this message]
2021-02-01  8:49         ` Chris Wilson
2021-02-01  8:53 ` [Intel-gfx] " Chris Wilson
2021-02-01  9:12   ` Tvrtko Ursulin
2021-02-01  9:31   ` [Intel-gfx] [PATCH i-g-t v2] " Chris Wilson
2021-02-01  9:53     ` Tvrtko Ursulin
2021-02-01  9:53       ` [igt-dev] " Tvrtko Ursulin
2021-02-01  9:57       ` [Intel-gfx] " Chris Wilson
2021-02-01 10:05         ` Tvrtko Ursulin
2021-02-01 10:05           ` Tvrtko Ursulin
2021-02-01 13:02   ` [igt-dev] ✗ Fi.CI.BUILD: failure for intel_gpu_top: Hide unused clients (rev3) Patchwork

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=161216937277.30865.15090400644839237744@build.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tvrtko.ursulin@linux.intel.com \
    /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.