LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Alexander Potapenko <glider@google.com>
Cc: Russell King <linux@armlinux.org.uk>,
	Marco Elver <elver@google.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	kasan-dev <kasan-dev@googlegroups.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 4/4] mm: kfence: Only load kfence_test when kfence is enabled
Date: Wed, 25 Aug 2021 17:55:01 +0800	[thread overview]
Message-ID: <99daf260-76af-8316-fa9a-a649c8a8d1ab@huawei.com> (raw)
In-Reply-To: <CAG_fn=X9oaw0zJrcmShNcvd3UsNSFKsH3kSdD5Yx=4Sk_WtNrQ@mail.gmail.com>


On 2021/8/25 17:31, Alexander Potapenko wrote:
> On Wed, Aug 25, 2021 at 11:17 AM Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>> Provide kfence_is_enabled() helper, only load kfence_test module
>> when kfence is enabled.
> What's wrong with the current behavior?
> I think we need at least some way to tell the developer that KFENCE
> does not work, and a failing test seems to be the perfect one.

If the kfence is not enabled, eg kfence.sample_interval=0, kfence_test 
spend too much time,

and all tests will fails. It is meaningless. so better to just skip it ;)

>> diff --git a/mm/kfence/kfence_test.c b/mm/kfence/kfence_test.c
>> index eb6307c199ea..4087f9f1497e 100644
>> --- a/mm/kfence/kfence_test.c
>> +++ b/mm/kfence/kfence_test.c
>> @@ -847,6 +847,8 @@ static void unregister_tracepoints(struct tracepoint *tp, void *ignore)
>>    */
>>   static int __init kfence_test_init(void)
>>   {
>> +       if (!kfence_is_enabled())

Add a print info here?

>> +               return 0;
>>          /*
>>           * Because we want to be able to build the test as a module, we need to
>>           * iterate through all known tracepoints, since the static registration
>> --
>> 2.26.2
>>
>> --
>> You received this message because you are subscribed to the Google Groups "kasan-dev" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to kasan-dev+unsubscribe@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/kasan-dev/20210825092116.149975-5-wangkefeng.wang%40huawei.com.
>
>

  parent reply	other threads:[~2021-08-25  9:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25  9:21 [PATCH 0/4] ARM: Support KFENCE feature Kefeng Wang
2021-08-25  9:21 ` [PATCH 1/4] ARM: mm: Provide set_memory_valid() Kefeng Wang
2021-08-25  9:21 ` [PATCH 2/4] ARM: mm: Provide is_write_fault() Kefeng Wang
2021-08-25  9:21 ` [PATCH 3/4] ARM: Support KFENCE for ARM Kefeng Wang
2021-08-25 13:18   ` ownia
2021-08-25 14:31     ` Kefeng Wang
2021-08-25  9:21 ` [PATCH 4/4] mm: kfence: Only load kfence_test when kfence is enabled Kefeng Wang
2021-08-25  9:31   ` Alexander Potapenko
2021-08-25  9:54     ` Marco Elver
2021-08-25  9:55     ` Kefeng Wang [this message]
2021-08-25  9:59       ` Marco Elver
2021-08-25 10:14 ` [PATCH 0/4] ARM: Support KFENCE feature Marco Elver
2021-08-25 10:57   ` Marco Elver
2021-08-25 14:15     ` Kefeng Wang
2021-08-25 14:28     ` 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=99daf260-76af-8316-fa9a-a649c8a8d1ab@huawei.com \
    --to=wangkefeng.wang@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=glider@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --subject='Re: [PATCH 4/4] mm: kfence: Only load kfence_test when kfence is enabled' \
    /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

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).