From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: Matthew Brost <matthew.brost@intel.com>
Cc: igt-dev@lists.freedesktop.org,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Subject: Re: [PATCH i-g-t 2/2] tests/intel/xe_evict: Reduce the "large" bo size for threaded eviction
Date: Thu, 27 Jun 2024 09:31:11 +0200 [thread overview]
Message-ID: <cac23f80b7bec12bfdc5a35269a94e564d697536.camel@linux.intel.com> (raw)
In-Reply-To: <Zn0H/D/DXVoEdSX0@DUT025-TGLU.fm.intel.com>
On Thu, 2024-06-27 at 06:34 +0000, Matthew Brost wrote:
> On Wed, Jun 26, 2024 at 02:38:33PM +0200, Thomas Hellström wrote:
> > When calculating the number of bos that simultaneously fits in
> > VRAM + system memory, account for eviction pipelining by
> > subtracting
> > one bo for ongoing pipelined evictions per thread.
> >
> > With large bos this may lead to us not being able to use a working
> > set of 2 bos, which is the minimum, so reduce the large bo size for
> > threaded evictions, and instead increase the default number of bos.
> >
> > Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> > ---
> > tests/intel/xe_evict.c | 41 +++++++++++++++++++++++++-------------
> > ---
> > 1 file changed, 25 insertions(+), 16 deletions(-)
> >
> > diff --git a/tests/intel/xe_evict.c b/tests/intel/xe_evict.c
> > index 5691ad021..13e90d317 100644
> > --- a/tests/intel/xe_evict.c
> > +++ b/tests/intel/xe_evict.c
> > @@ -484,10 +484,16 @@ static unsigned int working_set(uint64_t
> > vram_size, uint64_t system_size,
> > if (flags & MULTI_VM)
> > set_size *= 2;
> >
> > - /* All bos must fit in memory, assuming no swapping */
> > - total_size = ((vram_size - 1) / bo_size + system_size /
> > bo_size) /
> > + /*
> > + * All bos must fit in memory, assuming no swapping.
> > Subtract one bo per
> > + * thread for an active eviction.
> > + */
> > + total_size = ((vram_size - 1) / bo_size + (system_size -
> > 1) / bo_size - 1) /
>
> Had a comment in previous patch about 'system_size / bo_size' too.
>
> Why change this to (system_size - 1) here?
It's to round down if the large bos is an exact multiple of system
size. However, with the comment on the previous patch I think it makes
more sense to use a fraction, say 90% of available system size. I'll
check if igt has a way of detecting available swap size as well...
/Thomas
>
> I get the '- 1' at the end.
>
> Matt
>
> > num_threads;
> >
> > + igt_debug("num_threads: %d bo_size : %lu total_size : %lu
> > \n", num_threads,
> > + bo_size, total_size);
> > +
> > if (set_size > total_size)
> > set_size = total_size;
> >
> > @@ -741,13 +747,13 @@ igt_main
> > MIXED_THREADS | THREADED },
> > { "mixed-many-threads-small", 3, 16, 128, 1, 128,
> > THREADED },
> > - { "threads-large", 2, 2, 4, 3, 8,
> > + { "threads-large", 2, 2, 16, 3, 32,
> > THREADED },
> > - { "cm-threads-large", 2, 2, 4, 3, 8,
> > + { "cm-threads-large", 2, 2, 16, 3, 32,
> > COMPUTE_THREAD | THREADED },
> > - { "mixed-threads-large", 2, 2, 4, 3, 8,
> > + { "mixed-threads-large", 2, 2, 16, 3, 32,
> > MIXED_THREADS | THREADED },
> > - { "mixed-many-threads-large", 3, 2, 4, 3, 8,
> > + { "mixed-many-threads-large", 3, 2, 16, 3, 32,
> > THREADED },
> > { "threads-small-multi-vm", 2, 16, 128, 1, 128,
> > MULTI_VM | THREADED },
> > @@ -755,11 +761,11 @@ igt_main
> > COMPUTE_THREAD | MULTI_VM | THREADED },
> > { "mixed-threads-small-multi-vm", 2, 16, 128, 1,
> > 128,
> > MIXED_THREADS | MULTI_VM | THREADED },
> > - { "threads-large-multi-vm", 2, 2, 4, 3, 8,
> > + { "threads-large-multi-vm", 2, 2, 16, 3, 32,
> > MULTI_VM | THREADED },
> > - { "cm-threads-large-multi-vm", 2, 2, 4, 3, 8,
> > + { "cm-threads-large-multi-vm", 2, 2, 16, 3, 32,
> > COMPUTE_THREAD | MULTI_VM | THREADED },
> > - { "mixed-threads-large-multi-vm", 2, 2, 4, 3, 8,
> > + { "mixed-threads-large-multi-vm", 2, 2, 16, 3, 32,
> > MIXED_THREADS | MULTI_VM | THREADED },
> > { "beng-threads-small", 2, 16, 128, 1, 128,
> > THREADED | BIND_EXEC_QUEUE },
> > @@ -769,13 +775,13 @@ igt_main
> > MIXED_THREADS | THREADED | BIND_EXEC_QUEUE
> > },
> > { "beng-mixed-many-threads-small", 3, 16, 128, 1,
> > 128,
> > THREADED | BIND_EXEC_QUEUE },
> > - { "beng-threads-large", 2, 2, 4, 3, 8,
> > + { "beng-threads-large", 2, 2, 16, 3, 32,
> > THREADED | BIND_EXEC_QUEUE },
> > - { "beng-cm-threads-large", 2, 2, 4, 3, 8,
> > + { "beng-cm-threads-large", 2, 2, 16, 3, 32,
> > COMPUTE_THREAD | THREADED |
> > BIND_EXEC_QUEUE },
> > - { "beng-mixed-threads-large", 2, 2, 4, 3, 8,
> > + { "beng-mixed-threads-large", 2, 2, 16, 3, 32,
> > MIXED_THREADS | THREADED | BIND_EXEC_QUEUE
> > },
> > - { "beng-mixed-many-threads-large", 3, 2, 4, 3, 8,
> > + { "beng-mixed-many-threads-large", 3, 2, 16, 3,
> > 32,
> > THREADED | BIND_EXEC_QUEUE },
> > { "beng-threads-small-multi-vm", 2, 16, 128, 1,
> > 128,
> > MULTI_VM | THREADED | BIND_EXEC_QUEUE },
> > @@ -783,11 +789,11 @@ igt_main
> > COMPUTE_THREAD | MULTI_VM | THREADED |
> > BIND_EXEC_QUEUE },
> > { "beng-mixed-threads-small-multi-vm", 2, 16, 128,
> > 1, 128,
> > MIXED_THREADS | MULTI_VM | THREADED |
> > BIND_EXEC_QUEUE },
> > - { "beng-threads-large-multi-vm", 2, 2, 4, 3, 8,
> > + { "beng-threads-large-multi-vm", 2, 2, 16, 3, 32,
> > MULTI_VM | THREADED | BIND_EXEC_QUEUE },
> > - { "beng-cm-threads-large-multi-vm", 2, 2, 4, 3, 8,
> > + { "beng-cm-threads-large-multi-vm", 2, 2, 16, 3,
> > 32,
> > COMPUTE_THREAD | MULTI_VM | THREADED |
> > BIND_EXEC_QUEUE },
> > - { "beng-mixed-threads-large-multi-vm", 2, 2, 4, 3,
> > 8,
> > + { "beng-mixed-threads-large-multi-vm", 2, 2, 16,
> > 3, 32,
> > MIXED_THREADS | MULTI_VM | THREADED |
> > BIND_EXEC_QUEUE },
> > { NULL },
> > };
> > @@ -823,6 +829,7 @@ igt_main
> > 1, s->flags);
> >
> > igt_debug("Max working set %d n_execs
> > %d\n", ws, s->n_execs);
> > + igt_skip_on_f(!ws, "System memory size is
> > too small.\n");
> > test_evict(fd, hwe, s->n_exec_queues,
> > min(ws, s->n_execs), bo_size,
> > s->flags, NULL);
> > @@ -836,6 +843,7 @@ igt_main
> > 1, s->flags);
> >
> > igt_debug("Max working set %d n_execs
> > %d\n", ws, s->n_execs);
> > + igt_skip_on_f(!ws, "System memory size is
> > too small.\n");
> > test_evict_cm(fd, hwe, s->n_exec_queues,
> > min(ws, s->n_execs),
> > bo_size,
> > s->flags, NULL);
> > @@ -849,6 +857,7 @@ igt_main
> > s->n_threads, s-
> > >flags);
> >
> > igt_debug("Max working set %d n_execs
> > %d\n", ws, s->n_execs);
> > + igt_skip_on_f(!ws, "System memory size is
> > too small.\n");
> > threads(fd, hwe, s->n_threads, s-
> > >n_exec_queues,
> > min(ws, s->n_execs), bo_size, s-
> > >flags);
> > }
> > --
> > 2.44.0
> >
next prev parent reply other threads:[~2024-06-27 7:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-26 12:38 [PATCH i-g-t 0/2] tests/intel/xe_evict: Adapt the working set to memory size Thomas Hellström
2024-06-26 12:38 ` [PATCH i-g-t 1/2] tests/intel/xe_evict: Reduce allocations to maximum working set Thomas Hellström
2024-06-27 6:29 ` Matthew Brost
2024-06-27 7:28 ` Thomas Hellström
2024-06-26 12:38 ` [PATCH i-g-t 2/2] tests/intel/xe_evict: Reduce the "large" bo size for threaded eviction Thomas Hellström
2024-06-27 6:34 ` Matthew Brost
2024-06-27 7:31 ` Thomas Hellström [this message]
2024-06-26 15:20 ` ✗ Fi.CI.BAT: failure for tests/intel/xe_evict: Adapt the working set to memory size Patchwork
2024-06-26 15:23 ` ✓ CI.xeBAT: success " Patchwork
2024-06-26 17:00 ` [PATCH i-g-t 0/2] " Matthew Brost
2024-06-26 21:02 ` ✓ CI.xeFULL: success for " 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=cac23f80b7bec12bfdc5a35269a94e564d697536.camel@linux.intel.com \
--to=thomas.hellstrom@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=matthew.brost@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox