linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Potapenko <glider@google.com>
To: Marco Elver <elver@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Dmitriy Vyukov <dvyukov@google.com>,
	 LKML <linux-kernel@vger.kernel.org>,
	 Linux Memory Management List <linux-mm@kvack.org>,
	kasan-dev <kasan-dev@googlegroups.com>,
	 Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: Re: [PATCH] kfence: test: fail fast if disabled at boot
Date: Wed, 25 Aug 2021 12:57:41 +0200	[thread overview]
Message-ID: <CAG_fn=VMqbOwDkpae02EsE4QoEk_vbW3sM0KzsXWLDceOYGSzA@mail.gmail.com> (raw)
In-Reply-To: <20210825105533.1247922-1-elver@google.com>

On Wed, Aug 25, 2021 at 12:55 PM Marco Elver <elver@google.com> wrote:
>
> Fail kfence_test fast if KFENCE was disabled at boot, instead of each
> test case trying several seconds to allocate from KFENCE and failing.
> KUnit will fail all test cases if kunit_suite::init returns an error.
>
> Even if KFENCE was disabled, we still want the test to fail, so that CI
> systems that parse KUnit output will alert on KFENCE being disabled
> (accidentally or otherwise).
>
> Reported-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> Signed-off-by: Marco Elver <elver@google.com>
Acked-by: Alexander Potapenko <glider@google.com>


> ---
>  mm/kfence/kfence_test.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/mm/kfence/kfence_test.c b/mm/kfence/kfence_test.c
> index eb6307c199ea..f1690cf54199 100644
> --- a/mm/kfence/kfence_test.c
> +++ b/mm/kfence/kfence_test.c
> @@ -800,6 +800,9 @@ static int test_init(struct kunit *test)
>         unsigned long flags;
>         int i;
>
> +       if (!__kfence_pool)
> +               return -EINVAL;
> +
>         spin_lock_irqsave(&observed.lock, flags);
>         for (i = 0; i < ARRAY_SIZE(observed.lines); i++)
>                 observed.lines[i][0] = '\0';
> --
> 2.33.0.rc2.250.ged5fa647cd-goog
>


-- 
Alexander Potapenko
Software Engineer

Google Germany GmbH
Erika-Mann-Straße, 33
80636 München

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg


  reply	other threads:[~2021-08-25 10:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25 10:55 [PATCH] kfence: test: fail fast if disabled at boot Marco Elver
2021-08-25 10:57 ` Alexander Potapenko [this message]
2021-08-26  4:21 ` Kefeng Wang

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='CAG_fn=VMqbOwDkpae02EsE4QoEk_vbW3sM0KzsXWLDceOYGSzA@mail.gmail.com' \
    --to=glider@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=wangkefeng.wang@huawei.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;
as well as URLs for NNTP newsgroup(s).