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>,
	igt-dev@lists.freedesktop.org
Cc: Intel-gfx@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] lib: Silence Valgrind warning in synce_fence_status
Date: Thu, 27 Jun 2019 15:06:35 +0100	[thread overview]
Message-ID: <156164439534.9225.10573719047261245304@skylake-alporthouse-com> (raw)
In-Reply-To: <73df9149-e9a2-8fc7-ba53-073ca496d5aa@linux.intel.com>

Quoting Tvrtko Ursulin (2019-06-27 14:59:10)
> 
> On 27/06/2019 14:06, Chris Wilson wrote:
> >> +       VG(VALGRIND_MAKE_MEM_DEFINED(&fence_info, sizeof(fence_info)));
> > 
> > More fun would be to
> > 
> > struct sync_fence_info fence_info = { .status = -ENOSYS };
> > 
> > So that valgrind knows it is initialised and we reliably report an error
> > if the kernel fails to fill in the struct.
> 
> ... sure, this is also okay. For me -ENOSYS is not strictly needed at 
> this level. It would be more of a unit test for the ioctl, not belonging 
> to the library helper, but it is also fine to inject some more explicit 
> trash so it can be caught even if there are no specific unit tests.
> 
> I don't also see a problem with Valgrind annotation. It doesn't hide 
> anything, nor does it sanitises. But yes, it is not needed if we go for 
> -ENOSYS trick.

That's all I was thinking, two birds one stone. I think it is a bonus if
we don't paper over the kernel randomly serving up garbage -- but at the
same time random failures are not the easiest to debug. But at least they
serve as canaries.
-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>,
	igt-dev@lists.freedesktop.org
Cc: Intel-gfx@lists.freedesktop.org,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t] lib: Silence Valgrind warning in synce_fence_status
Date: Thu, 27 Jun 2019 15:06:35 +0100	[thread overview]
Message-ID: <156164439534.9225.10573719047261245304@skylake-alporthouse-com> (raw)
In-Reply-To: <73df9149-e9a2-8fc7-ba53-073ca496d5aa@linux.intel.com>

Quoting Tvrtko Ursulin (2019-06-27 14:59:10)
> 
> On 27/06/2019 14:06, Chris Wilson wrote:
> >> +       VG(VALGRIND_MAKE_MEM_DEFINED(&fence_info, sizeof(fence_info)));
> > 
> > More fun would be to
> > 
> > struct sync_fence_info fence_info = { .status = -ENOSYS };
> > 
> > So that valgrind knows it is initialised and we reliably report an error
> > if the kernel fails to fill in the struct.
> 
> ... sure, this is also okay. For me -ENOSYS is not strictly needed at 
> this level. It would be more of a unit test for the ioctl, not belonging 
> to the library helper, but it is also fine to inject some more explicit 
> trash so it can be caught even if there are no specific unit tests.
> 
> I don't also see a problem with Valgrind annotation. It doesn't hide 
> anything, nor does it sanitises. But yes, it is not needed if we go for 
> -ENOSYS trick.

That's all I was thinking, two birds one stone. I think it is a bonus if
we don't paper over the kernel randomly serving up garbage -- but at the
same time random failures are not the easiest to debug. But at least they
serve as canaries.
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-06-27 14:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-27 12:55 [PATCH i-g-t] lib: Silence Valgrind warning in synce_fence_status Tvrtko Ursulin
2019-06-27 12:55 ` [igt-dev] " Tvrtko Ursulin
2019-06-27 13:06 ` Chris Wilson
2019-06-27 13:06   ` Chris Wilson
2019-06-27 13:59   ` Tvrtko Ursulin
2019-06-27 13:59     ` Tvrtko Ursulin
2019-06-27 14:06     ` Chris Wilson [this message]
2019-06-27 14:06       ` Chris Wilson
2019-06-27 13:59 ` Jani Nikula
2019-06-27 13:59   ` [Intel-gfx] " Jani Nikula
2019-06-27 14:01   ` Tvrtko Ursulin
2019-06-27 14:01     ` Tvrtko Ursulin
2019-06-27 14:01   ` Chris Wilson
2019-06-27 14:01     ` [igt-dev] [Intel-gfx] " Chris Wilson
2019-06-27 14:04   ` [igt-dev] " Jani Nikula
2019-06-27 14:04     ` Jani Nikula
2019-06-27 14:42 ` [igt-dev] ✗ Fi.CI.BAT: failure 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=156164439534.9225.10573719047261245304@skylake-alporthouse-com \
    --to=chris@chris-wilson.co.uk \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=igt-dev@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.