From: David Gow <davidgow@google.com>
To: Vincent Whitchurch <vincent.whitchurch@axis.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>,
Dmitry Vyukov <dvyukov@google.com>,
Johannes Berg <johannes@sipsolutions.net>,
Patricia Alfonso <trishalfonso@google.com>,
Jeff Dike <jdike@addtoit.com>,
Richard Weinberger <richard@nod.at>,
"anton.ivanov@cambridgegreys.com"
<anton.ivanov@cambridgegreys.com>,
Brendan Higgins <brendanhiggins@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Andrey Ryabinin <ryabinin.a.a@gmail.com>,
kasan-dev <kasan-dev@googlegroups.com>,
"linux-um@lists.infradead.org" <linux-um@lists.infradead.org>,
LKML <linux-kernel@vger.kernel.org>,
Daniel Latypov <dlatypov@google.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"kunit-dev@googlegroups.com" <kunit-dev@googlegroups.com>
Subject: Re: [PATCH v4 2/2] UML: add support for KASAN under x86_64
Date: Fri, 1 Jul 2022 17:43:26 +0800 [thread overview]
Message-ID: <CABVgOSnEEWEe16O4YsyuiWttffdAAbkpuXehefGEEeYvjPqVkA@mail.gmail.com> (raw)
In-Reply-To: <20220701091653.GA7009@axis.com>
[-- Attachment #1: Type: text/plain, Size: 2119 bytes --]
On Fri, Jul 1, 2022 at 5:16 PM Vincent Whitchurch
<vincent.whitchurch@axis.com> wrote:
>
> On Fri, Jul 01, 2022 at 11:08:27AM +0200, David Gow wrote:
> > On Thu, Jun 30, 2022 at 9:29 PM Andrey Konovalov <andreyknvl@gmail.com> wrote:
> > > Stack trace collection code might trigger KASAN splats when walking
> > > stack frames, but this can be resolved by using unchecked accesses.
> > > The main reason to disable instrumentation here is for performance
> > > reasons, see the upcoming patch for arm64 [1] for some details.
> > >
> > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/commit/?id=802b91118d11
> >
> > Ah -- that does it! Using READ_ONCE_NOCHECK() in dump_trace() gets rid
> > of the nasty recursive KASAN failures we were getting in the tests.
> >
> > I'll send out v5 with those files instrumented again.
>
> Hmm, do we really want that? In the patch Andrey linked to above he
> removed the READ_ONCE_NOCHECK() and added the KASAN_SANITIZE on the
> corresponding files for arm64, just like it's already the case in this
> patch for UML.
Personally, I'm okay with the performance overhead so far: in my tests
with a collection of ~350 KUnit tests, the total difference in runtime
was about ~.2 seconds, and was within the margin of error caused by
fluctuations in the compilation time.
As an example, without the stacktrace code instrumented:
[17:36:50] Testing complete. Passed: 364, Failed: 0, Crashed: 0,
Skipped: 47, Errors: 0
[17:36:50] Elapsed time: 15.114s total, 0.003s configuring, 8.518s
building, 6.433s running
versus with it instrumented:
[17:35:40] Testing complete. Passed: 364, Failed: 0, Crashed: 0,
Skipped: 47, Errors: 0
[17:35:40] Elapsed time: 15.497s total, 0.003s configuring, 8.691s
building, 6.640s running
That being said, I'm okay with disabling it again and adding a comment
if it's slow enough in some other usecase to cause problems (or even
just be annoying). That could either be done in a v6 of this patchset,
or a follow-up patch, depending on what people would prefer. But I'd
not have a problem with leaving it instrumented for now.
-- David
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4003 bytes --]
next prev parent reply other threads:[~2022-07-01 9:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-30 8:08 [PATCH v4 1/2] mm: Add PAGE_ALIGN_DOWN macro David Gow
2022-06-30 8:08 ` [PATCH v4 2/2] UML: add support for KASAN under x86_64 David Gow
2022-06-30 9:41 ` Dmitry Vyukov
2022-06-30 12:54 ` Vincent Whitchurch
2022-06-30 13:28 ` Andrey Konovalov
2022-07-01 9:08 ` David Gow
2022-07-01 9:16 ` Vincent Whitchurch
2022-07-01 9:43 ` David Gow [this message]
2022-07-01 10:04 ` Vincent Whitchurch
2022-07-01 10:34 ` Dmitry Vyukov
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=CABVgOSnEEWEe16O4YsyuiWttffdAAbkpuXehefGEEeYvjPqVkA@mail.gmail.com \
--to=davidgow@google.com \
--cc=akpm@linux-foundation.org \
--cc=andreyknvl@gmail.com \
--cc=anton.ivanov@cambridgegreys.com \
--cc=brendanhiggins@google.com \
--cc=dlatypov@google.com \
--cc=dvyukov@google.com \
--cc=jdike@addtoit.com \
--cc=johannes@sipsolutions.net \
--cc=kasan-dev@googlegroups.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-um@lists.infradead.org \
--cc=richard@nod.at \
--cc=ryabinin.a.a@gmail.com \
--cc=trishalfonso@google.com \
--cc=vincent.whitchurch@axis.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