From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Disable kmem_caches when KASAN is enabled
Date: Wed, 15 Mar 2017 13:14:50 +0200 [thread overview]
Message-ID: <87tw6u23md.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20170315095437.GT2118@nuc-i3427.alporthouse.com>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> On Wed, Mar 15, 2017 at 11:46:24AM +0200, Mika Kuoppala wrote:
>> Chris Wilson <chris@chris-wilson.co.uk> writes:
>>
>> > kasan is very good at detecting use-after-free. However, our requests
>> > are allocated from a rcu-typesafe slab that is important for performance
>> > but makes kasan less effective. When enabling kasan we are intentionally
>> > looking for memory errors, disable the use of our caches to improve the
>> > likelihood of kasan spotting a bug.
>> >
I didn't notice anything except the typo in the desc. Until
someone makes a kmem_cache kasan aware, this patch would
be useful if and when someone does kasan runs with our driver.
The name could be DEBUG_KMEM_CACHE_DISABLE. It is more logical
wrt to content of the patch. However perhaps the current name
is more practical.
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
>> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>> > ---
>> > drivers/gpu/drm/i915/Kconfig.debug | 13 +++++++++++++
>> > drivers/gpu/drm/i915/i915_gem.c | 11 +++++++++--
>> > drivers/gpu/drm/i915/i915_gem_request.c | 25 ++++++++++++++++++++-----
>> > drivers/gpu/drm/i915/i915_vma.c | 15 ++++++++++++---
>> > 4 files changed, 54 insertions(+), 10 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/i915/Kconfig.debug b/drivers/gpu/drm/i915/Kconfig.debug
>> > index e091809a9a9e..bd8e90e4dfb9 100644
>> > --- a/drivers/gpu/drm/i915/Kconfig.debug
>> > +++ b/drivers/gpu/drm/i915/Kconfig.debug
>> > @@ -48,6 +48,19 @@ config DRM_I915_DEBUG_GEM
>> >
>> > If in doubt, say "N".
>> >
>> > +config DRM_I915_DEBUG_KASAN
>> > + bool "Insert extra checks when using KASAN"
>> > + default n
>> > + depends on DRM_I915_WERROR
>> > + depends on KASAN
>> > + help
>> > + Turns off use of kmem_caches to improve KASAN error detection,
>> > + and inserts extra santiy checks.
>>
>> s/santiy/sanity.
>>
>> Would i915.kmem_cache=0/1 be too costly?
>
> More of the principle. Having module options means somebody will enable
> it. Hiding it away underneath a bevy of expert config options makes it
> much less likely. CI basically have to do two runs for each option -- if
> we are using kasan, we want improved coverage, but we also need to test
> that the default configuration works. It's probably best just to teach
> kmem_cache itself to behave differently if it helps. I was just thinking
> fine-grained swapping of behaviour would be benificial.
> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-03-15 11:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-14 16:16 [PATCH] drm/i915: Disable kmem_caches when KASAN is enabled Chris Wilson
2017-03-15 8:31 ` ✗ Fi.CI.BAT: failure for " Patchwork
2017-03-15 8:43 ` ✓ Fi.CI.BAT: success " Patchwork
2017-03-15 9:46 ` [PATCH] " Mika Kuoppala
2017-03-15 9:54 ` Chris Wilson
2017-03-15 11:14 ` Mika Kuoppala [this message]
2017-03-15 11:21 ` Chris Wilson
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=87tw6u23md.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
/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.