From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] tests/gem_evict_everything: Use bo_count instead of count where intended Date: Fri, 6 Dec 2013 13:12:40 +0100 Message-ID: <20131206121240.GL27344@phenom.ffwll.local> References: <1386329869-12379-1-git-send-email-tvrtko.ursulin@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ea0-f169.google.com (mail-ea0-f169.google.com [209.85.215.169]) by gabe.freedesktop.org (Postfix) with ESMTP id A39FBFBBB5 for ; Fri, 6 Dec 2013 04:11:52 -0800 (PST) Received: by mail-ea0-f169.google.com with SMTP id l9so267856eaj.0 for ; Fri, 06 Dec 2013 04:11:52 -0800 (PST) Content-Disposition: inline In-Reply-To: <1386329869-12379-1-git-send-email-tvrtko.ursulin@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Tvrtko Ursulin Cc: Intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Fri, Dec 06, 2013 at 11:37:49AM +0000, Tvrtko Ursulin wrote: > From: Tvrtko Ursulin > > Don't see that it causes a problem but it looks it was intended > to use bo_count at these places. > > Also using count to determine number of processes does not make > sense unless thousands of cores. > > Signed-off-by: Tvrtko Ursulin > --- > tests/gem_evict_everything.c | 12 +++++------- > 1 file changed, 5 insertions(+), 7 deletions(-) > > diff --git a/tests/gem_evict_everything.c b/tests/gem_evict_everything.c > index 41abef7..90c3ae1 100644 > --- a/tests/gem_evict_everything.c > +++ b/tests/gem_evict_everything.c > @@ -135,8 +135,6 @@ static void exchange_uint32_t(void *array, unsigned i, unsigned j) > i_arr[j] = i_tmp; > } > > -#define min(a, b) ((a) < (b) ? (a) : (b)) > - > #define INTERRUPTIBLE (1 << 0) > #define SWAPPING (1 << 1) > #define DUP_DRMFD (1 << 2) > @@ -168,7 +166,7 @@ static void forked_evictions(int fd, int size, int count, > for (n = 0; n < bo_count; n++) > bo[n] = gem_create(fd, size); > > - igt_fork(i, min(count, min(num_threads * 5, 12))) { > + igt_fork(i, num_threads * 4) { You've killed the min( , 12) here ... that'll hurt on big desktops. Otherwise patch looks good. -Daniel > int realfd = fd; > int num_passes = flags & SWAPPING ? 10 : 100; > > @@ -184,7 +182,7 @@ static void forked_evictions(int fd, int size, int count, > realfd = drm_open_any(); > > /* We can overwrite the bo array since we're forked. */ > - for (l = 0; l < count; l++) { > + for (l = 0; l < bo_count; l++) { > uint32_t flink; > > flink = gem_flink(fd, bo[l]); > @@ -194,9 +192,9 @@ static void forked_evictions(int fd, int size, int count, > } > > for (pass = 0; pass < num_passes; pass++) { > - copy(realfd, bo[0], bo[1], bo, count, 0); > + copy(realfd, bo[0], bo[1], bo, bo_count, 0); > > - for (l = 0; l < count && (flags & MEMORY_PRESSURE); l++) { > + for (l = 0; l < bo_count && (flags & MEMORY_PRESSURE); l++) { > uint32_t *base = gem_mmap__cpu(realfd, bo[l], > size, > PROT_READ | PROT_WRITE); > @@ -244,7 +242,7 @@ static void swapping_evictions(int fd, int size, int count) > igt_permute_array(bo, bo_count, exchange_uint32_t); > > for (pass = 0; pass < 100; pass++) { > - copy(fd, bo[0], bo[1], bo, count, 0); > + copy(fd, bo[0], bo[1], bo, bo_count, 0); > } > } > > -- > 1.8.4.3 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch